diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 993badb..116b137 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,14 +91,14 @@ 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 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.*) @@ -129,36 +129,36 @@ message("-- Checking misc features") require(HAVE_STDINT_H "stdint.h") # Things to install -set(install_libs entityx) + set(sources entityx/System.cc entityx/Event.cc entityx/Entity.cc entityx/help/Timer.cc entityx/help/Pool.cc) -add_library(entityx STATIC ${sources}) -set_target_properties(entityx PROPERTIES DEBUG_POSTFIX -d FOLDER entityx) 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 VERSION ${ENTITYX_VERSION} SOVERSION ${ENTITYX_MAJOR_VERSION} FOLDER entityx) - list(APPEND install_libs entityx_shared) + set(install_libs entityx_shared) +else() + add_library(entityx STATIC ${sources}) + set_target_properties(entityx PROPERTIES DEBUG_POSTFIX -d FOLDER entityx) + set(install_libs entityx) 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 () @@ -197,4 +197,5 @@ install( TARGETS ${install_libs} LIBRARY DESTINATION "${libdir}" ARCHIVE DESTINATION "${libdir}" + RUNTIME DESTINATION "bin" ) |