Skip to content

Commit

Permalink
CMake: chain CMAKE_GENERATOR through to test subprojects
Browse files Browse the repository at this point in the history
  • Loading branch information
tamiko committed Jan 27, 2024
1 parent 07e9eb5 commit 737a20a
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,11 @@ foreach(_category ${_categories})

file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${_category})

set(_redirect ">" "/dev/null")
if(DEAL_II_MSVC)
set(_command ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_options} ${_category_dir})
else()
# Do not pass the generator with -G so that we use make instead of ninja
# for the test projects. This is because calling ninja several times in
# parallel for the same project will break the configuration.

set(_command ${CMAKE_COMMAND} ${_options} ${_category_dir} > "${_summary_files_prefix}_${_category}")
set (_redirect "")
endif()
set(_command ${CMAKE_COMMAND} -G${CMAKE_GENERATOR} ${_options} ${_category_dir} ${_redirect})

add_custom_target(setup_tests_${_category}
COMMAND ${_command}
Expand Down

0 comments on commit 737a20a

Please sign in to comment.