blob: 12fd7450d01e9d4ead650e51491a78f23b28475b [file] [log] [blame]
James Kuszmaule2f15292021-05-10 22:37:32 -07001# Note: CMake support is community-based. The maintainers do not use CMake
2# internally.
3
4cmake_minimum_required(VERSION 2.8.12)
Austin Schuh889ac432018-10-29 22:57:02 -07005
6if (POLICY CMP0048)
7 cmake_policy(SET CMP0048 NEW)
8endif (POLICY CMP0048)
9
10project(googletest-distribution)
James Kuszmaule2f15292021-05-10 22:37:32 -070011set(GOOGLETEST_VERSION 1.10.0)
12
13if (CMAKE_VERSION VERSION_GREATER "3.0.2")
14 if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
15 set(CMAKE_CXX_EXTENSIONS OFF)
16 endif()
17endif()
Austin Schuh889ac432018-10-29 22:57:02 -070018
19enable_testing()
20
21include(CMakeDependentOption)
22include(GNUInstallDirs)
23
24#Note that googlemock target already builds googletest
25option(BUILD_GMOCK "Builds the googlemock subproject" ON)
26option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
27
28if(BUILD_GMOCK)
29 add_subdirectory( googlemock )
30else()
31 add_subdirectory( googletest )
32endif()