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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user