diff options
author | David Seifert <soap@gentoo.org> | 2017-08-14 11:45:56 (GMT) |
---|---|---|
committer | David Seifert <soap@gentoo.org> | 2017-08-14 11:45:56 (GMT) |
commit | 8604c4adac40573f806cfadae44e22f8dfaf212a (patch) | |
tree | d36e71b9f5293a7e077a233cc32a95a6282d3cb1 /googlemock | |
parent | 673c975a963f356b19fea90cb57b69192253da2a (diff) | |
download | googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.zip googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.tar.gz googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.tar.bz2 |
Add support for pkgconfig
Diffstat (limited to 'googlemock')
-rw-r--r-- | googlemock/CMakeLists.txt | 19 | ||||
-rw-r--r-- | googlemock/cmake/gmock.pc.in | 9 | ||||
-rw-r--r-- | googlemock/cmake/gmock_main.pc.in | 9 |
3 files changed, 36 insertions, 1 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt index c3c8aae..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) @@ -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() ######################################################################## diff --git a/googlemock/cmake/gmock.pc.in b/googlemock/cmake/gmock.pc.in new file mode 100644 index 0000000..c441642 --- /dev/null +++ b/googlemock/cmake/gmock.pc.in @@ -0,0 +1,9 @@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: gmock +Description: GoogleMock (without main() function) +Version: @PROJECT_VERSION@ +URL: https://github.com/google/googletest +Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@ diff --git a/googlemock/cmake/gmock_main.pc.in b/googlemock/cmake/gmock_main.pc.in new file mode 100644 index 0000000..c377dba --- /dev/null +++ b/googlemock/cmake/gmock_main.pc.in @@ -0,0 +1,9 @@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: gmock_main +Description: GoogleMock (with main() function) +Version: @PROJECT_VERSION@ +URL: https://github.com/google/googletest +Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@ +Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@ @CMAKE_THREAD_LIBS_INIT@ |