]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix: single test output dir per test 11567/head
authorPeter Munch <peterrmuench@gmail.com>
Sat, 16 Jan 2021 10:03:12 +0000 (11:03 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Sat, 16 Jan 2021 20:01:24 +0000 (21:01 +0100)
cmake/macros/macro_deal_ii_add_test.cmake

index ecf915db0881d70e5c8c76e89e6352543662efc4..a6111843f1b27f69cb8cd2b62fdb5e821e662e79 100644 (file)
@@ -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 "$<TARGET_FILE:${_target}>") # 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 "$<TARGET_FILE:${_target}>") # 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
           "$<TARGET_FILE:${_target}>"
           "${_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
           "$<TARGET_FILE:${_target}>"
           "${_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()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.