From f876b6fbe802d759fcb10d2774a43aa4d5322280 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sat, 16 Jan 2021 11:03:12 +0100 Subject: [PATCH] Fix: single test output dir per test --- cmake/macros/macro_deal_ii_add_test.cmake | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index ecf915db08..a6111843f1 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -166,6 +166,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) SET(_source_file "${_test_name}.cc") + SET(_target_short ${_test_name}.${_build_lowercase}) # target name SET(_target ${_category}.${_test_name}.${_build_lowercase}) # target name SET(_run_args "$") # the command to issue @@ -173,6 +174,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) SET(_source_file "${_test_name}.cu") + SET(_target_short ${_test_name}.${_build_lowercase}) # target name SET(_target ${_category}.${_test_name}.${_build_lowercase}) # target name SET(_run_args "$") # the command to issue @@ -202,6 +204,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) "\" is defined.\n\n" ) ENDIF() + SET(_target_short ${_target}) SET(_run_args "$" "${_prm_file}" @@ -221,6 +224,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) "\" is defined.\n\n" ) ENDIF() + SET(_target_short ${_target}) SET(_run_args "$" "${_json_file}" @@ -273,17 +277,19 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) # interruption. # ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target}/interrupt_guard.cc - COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/${_target}/interrupt_guard.cc + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_target_short}/interrupt_guard.cc + COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/${_target_short}/interrupt_guard.cc ) ADD_EXECUTABLE(${_target} EXCLUDE_FROM_ALL ${_generated_files} ${_source_file} - ${CMAKE_CURRENT_BINARY_DIR}/${_target}/interrupt_guard.cc + ${CMAKE_CURRENT_BINARY_DIR}/${_target_short}/interrupt_guard.cc ) + SET_TARGET_PROPERTIES(${_target} PROPERTIES OUTPUT_NAME ${_target_short}) + DEAL_II_SETUP_TARGET(${_target} ${_build}) TARGET_LINK_LIBRARIES(${_target} ${TEST_LIBRARIES} ${TEST_LIBRARIES_${_build}} @@ -293,7 +299,7 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) COMPILE_DEFINITIONS SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" ) SET_PROPERTY(TARGET ${_target} PROPERTY - RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_target}" + RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_target_short}" ) ENDIF() -- 2.39.5