diff options
author | Gennadiy Civil <gennadiycivil@users.noreply.github.com> | 2018-08-21 17:51:42 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-21 17:51:42 (GMT) |
commit | 880896c6f4814f4c7798355a652dc6167be2b75f (patch) | |
tree | 8123065767fdd8d9241804f032632573a2522bba /googlemock/CMakeLists.txt | |
parent | b88511ef640c046ec9c7553b383a2aba64c80967 (diff) | |
parent | 759ef7c4e9662321548d1c30528c78ecdba2a05d (diff) | |
download | googletest-880896c6f4814f4c7798355a652dc6167be2b75f.zip googletest-880896c6f4814f4c7798355a652dc6167be2b75f.tar.gz googletest-880896c6f4814f4c7798355a652dc6167be2b75f.tar.bz2 |
Merge pull request #1682 from dakotahawkins/improve-exported-targets
Improve CMake exported targets
Diffstat (limited to 'googlemock/CMakeLists.txt')
-rw-r--r-- | googlemock/CMakeLists.txt | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt index 07b6ad2..1db14a2 100644 --- a/googlemock/CMakeLists.txt +++ b/googlemock/CMakeLists.txt @@ -37,7 +37,7 @@ 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) + project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C) endif() cmake_minimum_required(VERSION 2.6.4) @@ -120,18 +120,45 @@ endif() # to the targets for when we are part of a parent build (ie being pulled # in via add_subdirectory() rather than being a standalone build). if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11") - target_include_directories(gmock SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") - target_include_directories(gmock_main SYSTEM INTERFACE "${gmock_SOURCE_DIR}/include") + target_include_directories(gmock SYSTEM + INTERFACE + $<BUILD_INTERFACE:${gmock_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${gmock_SOURCE_DIR}> + $<BUILD_INTERFACE:${gtest_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${gtest_SOURCE_DIR}> + $<INSTALL_INTERFACE:include>) + target_include_directories(gmock_main SYSTEM + INTERFACE + $<BUILD_INTERFACE:${gmock_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${gmock_SOURCE_DIR}> + $<BUILD_INTERFACE:${gtest_SOURCE_DIR}/include> + $<BUILD_INTERFACE:${gtest_SOURCE_DIR}> + $<INSTALL_INTERFACE:include>) endif() ######################################################################## # # Install rules if(INSTALL_GMOCK) - install(TARGETS gmock gmock_main + install(TARGETS gmock + EXPORT gmockConfigInternal RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" - ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}") + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(EXPORT gmockConfigInternal + DESTINATION "${INSTALL_CMAKE_DIR}" + NAMESPACE googletest_) + install(TARGETS gmock_main + EXPORT gmock_mainConfigInternal + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}") + install(EXPORT gmock_mainConfigInternal + DESTINATION "${INSTALL_CMAKE_DIR}" + NAMESPACE googletest_) + set(googletest_install_targets + ${googletest_install_targets} gmock gmock_main PARENT_SCOPE) + install(DIRECTORY "${gmock_SOURCE_DIR}/include/gmock" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}") |