From fa9c4207f1086fb9bafd409be2f9d9114cafe1cb Mon Sep 17 00:00:00 2001 From: Martin Moene Date: Sat, 4 Nov 2017 19:19:48 +0100 Subject: [PATCH] Replace include_directories() with target_include_directories() to prevent inheritance of include directories that possibly lead to a clash. A clash occurs when a folder is included, e.g. examples, that wants to use the single-include directory instead of the normal include directory as used by the SelfTest in the next higher level. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 41d2f44a..de046852 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -281,12 +281,12 @@ SOURCE_GROUP("Tests" FILES ${TEST_SOURCES}) SOURCE_GROUP("Surrogates" FILES ${SURROGATE_SOURCES}) # configure the executable -include_directories(${HEADER_DIR}) # Projects consuming Catch via ExternalProject_Add might want to use install step # without building all of our selftests. if (NOT NO_SELFTEST) add_executable(SelfTest ${TEST_SOURCES} ${IMPL_SOURCES} ${REPORTER_SOURCES} ${SURROGATE_SOURCES} ${HEADERS}) + target_include_directories(SelfTest PRIVATE ${HEADER_DIR}) # Add desired warnings if ( CMAKE_CXX_COMPILER_ID MATCHES "Clang|AppleClang|GNU" )