From 1f401115578dfbc06a188735225552818676d9bc Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 17 Dec 2015 23:00:09 +0000 Subject: Install test binaries too. This makes command-line debugging a bit easier, and more like it is on Unix platforms. --- infrastructure/cmake/CMakeLists.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'infrastructure/cmake/CMakeLists.txt') 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 "$" - 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 "$" + 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) -- cgit v1.2.3