aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/CMakeLists.txt
diff options
context:
space:
mode:
authorCraig Scott <audiofanatic@gmail.com>2015-12-06 16:25:33 +1100
committerCraig Scott <audiofanatic@gmail.com>2015-12-06 16:31:21 +1100
commitf601ee162e23eb3fe49446d13ccd6d30ca687218 (patch)
tree6696969ae91a4890db379d125627545d94666f14 /googlemock/CMakeLists.txt
parent35fb11efbe1a2761ce923f49a9df1a430e5d16be (diff)
downloadgoogletest-f601ee162e23eb3fe49446d13ccd6d30ca687218.tar.gz
googletest-f601ee162e23eb3fe49446d13ccd6d30ca687218.tar.bz2
googletest-f601ee162e23eb3fe49446d13ccd6d30ca687218.zip
Add include dirs to targets if CMake version supports it
Diffstat (limited to 'googlemock/CMakeLists.txt')
-rw-r--r--googlemock/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/googlemock/CMakeLists.txt b/googlemock/CMakeLists.txt
index cd522776..b9b53f60 100644
--- a/googlemock/CMakeLists.txt
+++ b/googlemock/CMakeLists.txt
@@ -92,6 +92,14 @@ cxx_library(gmock_main
src/gmock-all.cc
src/gmock_main.cc)
+# If the CMake version supports it, attach header directory information
+# 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 INTERFACE "${gmock_SOURCE_DIR}/include")
+ target_include_directories(gmock_main INTERFACE "${gmock_SOURCE_DIR}/include")
+endif()
+
########################################################################
#
# Google Mock's own tests.