From 8e3ef4b74b47c036ed848c2291a39e1cc531d1c3 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Mon, 12 Aug 2024 00:20:35 +0200 Subject: [PATCH] Fix link to GTest if GTest is found via find_package --- test/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4dd6dbe3..2af25ea2 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -34,8 +34,7 @@ endif() # small helper function function(manif_add_gtest target) add_executable(${target} ${ARGN}) - add_dependencies(${target} gtest) - target_link_libraries(${target} ${PROJECT_NAME} gtest) + target_link_libraries(${target} ${PROJECT_NAME} GTest::gtest) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") # GCC is not strict enough by default, so enable most of the warnings.