• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Note: CMake support is community-based. The maintainers do not use CMake
2# internally.
3
4cmake_minimum_required(VERSION 2.8.8)
5
6if (POLICY CMP0048)
7  cmake_policy(SET CMP0048 NEW)
8endif (POLICY CMP0048)
9
10project(googletest-distribution)
11set(GOOGLETEST_VERSION 1.10.0)
12
13if (CMAKE_VERSION VERSION_LESS "3.1")
14  add_definitions(-std=c++11)
15else()
16  set(CMAKE_CXX_STANDARD 11)
17  set(CMAKE_CXX_STANDARD_REQUIRED ON)
18  if(NOT CYGWIN AND NOT MSYS)
19    set(CMAKE_CXX_EXTENSIONS OFF)
20  endif()
21endif()
22
23enable_testing()
24
25include(CMakeDependentOption)
26include(GNUInstallDirs)
27
28#Note that googlemock target already builds googletest
29option(BUILD_GMOCK "Builds the googlemock subproject" ON)
30option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
31
32if(BUILD_GMOCK)
33  add_subdirectory( googlemock )
34else()
35  add_subdirectory( googletest )
36endif()
37