xref: /freebsd/contrib/googletest/CMakeLists.txt (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1# Note: CMake support is community-based. The maintainers do not use CMake
2# internally.
3
4cmake_minimum_required(VERSION 3.13)
5
6project(googletest-distribution)
7set(GOOGLETEST_VERSION 1.14.0)
8
9if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
10  set(CMAKE_CXX_EXTENSIONS OFF)
11endif()
12
13enable_testing()
14
15include(CMakeDependentOption)
16include(GNUInstallDirs)
17
18#Note that googlemock target already builds googletest
19option(BUILD_GMOCK "Builds the googlemock subproject" ON)
20option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
21option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF)
22
23if(BUILD_GMOCK)
24  add_subdirectory( googlemock )
25else()
26  add_subdirectory( googletest )
27endif()
28