blob: 12fd7450d01e9d4ead650e51491a78f23b28475b [file] [log] [blame]
Enji Cooper699943f2019-05-19 23:29:18 -07001# Note: CMake support is community-based. The maintainers do not use CMake
misterg63be3dc2019-04-29 17:18:42 -04002# internally.
3
Chuck Atkins32f4f522020-10-30 11:31:54 -04004cmake_minimum_required(VERSION 2.8.12)
peter96824f12018-10-24 12:03:07 +08005
Matthijs Brobbel97d8c472019-05-28 11:06:26 +02006if (POLICY CMP0048)
7 cmake_policy(SET CMP0048 NEW)
8endif (POLICY CMP0048)
9
Matthias Grob67265e02019-02-04 18:59:51 +000010project(googletest-distribution)
Abseil Team703bd9c2019-10-03 10:39:13 -040011set(GOOGLETEST_VERSION 1.10.0)
Matthias Grob67265e02019-02-04 18:59:51 +000012
Abseil Team227faf42020-03-13 16:36:27 -040013if (CMAKE_VERSION VERSION_GREATER "3.0.2")
Mark Jan van Kampen44517f92020-01-22 22:29:28 +010014 if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
Matthias Grobf8925342019-02-04 19:01:11 +000015 set(CMAKE_CXX_EXTENSIONS OFF)
16 endif()
peter96824f12018-10-24 12:03:07 +080017endif()
Fábio Junqueira4a0b77f2015-11-11 18:29:41 -020018
Fábio Junqueira4a0b77f2015-11-11 18:29:41 -020019enable_testing()
20
Matthew Woehlke0e8e0e02017-08-09 15:29:36 -040021include(CMakeDependentOption)
Dakota Hawkins759ef7c2018-07-24 11:06:55 -040022include(GNUInstallDirs)
Matthew Woehlke0e8e0e02017-08-09 15:29:36 -040023
Fábio Junqueira4a0b77f2015-11-11 18:29:41 -020024#Note that googlemock target already builds googletest
25option(BUILD_GMOCK "Builds the googlemock subproject" ON)
Stefano Soffiaaff03792017-12-01 12:48:46 +010026option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
Matthew Woehlke9469fb62017-08-16 10:49:06 -040027
Fábio Junqueira4a0b77f2015-11-11 18:29:41 -020028if(BUILD_GMOCK)
29 add_subdirectory( googlemock )
Stefano Soffiaaff03792017-12-01 12:48:46 +010030else()
Fábio Junqueira4a0b77f2015-11-11 18:29:41 -020031 add_subdirectory( googletest )
32endif()