From 8cbcf23b8d0d8343dafef95609a55b3fe67325fb Mon Sep 17 00:00:00 2001 From: Patrick A Myers Date: Fri, 13 Jan 2023 10:50:03 -0500 Subject: [PATCH] added option for build tests to linking tests library --- CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 51db85207..11ae71ac6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -516,9 +516,11 @@ if (OPENMC_USE_MPI) target_link_libraries(libopenmc MPI::MPI_CXX) endif() -# Add cpp tests directory -include(CTest) -add_subdirectory(tests/cpp_unit_tests) +if (OPENMC_BUILD_TESTS) + # Add cpp tests directory + include(CTest) + add_subdirectory(tests/cpp_unit_tests) +endif() if (OPENMC_USE_MCPL) target_compile_definitions(libopenmc PUBLIC OPENMC_MCPL)