aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/CMakeLists.txt
diff options
context:
space:
mode:
authorDavid Seifert <soap@gentoo.org>2017-08-14 13:45:56 +0200
committerDavid Seifert <soap@gentoo.org>2017-08-14 13:45:56 +0200
commit8604c4adac40573f806cfadae44e22f8dfaf212a (patch)
treed36e71b9f5293a7e077a233cc32a95a6282d3cb1 /googlemock/CMakeLists.txt
parent673c975a963f356b19fea90cb57b69192253da2a (diff)
downloadgoogletest-8604c4adac40573f806cfadae44e22f8dfaf212a.tar.gz
googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.tar.bz2
googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.zip
Add support for pkgconfig
Diffstat (limited to 'googlemock/CMakeLists.txt')
-rw-r--r--googlemock/CMakeLists.txt19
1 files changed, 18 insertions, 1 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index c3c8aaeb..bd759dfd 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)
@@ -110,6 +115,18 @@ if(INSTALL_GMOCK)
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()
########################################################################