added option for build tests to linking tests library

This commit is contained in:
Patrick A Myers 2023-01-13 10:50:03 -05:00
parent 17c836731e
commit 8cbcf23b8d

View file

@ -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)