From f601ee162e23eb3fe49446d13ccd6d30ca687218 Mon Sep 17 00:00:00 2001 From: Craig Scott Date: Sun, 6 Dec 2015 16:25:33 +1100 Subject: Add include dirs to targets if CMake version supports it --- googlemock/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'googlemock/CMakeLists.txt') 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. -- cgit v1.2.3