CMakeLists.txt 1.0 KB

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