diff --git a/CMakeLists.txt b/CMakeLists.txt index c8607e16..4ed7c53a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,9 @@ if(ENABLE_DOXYGEN) include(UseDoxygen) endif() +# Option to enable building of tests +option(BUILD_TESTS "Build tests" ON) + # Option to enable CDash testing option(CDASH_SUPPORT "Turn on testing targets that upload results to CDash" OFF) diff --git a/Core/MOOSDB/CMakeLists.txt b/Core/MOOSDB/CMakeLists.txt index 7b1a9034..229ac618 100644 --- a/Core/MOOSDB/CMakeLists.txt +++ b/Core/MOOSDB/CMakeLists.txt @@ -27,5 +27,6 @@ install(TARGETS ${EXECNAME} ARCHIVE DESTINATION lib ) -add_subdirectory(testing) - +if(BUILD_TESTS) + add_subdirectory(testing) +endif() diff --git a/Core/libMOOS/CMakeLists.txt b/Core/libMOOS/CMakeLists.txt index c55d65e3..be634100 100644 --- a/Core/libMOOS/CMakeLists.txt +++ b/Core/libMOOS/CMakeLists.txt @@ -207,5 +207,7 @@ install(TARGETS MOOS ARCHIVE DESTINATION lib ) -add_subdirectory(testing) +if(BUILD_TESTS) + add_subdirectory(testing) +endif()