summaryrefslogtreecommitdiffstats
path: root/googlemock/CMakeLists.txt
diff options
context:
space:
mode:
authorAlyssa Wilk <alyssar@chromium.org>2017-08-28 20:10:12 (GMT)
committerAlyssa Wilk <alyssar@chromium.org>2017-08-28 20:10:12 (GMT)
commitc00373320db8cfbd1524e73e7b2793a22ecb2672 (patch)
treefe20e7200424c65ab9acb8ff38ff1b2e86204ba6 /googlemock/CMakeLists.txt
parenta2803bc37dafdaad05b335e64a83aff03096a4ba (diff)
parentb43bfcf49166599955ba3713952bc6c0e96b421b (diff)
downloadgoogletest-c00373320db8cfbd1524e73e7b2793a22ecb2672.zip
googletest-c00373320db8cfbd1524e73e7b2793a22ecb2672.tar.gz
googletest-c00373320db8cfbd1524e73e7b2793a22ecb2672.tar.bz2
Merge branch 'refs/heads/master' into flag-default
Diffstat (limited to 'googlemock/CMakeLists.txt')
-rw-r--r--googlemock/CMakeLists.txt31
1 files changed, 26 insertions, 5 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index 9fb96a4..bd759df 100644
--- a/googlemock/CMakeLists.txt
+++ b/googlemock/CMakeLists.txt
@@ -37,7 +37,12 @@ endif()
# as ${gmock_SOURCE_DIR} and to the root binary directory as
# ${gmock_BINARY_DIR}.
# Language "C" is required for find_package(Threads).
-project(gmock CXX C)
+if (CMAKE_VERSION VERSION_LESS 3.0)
+ project(gmock CXX C)
+else()
+ cmake_policy(SET CMP0048 NEW)
+ project(gmock VERSION 1.9.0 LANGUAGES CXX C)
+endif()
cmake_minimum_required(VERSION 2.6.4)
if (COMMAND set_up_hermetic_build)
@@ -103,10 +108,26 @@ endif()
########################################################################
#
# Install rules
-install(TARGETS gmock gmock_main
- DESTINATION lib)
-install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock
- DESTINATION include)
+if(INSTALL_GMOCK)
+ install(TARGETS gmock gmock_main
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+
+ # configure and install pkgconfig files
+ configure_file(
+ cmake/gmock.pc.in
+ "${CMAKE_BINARY_DIR}/gmock.pc"
+ @ONLY)
+ configure_file(
+ cmake/gmock_main.pc.in
+ "${CMAKE_BINARY_DIR}/gmock_main.pc"
+ @ONLY)
+ install(FILES "${CMAKE_BINARY_DIR}/gmock.pc" "${CMAKE_BINARY_DIR}/gmock_main.pc"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
+endif()
########################################################################
#