From 17c836731e793dcf250cb45f539bb428eb7cda8a Mon Sep 17 00:00:00 2001 From: Patrick A Myers Date: Fri, 13 Jan 2023 10:47:56 -0500 Subject: [PATCH] added cmake option for building tests --- CMakeLists.txt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 655ff4a6f..51db85207 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ endif() #=============================================================================== option(OPENMC_USE_OPENMP "Enable shared-memory parallelism with OpenMP" ON) +option(OPENMC_BUILD_TESTS "Build tests" ON) option(OPENMC_ENABLE_PROFILE "Compile with profiling flags" OFF) option(OPENMC_ENABLE_COVERAGE "Compile with coverage analysis flags" OFF) option(OPENMC_USE_DAGMC "Enable support for DAGMC (CAD) geometry" OFF) @@ -288,9 +289,12 @@ endif() #=============================================================================== # Catch2 library #=============================================================================== -find_package_write_status(Catch2) -if (NOT Catch2) - add_subdirectory(vendor/Catch2) + +if(OPENMC_BUILD_TESTS) + find_package_write_status(Catch2) + if (NOT Catch2) + add_subdirectory(vendor/Catch2) + endif() endif() #===============================================================================