diff --git a/CMakeLists.txt b/CMakeLists.txt index f257972df..17efb8e27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ list(GET VERSION_LIST 1 PROJECT_VERSION_MINOR) list(GET VERSION_LIST 2 PROJECT_VERSION_PATCH) unset(VERSION_LIST) -enable_testing() +include(CTest) # Follow GNU conventions for installation directories include(GNUInstallDirs) diff --git a/README.md b/README.md index 733a23a27..3ab9276e8 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ Important options are The minimum required rank to compile this project is 4. Compiling with maximum rank 15 can be resource intensive and requires at least 16 GB of memory to allow parallel compilation or 4 GB memory for sequential compilation. - `-DBUILD_SHARED_LIBS` set to `on` in case you want link your application dynamically against the standard library (default: `off`). +- `-DBUILD_TESTING` set to `off` in case you want to disable the stdlib tests (default: `on`). For example, to configure a build using the Ninja backend while specifying compiler flags `FFLAGS`, generating procedures up to rank 7, and installing to your home directory, use diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a7ebd48f0..d48975a4e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -114,7 +114,10 @@ else() target_sources(${PROJECT_NAME} PRIVATE f08estop.f90) endif() -add_subdirectory(tests) +if(BUILD_TESTING) + enable_testing() + add_subdirectory(tests) +endif() install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-targets