diff options
author | Chris Wilson <chris+github@qwirx.com> | 2015-12-17 23:00:09 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2015-12-17 23:00:09 +0000 |
commit | 1f401115578dfbc06a188735225552818676d9bc (patch) | |
tree | f30859d809e3dc127d889caeccf3cd40f9c29e89 /infrastructure/cmake/CMakeLists.txt | |
parent | 0e2a099dca8afbed933aa25f47da37396e69fe5e (diff) |
Install test binaries too.
This makes command-line debugging a bit easier, and more like it is on Unix
platforms.
Diffstat (limited to 'infrastructure/cmake/CMakeLists.txt')
-rw-r--r-- | infrastructure/cmake/CMakeLists.txt | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/infrastructure/cmake/CMakeLists.txt b/infrastructure/cmake/CMakeLists.txt index 805568da..335d44e6 100644 --- a/infrastructure/cmake/CMakeLists.txt +++ b/infrastructure/cmake/CMakeLists.txt @@ -173,15 +173,10 @@ foreach(module_dep message(STATUS "add executable '${module_name}': '${module_files}'") endif() add_executable(${module_name} ${module_files}) - - # We need to install binaries in specific places so that tests - # can find them: - install(FILES "$<TARGET_FILE:${module_name}>" - DESTINATION "${base_dir}/debug/${module_dir}" - RENAME "${bin_name}${CMAKE_EXECUTABLE_SUFFIX}") elseif(module_name MATCHES "^test_") string(REGEX MATCH "^test_(.*)" valid_test ${module_name}) set(test_name ${CMAKE_MATCH_1}) + set(bin_name ${module_name}) if(DEBUG) message(STATUS "add test '${module_name}': '${module_files}'") @@ -202,6 +197,14 @@ foreach(module_dep message(FATAL_ERROR "Unsupported module type: " ${module_name}) endif() + if(module_name MATCHES "^(bin|test)_") + # We need to install binaries in specific places so that test + # runner can find them: + install(FILES "$<TARGET_FILE:${module_name}>" + DESTINATION "${base_dir}/debug/${module_dir}" + RENAME "${bin_name}${CMAKE_EXECUTABLE_SUFFIX}") + endif() + target_compile_definitions(${module_name} PRIVATE -DBOX_MODULE="${module_name}") if(dependencies) |