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 /googletest/CMakeLists.txt | |
parent | 673c975a963f356b19fea90cb57b69192253da2a (diff) | |
download | googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.zip googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.tar.gz googletest-8604c4adac40573f806cfadae44e22f8dfaf212a.tar.bz2 |
Add support for pkgconfig
Diffstat (limited to 'googletest/CMakeLists.txt')
-rw-r--r-- | googletest/CMakeLists.txt | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt index a570e27..b541460 100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@ -44,7 +44,12 @@ endif() # as ${gtest_SOURCE_DIR} and to the root binary directory as # ${gtest_BINARY_DIR}. # Language "C" is required for find_package(Threads). -project(gtest CXX C) +if (CMAKE_VERSION VERSION_LESS 3.0) + project(gtest CXX C) +else() + cmake_policy(SET CMP0048 NEW) + project(gtest VERSION 1.9.0 LANGUAGES CXX C) +endif() cmake_minimum_required(VERSION 2.6.4) if (COMMAND set_up_hermetic_build) @@ -109,6 +114,18 @@ if(INSTALL_GTEST) LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}) install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + + # configure and install pkgconfig files + configure_file( + cmake/gtest.pc.in + "${CMAKE_BINARY_DIR}/gtest.pc" + @ONLY) + configure_file( + cmake/gtest_main.pc.in + "${CMAKE_BINARY_DIR}/gtest_main.pc" + @ONLY) + install(FILES "${CMAKE_BINARY_DIR}/gtest.pc" "${CMAKE_BINARY_DIR}/gtest_main.pc" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") endif() ######################################################################## |