From d43a3bb2dfb79e0f91e5475d102d30c319b07428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Thu, 11 Apr 2024 11:08:07 +0300 Subject: [PATCH] CMake: Use CMAKE_SOURCE_DIR in GTEST_SRC_DIR This makes the use of this location work the same even if building in a separate build directory; the "if (EXISTS ${GTEST_SRC_DIR}/..." check would otherwise fail when building in a different directory. Change-Id: I56496852972b479b9a4c3cb183c14205b0d1270c Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/5444429 Reviewed-by: Frank Barchard --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bf9093ce..6dfc93cec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,7 +148,7 @@ if(UNIT_TEST) if(GTEST_LIBRARY STREQUAL "GTEST_LIBRARY-NOTFOUND") set(GTEST_SRC_DIR_DEFAULT /usr/src/gtest) if (CMAKE_CROSSCOMPILING) - set(GTEST_SRC_DIR_DEFAULT third_party/googletest/src/googletest) + set(GTEST_SRC_DIR_DEFAULT ${CMAKE_SOURCE_DIR}/third_party/googletest/src/googletest) endif() set(GTEST_SRC_DIR ${GTEST_SRC_DIR_DEFAULT} CACHE STRING "Location of gtest sources") if(EXISTS ${GTEST_SRC_DIR}/src/gtest-all.cc)