CMakeLists.txt 887 Bytes
Newer Older
1
# Note: CMake support is community-based. The maintainers do not use CMake
misterg's avatar
misterg committed
2
3
# internally.

4
cmake_minimum_required(VERSION 2.8.8)
peter's avatar
peter committed
5

6
7
8
9
if (POLICY CMP0048)
  cmake_policy(SET CMP0048 NEW)
endif (POLICY CMP0048)

10
project(googletest-distribution)
Abseil Team's avatar
Abseil Team committed
11
set(GOOGLETEST_VERSION 1.10.0)
12

peter's avatar
peter committed
13
14
15
16
if (CMAKE_VERSION VERSION_LESS "3.1")
  add_definitions(-std=c++11)
else()
  set(CMAKE_CXX_STANDARD 11)
peter's avatar
peter committed
17
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
18
19
20
  if(NOT CYGWIN)
    set(CMAKE_CXX_EXTENSIONS OFF)
  endif()
peter's avatar
peter committed
21
endif()
Fábio Junqueira's avatar
Fábio Junqueira committed
22
23
24

enable_testing()

25
include(CMakeDependentOption)
26
include(GNUInstallDirs)
27

Fábio Junqueira's avatar
Fábio Junqueira committed
28
29
#Note that googlemock target already builds googletest
option(BUILD_GMOCK "Builds the googlemock subproject" ON)
Stefano Soffia's avatar
Stefano Soffia committed
30
option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
31

Fábio Junqueira's avatar
Fábio Junqueira committed
32
33
if(BUILD_GMOCK)
  add_subdirectory( googlemock )
Stefano Soffia's avatar
Stefano Soffia committed
34
else()
Fábio Junqueira's avatar
Fábio Junqueira committed
35
36
  add_subdirectory( googletest )
endif()