CMakeLists.txt 889 B

123456789101112131415161718192021222324252627282930313233343536
  1. # Note: CMake support is community-based. The maintainers do not use CMake
  2. # internally.
  3. cmake_minimum_required(VERSION 2.8.8)
  4. if (POLICY CMP0048)
  5. cmake_policy(SET CMP0048 NEW)
  6. endif (POLICY CMP0048)
  7. project(googletest-distribution)
  8. set(GOOGLETEST_VERSION 1.10.0)
  9. if (CMAKE_VERSION VERSION_LESS "3.1")
  10. add_definitions(-std=c++11)
  11. else()
  12. set(CMAKE_CXX_STANDARD 11)
  13. set(CMAKE_CXX_STANDARD_REQUIRED ON)
  14. if(NOT CYGWIN)
  15. set(CMAKE_CXX_EXTENSIONS OFF)
  16. endif()
  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" OFF)
  23. option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" OFF)
  24. if(BUILD_GMOCK)
  25. add_subdirectory( googlemock )
  26. else()
  27. add_subdirectory( googletest )
  28. endif()