aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Guzmán <daniel.guzman85@gmail.com>2016-04-13 02:05:20 +0200
committerDaniel Guzmán <daniel.guzman85@gmail.com>2016-04-13 02:05:20 +0200
commit1958c636c971891326114458821369daa4b2a104 (patch)
treee04b066d156094aac0cf039ef38a3503b910d46d
parent1db0ab9d04e154345876c9ec7961063987198240 (diff)
Dependencies for test projects added
-rw-r--r--CMakeLists.txt25
1 files changed, 12 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4e0cf73..7f8e240 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -91,14 +91,15 @@ macro(require FEATURE_NAME MESSAGE_STRING)
endif()
endmacro(require)
-macro(create_test TARGET_NAME SOURCE)
+macro(create_test TARGET_NAME SOURCE DEPENDENCIES)
add_executable(${TARGET_NAME} ${SOURCE})
+ set_target_properties(${TARGET_NAME} PROPERTIES DEBUG_POSTFIX -d)
+ set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "entityx/tests")
target_link_libraries(
${TARGET_NAME}
- entityx
+ ${DEPENDENCIES}
${ARGN}
)
- set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "entityx/tests")
# Special case for benchmark tests
if (${TARGET_NAME} MATCHES .*benchmark.*)
@@ -136,9 +137,7 @@ set(sources entityx/System.cc entityx/Event.cc entityx/Entity.cc entityx/help/Ti
if (ENTITYX_BUILD_SHARED)
message("-- Building shared libraries (-DENTITYX_BUILD_SHARED=0 to only build static librarires)")
add_library(entityx_shared SHARED ${sources})
- target_link_libraries(
- entityx_shared
- )
+
set_target_properties(entityx_shared PROPERTIES
OUTPUT_NAME entityx
DEBUG_POSTFIX -d
@@ -154,13 +153,13 @@ endif (ENTITYX_BUILD_SHARED)
if (ENTITYX_BUILD_TESTING)
enable_testing()
- create_test(pool_test entityx/help/Pool_test.cc)
- create_test(entity_test entityx/Entity_test.cc)
- create_test(event_test entityx/Event_test.cc)
- create_test(system_test entityx/System_test.cc)
- create_test(tags_component_test entityx/tags/TagsComponent_test.cc)
- create_test(dependencies_test entityx/deps/Dependencies_test.cc)
- create_test(benchmarks_test entityx/Benchmarks_test.cc)
+ create_test(pool_test entityx/help/Pool_test.cc ${install_libs})
+ create_test(entity_test entityx/Entity_test.cc ${install_libs})
+ create_test(event_test entityx/Event_test.cc ${install_libs})
+ create_test(system_test entityx/System_test.cc ${install_libs})
+ create_test(tags_component_test entityx/tags/TagsComponent_test.cc ${install_libs})
+ create_test(dependencies_test entityx/deps/Dependencies_test.cc ${install_libs})
+ create_test(benchmarks_test entityx/Benchmarks_test.cc ${install_libs})
if (ENTITYX_RUN_BENCHMARKS)
message("-- Running benchmarks")
else ()