Skip to content

Commit

Permalink
fixup! Catch.cmake: Support CMake multi-config with PRE_TEST discover…
Browse files Browse the repository at this point in the history
…y mode
  • Loading branch information
Holger Kaelberer authored and Holger Kaelberer committed Sep 25, 2023
1 parent 1399bab commit 9b930ec
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion extras/Catch.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,14 @@ function(catch_discover_tests TARGET)
foreach(_config ${CMAKE_CONFIGURATION_TYPES})
file(GENERATE OUTPUT "${ctest_file_base}_include-${_config}.cmake" CONTENT "${ctest_include_content}" CONDITION $<CONFIG:${_config}>)
endforeach()
file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include-\${CTEST_CONFIGURATION_TYPE}.cmake\")")
string(CONCAT ctest_include_multi_content
"if(NOT CTEST_CONFIGURATION_TYPE)" "\n"
" message(\"No configuration for testing specified, use '-C <cfg>'.\")" "\n"
"else()" "\n"
" include(\"${ctest_file_base}_include-\${CTEST_CONFIGURATION_TYPE}.cmake\")" "\n"
"endif()" "\n"
)
file(GENERATE OUTPUT "${ctest_include_file}" CONTENT "${ctest_include_multi_content}")
else()
file(GENERATE OUTPUT "${ctest_file_base}_include.cmake" CONTENT "${ctest_include_content}")
file(WRITE "${ctest_include_file}" "include(\"${ctest_file_base}_include.cmake\")")
Expand Down

0 comments on commit 9b930ec

Please sign in to comment.