diff --git a/CMakeLists.txt b/CMakeLists.txt index 21df0f324439286be105ebe9814e9d6d88b822da..e7614228432060ffb95a144d77e762cb480f41f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,7 @@ project( OGS-6 ) include(scripts/cmake/CMakeSetup.cmake) include(ParseCMakeArgs) +include(CTest) ########################### ### Preliminary Options ### @@ -37,7 +38,6 @@ set(CMAKE_LIBRARY_SEARCH_PATH "" CACHE PATH set(OGS_CPU_ARCHITECTURE "native" CACHE STRING "Processor architecture, \ defaults to native (*nix) / blend (MSVC).") option(OGS_ENABLE_AVX2 "Enable the use of AVX2 instructions" OFF) -option(OGS_BUILD_TESTS "Should the test executables be built?" ON) option(OGS_USE_PCH "Should pre-compiled headers be used?" ON) if(DEFINED CMAKE_CXX_CLANG_TIDY) set(OGS_USE_PCH OFF CACHE INTERNAL "") @@ -329,11 +329,11 @@ add_subdirectory( MathLib ) add_subdirectory( MeshLib ) add_subdirectory( MeshGeoToolsLib ) add_subdirectory( NumLib ) -if(OGS_BUILD_CLI OR OGS_BUILD_UTILS OR OGS_BUILD_TESTS) +if(OGS_BUILD_CLI OR OGS_BUILD_UTILS OR BUILD_TESTING) add_subdirectory( MaterialLib ) add_subdirectory( ProcessLib ) endif() -if( OGS_BUILD_TESTS AND NOT IS_SUBPROJECT ) +if( BUILD_TESTING AND NOT IS_SUBPROJECT ) add_subdirectory( Tests ) if(OGS_USE_MPI) @@ -341,7 +341,7 @@ if( OGS_BUILD_TESTS AND NOT IS_SUBPROJECT ) else() add_subdirectory( SimpleTests/MeshTests ) endif() -endif() # OGS_BUILD_TESTS +endif() # The configuration must be called from the source dir and not BaseLib/. configure_file("${CMAKE_CURRENT_SOURCE_DIR}/BaseLib/BuildInfo.cpp.in" diff --git a/scripts/cmake/test/AddTest.cmake b/scripts/cmake/test/AddTest.cmake index 01d07af91ea20d59b78174d7a76d66a119f402fb..ebf7f4db6a7d8fa297c8c2fbae5dad47ddc821f3 100644 --- a/scripts/cmake/test/AddTest.cmake +++ b/scripts/cmake/test/AddTest.cmake @@ -39,7 +39,7 @@ # the benchmark output directory. function (AddTest) - if(NOT OGS_BUILD_TESTS) + if(NOT BUILD_TESTING) return() endif() # parse arguments diff --git a/scripts/cmake/test/OgsTest.cmake b/scripts/cmake/test/OgsTest.cmake index cdf7c9a235953ca6fa5ff9fca4fb008b59717c66..01b53936580a67b46035b4989f2be4482cba477a 100644 --- a/scripts/cmake/test/OgsTest.cmake +++ b/scripts/cmake/test/OgsTest.cmake @@ -1,5 +1,5 @@ function (OgsTest) - if(NOT OGS_BUILD_TESTS) + if(NOT BUILD_TESTING) return() endif() set(options LARGE) diff --git a/web/content/docs/devguide/advanced/configuration-options.pandoc b/web/content/docs/devguide/advanced/configuration-options.pandoc index 98db954253f82fdc7a756b2e162f3d06a0f6a3af..8afb2d4a2f5eb59aeb60fec3c7a424d12e4babc2 100644 --- a/web/content/docs/devguide/advanced/configuration-options.pandoc +++ b/web/content/docs/devguide/advanced/configuration-options.pandoc @@ -19,7 +19,7 @@ CMake switches to enable / disable parts of OGS. - `OGS_BUILD_CLI` - Builds the simulator. *Defaults* to *ON*. - `OGS_BUILD_GUI` - Builds the Data Explorer. *Defaults* to *OFF*. -- `OGS_BUILD_TESTS` - Builds the test executables. *Defaults* to *ON*. +- `BUILD_TESTING` - Builds the test executables. *Defaults* to *ON*. - `OGS_BUILD_UTILS` - Builds several utilities. - `OGS_NO_EXTERNAL_LIBS` - Disables all external optional dependencies. - `OGS_BUILD_PROCESS_X` - For enabling/disabling compilation of process `X`.