| 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 |
project(googletest-distribution) |
| 11 |
set(GOOGLETEST_VERSION 1.11.0) |
| 12 |
|
| 13 |
if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) |
| 14 |
set(CMAKE_CXX_EXTENSIONS OFF) |
| 15 |
endif() |
| 16 |
|
| 17 |
enable_testing() |
| 18 |
|
| 19 |
include(CMakeDependentOption) |
| 20 |
include(GNUInstallDirs) |
| 21 |
|
| 22 |
#Note that googlemock target already builds googletest |
| 23 |
option(BUILD_GMOCK "Builds the googlemock subproject" ON) |
| 24 |
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) |
| 25 |
|
| 26 |
if(BUILD_GMOCK) |
| 27 |
add_subdirectory( googlemock ) |
| 28 |
else() |
| 29 |
add_subdirectory( googletest ) |
| 30 |
endif() |