2016-01-01 03:01:15 +03:00
cmake_minimum_required ( VERSION 2.6.4 )
2015-11-11 23:29:41 +03:00
2017-08-03 06:50:45 +03:00
if ( POLICY CMP0048 )
2017-08-03 04:03:13 +03:00
cmake_policy ( SET CMP0048 NEW )
2017-08-03 06:50:45 +03:00
endif ( POLICY CMP0048 )
2017-08-03 04:03:13 +03:00
2015-11-11 23:29:41 +03:00
project ( googletest-distribution )
enable_testing ( )
2017-08-09 22:29:36 +03:00
include ( CMakeDependentOption )
if ( CMAKE_VERSION VERSION_LESS 2.8.5 )
set ( CMAKE_INSTALL_BINDIR "bin" CACHE STRING "User executables (bin)" )
set ( CMAKE_INSTALL_LIBDIR "lib${LIB_SUFFIX}" CACHE STRING "Object code libraries (lib)" )
set ( CMAKE_INSTALL_INCLUDEDIR "include" CACHE STRING "C header files (include)" )
mark_as_advanced ( CMAKE_INSTALL_BINDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_INCLUDEDIR )
else ( )
include ( GNUInstallDirs )
endif ( )
2015-11-11 23:29:41 +03:00
option ( BUILD_GTEST "Builds the googletest subproject" OFF )
#Note that googlemock target already builds googletest
option ( BUILD_GMOCK "Builds the googlemock subproject" ON )
2017-08-16 17:49:06 +03:00
cmake_dependent_option ( INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON "BUILD_GTEST OR BUILD_GMOCK" OFF )
2017-08-09 22:29:36 +03:00
cmake_dependent_option ( INSTALL_GMOCK "Enable installation of googlemock. (Projects embedding googlemock may want to turn this OFF.)" ON "BUILD_GMOCK" OFF )
2015-11-11 23:29:41 +03:00
if ( BUILD_GMOCK )
add_subdirectory ( googlemock )
elseif ( BUILD_GTEST )
add_subdirectory ( googletest )
endif ( )