diff options
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 a570e27a..b5414608 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() ######################################################################## |