[aseprite] 128/196: Rename cmake/Find-tests.cmake to cmake/FindTests.cmake
Tobias Hansen
thansen at moszumanska.debian.org
Wed Apr 20 18:50:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
thansen pushed a commit to branch master
in repository aseprite.
commit 0430fe998c2cd641e589d4222cc1ee67495ba412
Author: David Capello <davidcapello at gmail.com>
Date: Tue Mar 29 19:02:18 2016 -0300
Rename cmake/Find-tests.cmake to cmake/FindTests.cmake
---
cmake/{Find-tests.cmake => FindTests.cmake} | 21 ++++++++-------------
src/CMakeLists.txt | 3 +--
2 files changed, 9 insertions(+), 15 deletions(-)
diff --git a/cmake/Find-tests.cmake b/cmake/FindTests.cmake
similarity index 91%
rename from cmake/Find-tests.cmake
rename to cmake/FindTests.cmake
index 8d502e0..308be1a 100644
--- a/cmake/Find-tests.cmake
+++ b/cmake/FindTests.cmake
@@ -1,40 +1,35 @@
-# - Find tests
-# Find tests and run them
-#
-# find_test(dir dependencies)
-
+# Find tests and add rules to compile them and run them
function(find_tests dir dependencies)
file(GLOB tests ${CMAKE_CURRENT_SOURCE_DIR}/${dir}/*_tests.cpp)
list(REMOVE_AT ARGV 0)
-
+
# Add gtest include directory so we can #include <gtest/gtest.h> in tests source code
include_directories(${CMAKE_SOURCE_DIR}/third_party/gtest/include)
-
+
# See if the test is linked with "she" library.
list(FIND dependencies she link_with_she)
if(link_with_she)
set(extra_definitions -DLINKED_WITH_SHE)
endif()
-
+
foreach(testsourcefile ${tests})
get_filename_component(testname ${testsourcefile} NAME_WE)
-
+
add_executable(${testname} ${testsourcefile})
add_test(NAME ${testname} COMMAND ${testname})
-
+
if(MSVC)
# Fix problem compiling gen from a Visual Studio solution
set_target_properties(${testname}
PROPERTIES LINK_FLAGS -ENTRY:"mainCRTStartup")
endif()
-
+
target_link_libraries(${testname} gtest ${ARGV} ${PLATFORM_LIBS})
-
+
if(extra_definitions)
set_target_properties(${testname}
PROPERTIES COMPILE_FLAGS ${extra_definitions})
endif()
endforeach()
endfunction()
-
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 763e36e..bac9f3b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -166,7 +166,7 @@ install(DIRECTORY ../data
# Tests
if(ENABLE_TESTS)
- include(Find-tests)
+ include(FindTests)
find_tests(base base-lib)
find_tests(undo undo-lib)
@@ -179,4 +179,3 @@ if(ENABLE_TESTS)
find_tests(app app-lib)
find_tests(. app-lib)
endif()
-
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git
More information about the Pkg-games-commits
mailing list