Merge branch release-2021 into master
[alexxy/gromacs.git] / api / nblib / CMakeLists.txt
index 0259b3b43f01fa2fe30a20830af7de207847b9b1..be3cfb6e18fdadc6ab76a9dc8013a3fc305485d7 100644 (file)
@@ -51,14 +51,16 @@ add_custom_target(nblib-tests
         )
 # Ensure that "make tests" builds all nblib tests so the top-level
 # "make check" will work.
-add_dependencies(tests nblib-tests)
+if (BUILD_TESTING)
+       add_dependencies(tests nblib-tests)
 
-# this allows all nblib tests to be run with "make check-nblib"
-add_custom_target(check-nblib
-        COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -R NbLib
-        COMMENT "Running nblib tests"
-        USES_TERMINAL VERBATIM)
-add_dependencies(check-nblib nblib-tests)
+       # this allows all nblib tests to be run with "make check-nblib"
+       add_custom_target(check-nblib
+               COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -R NbLib
+               COMMENT "Running nblib tests"
+               USES_TERMINAL VERBATIM)
+       add_dependencies(check-nblib nblib-tests)
+endif()
 
 set(NBLIB_MAJOR 0)
 set(NBLIB_MINOR 1)