diff --git a/CMakeLists.txt b/CMakeLists.txt index f586ce8..1b218fb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,9 +54,6 @@ endif() enable_testing() -# Do not want to include Google Test in the installation packages -if(BUILD_TESTING) - add_subdirectory(tests) -endif() +add_subdirectory(tests) add_subdirectory(packaging) \ No newline at end of file diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index a9db20c..e5deeca 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,6 +9,11 @@ FetchContent_Declare( ) # For Windows: Prevent overriding the parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) + +# Prevent GoogleTest from being installed by CPack +set(INSTALL_GTEST OFF CACHE BOOL "" FORCE) +set(INSTALL_GMOCK OFF CACHE BOOL "" FORCE) + FetchContent_MakeAvailable(googletest) # Collect test sources