CMakeLists.txt 767 Bytes
Newer Older
1
cmake_minimum_required(VERSION 2.8.8)
peter's avatar
peter committed
2

3
4
5
project(googletest-distribution)
set(GOOGLETEST_VERSION 1.9.0)

peter's avatar
peter committed
6
7
8
9
if (CMAKE_VERSION VERSION_LESS "3.1")
  add_definitions(-std=c++11)
else()
  set(CMAKE_CXX_STANDARD 11)
peter's avatar
peter committed
10
11
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
  set(CMAKE_CXX_EXTENSIONS OFF)
peter's avatar
peter committed
12
endif()
Fábio Junqueira's avatar
Fábio Junqueira committed
13

Joel Laity's avatar
Joel Laity committed
14
if (POLICY CMP0048)
15
  cmake_policy(SET CMP0048 NEW)
Joel Laity's avatar
Joel Laity committed
16
endif (POLICY CMP0048)
17

Fábio Junqueira's avatar
Fábio Junqueira committed
18
19
enable_testing()

20
include(CMakeDependentOption)
21
include(GNUInstallDirs)
22

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

Fábio Junqueira's avatar
Fábio Junqueira committed
27
28
if(BUILD_GMOCK)
  add_subdirectory( googlemock )
Stefano Soffia's avatar
Stefano Soffia committed
29
else()
Fábio Junqueira's avatar
Fábio Junqueira committed
30
31
  add_subdirectory( googletest )
endif()