diff options
author | Craig Scott <audiofanatic@gmail.com> | 2015-12-06 05:25:33 (GMT) |
---|---|---|
committer | Craig Scott <audiofanatic@gmail.com> | 2015-12-06 05:31:21 (GMT) |
commit | f601ee162e23eb3fe49446d13ccd6d30ca687218 (patch) | |
tree | 6696969ae91a4890db379d125627545d94666f14 /googletest/CMakeLists.txt | |
parent | 35fb11efbe1a2761ce923f49a9df1a430e5d16be (diff) | |
download | googletest-f601ee162e23eb3fe49446d13ccd6d30ca687218.zip googletest-f601ee162e23eb3fe49446d13ccd6d30ca687218.tar.gz googletest-f601ee162e23eb3fe49446d13ccd6d30ca687218.tar.bz2 |
Add include dirs to targets if CMake version supports itrefs/pull/657/head
Diffstat (limited to 'googletest/CMakeLists.txt')
-rw-r--r-- | googletest/CMakeLists.txt | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/googletest/CMakeLists.txt b/googletest/CMakeLists.txt index 9ef6a93..621d0f0 100644 --- a/googletest/CMakeLists.txt +++ b/googletest/CMakeLists.txt @@ -91,6 +91,14 @@ cxx_library(gtest "${cxx_strict}" src/gtest-all.cc) cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc) target_link_libraries(gtest_main gtest) +# 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(gtest INTERFACE "${gtest_SOURCE_DIR}/include") + target_include_directories(gtest_main INTERFACE "${gtest_SOURCE_DIR}/include") +endif() + ######################################################################## # # Install rules |