Path: blob/main/contrib/googletest/CMakeLists.txt
108891 views
# Note: CMake support is community-based. The maintainers do not use CMake1# internally.23cmake_minimum_required(VERSION 3.16)45project(googletest-distribution)6set(GOOGLETEST_VERSION 1.17.0)78if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)9set(CMAKE_CXX_EXTENSIONS OFF)10endif()1112enable_testing()1314include(CMakeDependentOption)15include(GNUInstallDirs)1617# Note that googlemock target already builds googletest.18option(BUILD_GMOCK "Builds the googlemock subproject" ON)19option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)20option(GTEST_HAS_ABSL "Use Abseil and RE2. Requires Abseil and RE2 to be separately added to the build." OFF)2122if(GTEST_HAS_ABSL)23if(NOT TARGET absl::base)24find_package(absl REQUIRED)25endif()26if(NOT TARGET re2::re2)27find_package(re2 REQUIRED)28endif()29endif()3031if(BUILD_GMOCK)32add_subdirectory( googlemock )33else()34add_subdirectory( googletest )35endif()363738