From bdce0f642de10b03a677dabb1675d4adb4cd38dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= Date: Sun, 11 Dec 2022 22:27:38 +0000 Subject: [PATCH] Make building tests an option --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 341076683..06ccb3de5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -622,7 +622,7 @@ endif() ############################ # TEST ############################ -if(TESTS) +function(build_tests) enable_testing() set(CMAKE_CTEST_COMMAND ctest -V) @@ -783,6 +783,10 @@ if(TESTS) add_test(icb_parpack_cpp_tst mpirun -n 2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/icb_parpack_cpp) endif() endif() +endfunction(build_tests) + +if(TESTS) + build_tests() endif() ############################