1# Note: CMake support is community-based. The maintainers do not use CMake 2# internally. 3 4cmake_minimum_required(VERSION 3.5) 5 6if (POLICY CMP0048) 7 cmake_policy(SET CMP0048 NEW) 8endif (POLICY CMP0048) 9 10if (POLICY CMP0069) 11 cmake_policy(SET CMP0069 NEW) 12endif (POLICY CMP0069) 13 14if (POLICY CMP0077) 15 cmake_policy(SET CMP0077 NEW) 16endif (POLICY CMP0077) 17 18project(googletest-distribution) 19set(GOOGLETEST_VERSION 1.13.0) 20 21if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX) 22 set(CMAKE_CXX_EXTENSIONS OFF) 23endif() 24 25enable_testing() 26 27include(CMakeDependentOption) 28include(GNUInstallDirs) 29 30#Note that googlemock target already builds googletest 31option(BUILD_GMOCK "Builds the googlemock subproject" ON) 32option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON) 33option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF) 34 35if(BUILD_GMOCK) 36 add_subdirectory( googlemock ) 37else() 38 add_subdirectory( googletest ) 39endif() 40