From 61d66c8e1897be4111ca5e580a31a8fa199744a0 Mon Sep 17 00:00:00 2001 From: Stanley Tsang Date: Mon, 22 Feb 2021 15:22:01 -0700 Subject: [PATCH] Do not search for GTest if we're force installing it into build directory (#318) --- cmake/Dependencies.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake index e2fde5c66b..2eff262a74 100644 --- a/cmake/Dependencies.cmake +++ b/cmake/Dependencies.cmake @@ -32,7 +32,9 @@ # For downloading, building, and installing required dependencies include(cmake/DownloadProject.cmake) -find_package(GTest 1.10) +if(NOT INSTALL_DEPENDENCIES) + find_package(GTest 1.10) +endif() if(NOT GTest_FOUND AND BUILD_TESTS OR INSTALL_DEPENDENCIES) if(CMAKE_CXX_COMPILER MATCHES ".*/hipcc$") @@ -45,6 +47,7 @@ if(NOT GTest_FOUND AND BUILD_TESTS OR INSTALL_DEPENDENCIES) message(STATUS "GTest not found. Downloading and building GTest.") # Download, build and install googletest library set(GTEST_ROOT ${CMAKE_CURRENT_BINARY_DIR}/gtest CACHE PATH "") + download_project(PROJ googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG release-1.10.0