File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,12 +65,13 @@ endif()
6565config_compiler_and_linker () # from ${gtest_dir}/cmake/internal_utils.cmake
6666
6767# Adds Google Mock's and Google Test's header directories to the search path.
68+ # Get Google Test's include dirs from the target, gtest_SOURCE_DIR is broken
69+ # when using fetch-content with the name "GTest".
70+ get_target_property (gtest_include_dirs gtest INCLUDE_DIRECTORIES)
6871set (gmock_build_include_dirs
6972 "${gmock_SOURCE_DIR } /include"
7073 "${gmock_SOURCE_DIR } "
71- "${gtest_SOURCE_DIR } /include"
72- # This directory is needed to build directly from Google Test sources.
73- "${gtest_SOURCE_DIR } " )
74+ "${gtest_include_dirs} " )
7475include_directories (${gmock_build_include_dirs} )
7576
7677########################################################################
You can’t perform that action at this time.
0 commit comments