Permalink
Browse files

[CMake] Replace OGS_BUILD_TESTS with BUILD_TESTING.

BUILD_TESTING is a CMake convention used widely.
  • Loading branch information...
bilke committed Feb 11, 2019
1 parent cfa47ea commit ac7308fbd5b7c927a5510425a0712878dfe2d6b3
@@ -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,19 +329,19 @@ 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)
add_subdirectory( SimpleTests/MeshTests/MPI )
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"
@@ -39,7 +39,7 @@
# the benchmark output directory.

function (AddTest)
if(NOT OGS_BUILD_TESTS)
if(NOT BUILD_TESTING)
return()
endif()
# parse arguments
@@ -1,5 +1,5 @@
function (OgsTest)
if(NOT OGS_BUILD_TESTS)
if(NOT BUILD_TESTING)
return()
endif()
set(options LARGE)
@@ -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`.

0 comments on commit ac7308f

Please sign in to comment.