From dac0e528a019c8398766ed05fc2b31f659cd33b9 Mon Sep 17 00:00:00 2001 From: Marius Brehler Date: Sun, 6 Jul 2025 03:38:31 +0200 Subject: [PATCH] Set `GTEST_BOTH_LIBRARIES` appropriately (#1669) If `find_package()` succeeds to find GTest and `INSTALL_DEPENDENCIES` is set to OFF, `GTEST_BOTH_LIBRARIES` is not set and thus `rccl-UnitTests` fails with trying to link unkown symbols. --- cmake/Dependencies.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index 725c0c2e37..e30866a2dd 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -70,6 +70,8 @@ if(NOT GTest_FOUND AND BUILD_TESTS OR INSTALL_DEPENDENCIES) message(FATAL_ERROR "Cannot find gtest library installation path.") find_package(GTest REQUIRED CONFIG PATHS ${GTEST_ROOT}) endif() +elseif(GTest_FOUND AND BUILD_TESTS) + set(GTEST_BOTH_LIBRARIES "GTest::gtest;GTest::gtest_main") endif() # Find or download/install rocm-cmake project