Imported Upstream version 1.12.1
[platform/upstream/gtest.git] / CMakeLists.txt
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 CMP0077)
11   cmake_policy(SET CMP0077 NEW)
12 endif (POLICY CMP0077)
13
14 project(googletest-distribution)
15 set(GOOGLETEST_VERSION 1.12.1)
16
17 if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
18   set(CMAKE_CXX_EXTENSIONS OFF)
19 endif()
20
21 enable_testing()
22
23 include(CMakeDependentOption)
24 include(GNUInstallDirs)
25
26 #Note that googlemock target already builds googletest
27 option(BUILD_GMOCK "Builds the googlemock subproject" ON)
28 option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
29
30 if(BUILD_GMOCK)
31   add_subdirectory( googlemock )
32 else()
33   add_subdirectory( googletest )
34 endif()