diff --git a/CMakeLists.txt b/CMakeLists.txt index 83f9798bf..96e28a71b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,6 +284,18 @@ endif() add_subdirectory(src) add_subdirectory(doc) + +if(ENABLE_TESTS) + find_package(CppUTest) + if(CPPUTEST_FOUND) + enable_testing() + else() + message(SEND_ERROR "CppUTest not found") + endif() +else() + enable_testing() + add_test(NAME notests COMMAND true) +endif() add_subdirectory(tests) configure_file(config.h.cmake config.h @ONLY) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 8b506853a..06e9d780b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -24,14 +24,5 @@ if(ENABLE_FUZZ) endif() if(ENABLE_TESTS) - find_package(CppUTest) - if(CPPUTEST_FOUND) - enable_testing() - add_subdirectory(unit) - else() - message(SEND_ERROR "CppUTest not found") - endif() -else() - enable_testing() - add_test(NAME notests COMMAND true) + add_subdirectory(unit) endif()