aboutsummaryrefslogtreecommitdiffstats
path: root/googletest/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'googletest/CMakeLists.txt')
-rw-r--r--googletest/CMakeLists.txt35
1 files changed, 30 insertions, 5 deletions
diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt
index 36d0a9ec..59343ed2 100644
--- a/googletest/CMakeLists.txt
+++ b/googletest/CMakeLists.txt
@@ -44,9 +44,18 @@ 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 (POLICY CMP0063) # Visibility
+ cmake_policy(SET CMP0063 NEW)
+endif (POLICY CMP0063)
+
if (COMMAND set_up_hermetic_build)
set_up_hermetic_build()
endif()
@@ -102,10 +111,26 @@ endif()
########################################################################
#
# Install rules
-install(TARGETS gtest gtest_main
- DESTINATION lib)
-install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest
- DESTINATION include)
+if(INSTALL_GTEST)
+ install(TARGETS gtest gtest_main
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ 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()
########################################################################
#