| 1 |
# Note: CMake support is community-based. The maintainers do not use CMake |
| 2 |
# internally. |
| 3 |
|
| 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) |
| 17 |
|
| 18 |
project(googletest-distribution) |
| 19 |
set(GOOGLETEST_VERSION 1.13.0) |
| 20 |
|
| 21 |
if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) |
| 22 |
set(CMAKE_CXX_EXTENSIONS OFF) |
| 23 |
endif() |
| 24 |
|
| 25 |
enable_testing() |
| 26 |
|
| 27 |
include(CMakeDependentOption) |
| 28 |
include(GNUInstallDirs) |
| 29 |
|
| 30 |
#Note that googlemock target already builds googletest |
| 31 |
option(BUILD_GMOCK "Builds the googlemock subproject" ON) |
| 32 |
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) |
| 33 |
option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF) |
| 34 |
|
| 35 |
if(BUILD_GMOCK) |
| 36 |
add_subdirectory( googlemock ) |
| 37 |
else() |
| 38 |
add_subdirectory( googletest ) |
| 39 |
endif() |