From 97e9ed11bce828235a25e2cb72910fa6928ffdf5 Mon Sep 17 00:00:00 2001 From: vitaut Date: Sat, 9 Jan 2016 08:07:31 -0800 Subject: [PATCH] Set interface include dir for gmock --- test/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 576de821..a612795e 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,6 +10,12 @@ function (target_link_cppformat target) endif () endfunction () +function (fmt_target_include_directories) + if (CMAKE_MAJOR_VERSION VERSION_GREATER 2.8.10) + target_include_directories(${ARGN}) + endif () +endfunction () + # We compile Google Test ourselves instead of using pre-compiled libraries. # See the Google Test FAQ "Why is it not recommended to install a # pre-compiled copy of Google Test (for example, into /usr/local)?" @@ -18,6 +24,7 @@ endfunction () add_library(gmock STATIC ${FMT_GMOCK_DIR}/gmock-gtest-all.cc ${FMT_GMOCK_DIR}/gmock/gmock.h ${FMT_GMOCK_DIR}/gtest/gtest.h ${FMT_GMOCK_DIR}/gtest/gtest-spi.h) +fmt_target_include_directories(gmock INTERFACE ${FMT_GMOCK_DIR}) find_package(Threads) if (Threads_FOUND) target_link_libraries(gmock ${CMAKE_THREAD_LIBS_INIT})