aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCopybara-Service <copybara-worker@google.com>2024-03-04 13:15:25 -0800
committerCopybara-Service <copybara-worker@google.com>2024-03-04 13:15:25 -0800
commit926f681a902cbfb84a863dafb77175f4a25be6ea (patch)
tree333c61a7f3fdf138106220da088ecda04dee773e
parente4fdb87e76b9fc4b01c54ad81aea19d6e994b994 (diff)
parentf5448b3d712b0f291999420c6f89a207afe90a06 (diff)
downloadgoogletest-926f681a902cbfb84a863dafb77175f4a25be6ea.zip
googletest-926f681a902cbfb84a863dafb77175f4a25be6ea.tar.gz
googletest-926f681a902cbfb84a863dafb77175f4a25be6ea.tar.bz2
Merge pull request #4466 from danfabo:fix-fetch-content-uses-gtest
PiperOrigin-RevId: 612560830 Change-Id: Ib639603d34258909cf0e0d6fceb297dd8c983d54
-rw-r--r--googlemock/CMakeLists.txt7
1 files changed, 4 insertions, 3 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index 428bd9f..99b2411 100644
--- a/googlemock/CMakeLists.txt
+++ b/googlemock/CMakeLists.txt
@@ -65,12 +65,13 @@ endif()
config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake
# Adds Google Mock's and Google Test's header directories to the search path.
+# Get Google Test's include dirs from the target, gtest_SOURCE_DIR is broken
+# when using fetch-content with the name "GTest".
+get_target_property(gtest_include_dirs gtest INCLUDE_DIRECTORIES)
set(gmock_build_include_dirs
"${gmock_SOURCE_DIR}/include"
"${gmock_SOURCE_DIR}"
- "${gtest_SOURCE_DIR}/include"
- # This directory is needed to build directly from Google Test sources.
- "${gtest_SOURCE_DIR}")
+ "${gtest_include_dirs}")
include_directories(${gmock_build_include_dirs})
########################################################################