11# Note: CMake support is community-based. The maintainers do not use CMake
22# internally.
33
4- cmake_minimum_required (VERSION 3.5 )
5-
6- if (POLICY CMP0048)
7- cmake_policy (SET CMP0048 NEW )
8- endif (POLICY CMP0048 )
9-
10- if (POLICY CMP0069)
11- cmake_policy (SET CMP0069 NEW )
12- endif (POLICY CMP0069 )
13-
14- if (POLICY CMP0077)
15- cmake_policy (SET CMP0077 NEW )
16- endif (POLICY CMP0077 )
4+ cmake_minimum_required (VERSION 3.16 )
175
186project (googletest-distribution)
19- set (GOOGLETEST_VERSION 1.16 .0)
7+ set (GOOGLETEST_VERSION 1.17 .0)
208
219# Workaround for missing debug postfix
2210# may be fixed on future versions
2311# https://github.com/google/googletest/issues/3843
2412set (CMAKE_DEBUG_POSTFIX "d" )
2513
26- set (CMAKE_CXX_STANDARD 17)
27- set (CMAKE_CXX_STANDARD_REQUIRED ON )
28- if (NOT CYGWIN )
14+ if (NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME } STREQUAL QNX)
2915 set (CMAKE_CXX_EXTENSIONS OFF )
3016endif ()
3117
@@ -34,9 +20,19 @@ enable_testing()
3420include (CMakeDependentOption )
3521include (GNUInstallDirs )
3622
37- #Note that googlemock target already builds googletest
23+ # Note that googlemock target already builds googletest.
3824option (BUILD_GMOCK "Builds the googlemock subproject" ON )
3925option (INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON )
26+ option (GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF )
27+
28+ if (GTEST_HAS_ABSL)
29+ if (NOT TARGET absl::base)
30+ find_package (absl REQUIRED )
31+ endif ()
32+ if (NOT TARGET re2::re2)
33+ find_package (re2 REQUIRED )
34+ endif ()
35+ endif ()
4036
4137if (BUILD_GMOCK)
4238 add_subdirectory ( googlemock )
0 commit comments