summaryrefslogtreecommitdiffstats
path: root/googlemock/CMakeLists.txt
diff options
context:
space:
mode:
authorDakota Hawkins <dakotahawkins@gmail.com>2018-08-23 05:42:34 (GMT)
committerDakota Hawkins <dakotahawkins@gmail.com>2018-08-24 20:51:55 (GMT)
commitb19292e6b64263992cd049154015a6ef359473ef (patch)
treead8e7aae5bf6fd8b2e9f868768a3ad798b46a723 /googlemock/CMakeLists.txt
parent9c96f500a39df6915f8f1ab53b60be9889f1572b (diff)
downloadgoogletest-b19292e6b64263992cd049154015a6ef359473ef.zip
googletest-b19292e6b64263992cd049154015a6ef359473ef.tar.gz
googletest-b19292e6b64263992cd049154015a6ef359473ef.tar.bz2
Use `$<INSTALL_PREFIX>` in `target_include_directories`
To make sure packages are relocatable, use `$<INSTALL_PREFIX>` in `$<INSTALL_INTERFACE:...>` `target_include_directories`. `$<INSTALL_PREFIX>` was introduced in CMake 2.8.11, which is already being checked for locally. References: - https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#id19 - https://github.com/robotology/how-to-export-cpp-library/blob/claudio/headeronly/src/LibTemplateCMake/CMakeLists.txt#L42 Signed-off-by: Dakota Hawkins <dakotahawkins@gmail.com>
Diffstat (limited to 'googlemock/CMakeLists.txt')
-rw-r--r--googlemock/CMakeLists.txt4
1 files changed, 2 insertions, 2 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index 195d254..8a8de1f 100644
--- a/googlemock/CMakeLists.txt
+++ b/googlemock/CMakeLists.txt
@@ -118,10 +118,10 @@ endif()
if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
target_include_directories(gmock SYSTEM INTERFACE
"$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
target_include_directories(gmock_main SYSTEM INTERFACE
"$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+ "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
endif()
########################################################################