--- tests/CMakeLists.txt.orig 2021-09-09 05:45:47 UTC +++ tests/CMakeLists.txt @@ -3,6 +3,7 @@ find_package (Boost COMPONENTS system RE enable_testing () # Framework for writing tests. +if (FALSE) ExternalProject_Add ( googletest GIT_REPOSITORY "https://github.com/google/googletest.git" @@ -23,6 +24,11 @@ set (GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_M include_directories (${GTEST_INCLUDE_DIRS}) +endif() + +find_package(GTest REQUIRED) + + # Special flags fo generating code coverage. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") set (CMAKE_SHARED_LINKER_FLAGS "-fprofile-arcs -ftest-coverage") @@ -52,7 +58,7 @@ set ( ${PROJECT_SOURCE_DIR}/tests/adapters/boost_matrixtest.cpp ) add_executable (munkrestest EXCLUDE_FROM_ALL ${MunkresCppLib_SOURCES} ${MunkresCppTest_SOURCES}) -target_link_libraries (munkrestest ${GTEST_BOTH_LIBRARIES} gcov pthread) +target_link_libraries (munkrestest ${GTest} gcov pthread) add_custom_target (tests) add_dependencies (tests munkrestest) add_dependencies (munkrestest googletest)