diff --git a/CMakeLists.txt b/CMakeLists.txt index e08c745..67273fa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,8 @@ endif() include(GNUInstallDirs) add_subdirectory(lib) -if(NOT BUILD_EXPORTED_TARGETS_ONLY AND BUILD_TESTING) +include(CTest) # note: this adds a BUILD_TESTING which defaults to ON +if(BUILD_TESTING) enable_testing() add_subdirectory(test) endif() diff --git a/README.rst b/README.rst index 2c1d012..c6119e1 100644 --- a/README.rst +++ b/README.rst @@ -39,7 +39,7 @@ You can influence the configuration via CMake-variables, which are listed in `config.cmake `_. You can either modify the values directly there or pass them as command line options at the configuration phase, e.g.:: - FC=ifort cmake -B _build -DBUILD_LIBRARY_ONLY=True + FC=ifort cmake -B _build -DBUILD_TESTING=NO . Testing @@ -49,7 +49,7 @@ A few tests / usage examples can be found in the `test/` subdirectory, a sub-set of which can be checked with ctest. The compiled test programs will be in the `test/` subfolder of your build directory. -To enable building, include the cmake option -DBUILD_TESTING=ON +To disable building tests, include the cmake option -DBUILD_TESTING=OFF Using the library