aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2020-02-26 16:15:47 -0500
committerGravatar Benjamin Barenblat <bbaren@google.com>2020-02-26 16:17:21 -0500
commit454202fc0b6d6baa15aec328053c28e0d46d0551 (patch)
treef0972abd7b320ac2e44f6a6456621583ad3d7108
parent0033c9ea91a52ade7c6b725aa2ef3cbe15463421 (diff)
Use absl_gtest_{src,build}_dir variables more aggressively
Replace extra expansions of `${CMAKE_BINARY_DIR}/googletest-src` and `${CMAKE_BINARY_DIR}/googletest-build` with `${absl_gtest_src_dir}` and `${absl_gtest_build_dir}`, respectively.
-rw-r--r--CMake/Googletest/CMakeLists.txt.in4
-rw-r--r--CMake/Googletest/DownloadGTest.cmake4
-rw-r--r--CMakeLists.txt2
3 files changed, 4 insertions, 6 deletions
diff --git a/CMake/Googletest/CMakeLists.txt.in b/CMake/Googletest/CMakeLists.txt.in
index d60a33e..72a7131 100644
--- a/CMake/Googletest/CMakeLists.txt.in
+++ b/CMake/Googletest/CMakeLists.txt.in
@@ -6,8 +6,8 @@ include(ExternalProject)
ExternalProject_Add(googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG master
- SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src"
- BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build"
+ SOURCE_DIR "${absl_gtest_src_dir}"
+ BINARY_DIR "${absl_gtest_build_dir}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
diff --git a/CMake/Googletest/DownloadGTest.cmake b/CMake/Googletest/DownloadGTest.cmake
index 8a00b45..d616fe2 100644
--- a/CMake/Googletest/DownloadGTest.cmake
+++ b/CMake/Googletest/DownloadGTest.cmake
@@ -37,6 +37,4 @@ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
# Add googletest directly to our build. This defines the gtest and gtest_main
# targets.
-add_subdirectory(${CMAKE_BINARY_DIR}/googletest-src
- ${CMAKE_BINARY_DIR}/googletest-build
- EXCLUDE_FROM_ALL)
+add_subdirectory(${absl_gtest_src_dir} ${absl_gtest_build_dir} EXCLUDE_FROM_ALL)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fdfb2cf..26cd2d0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -97,9 +97,9 @@ endif()
if(BUILD_TESTING)
if(${ABSL_USE_GOOGLETEST_HEAD})
- include(CMake/Googletest/DownloadGTest.cmake)
set(absl_gtest_src_dir ${CMAKE_BINARY_DIR}/googletest-src)
set(absl_gtest_build_dir ${CMAKE_BINARY_DIR}/googletest-build)
+ include(CMake/Googletest/DownloadGTest.cmake)
endif()
check_target(gtest)