summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-01-09 21:27:28 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-01-09 21:27:28 (GMT)
commit4ce6cd2bcfa847fe2e9926d97f27be1d89fe1c4b (patch)
tree9e91ebedb46f347d4e6159bd7849043ce2487337 /Tests
parentcda3a69b1bcc2e83806f7423c6970a794be8261f (diff)
parent88f07fb417a25f98662da2abf09a9db03f48eb7f (diff)
downloadCMake-4ce6cd2bcfa847fe2e9926d97f27be1d89fe1c4b.zip
CMake-4ce6cd2bcfa847fe2e9926d97f27be1d89fe1c4b.tar.gz
CMake-4ce6cd2bcfa847fe2e9926d97f27be1d89fe1c4b.tar.bz2
Merge topic '15687-revisit-xcode-system-include'
88f07fb4 Xcode: Properly mark SYSTEM includes as such
Diffstat (limited to 'Tests')
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt4
-rw-r--r--Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt15
2 files changed, 14 insertions, 5 deletions
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index 4920582..db18462 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -3,7 +3,9 @@ project(IncludeDirectories)
if (((CMAKE_C_COMPILER_ID STREQUAL GNU AND CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.4)
OR CMAKE_C_COMPILER_ID STREQUAL Clang OR CMAKE_C_COMPILER_ID STREQUAL AppleClang)
- AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles" OR CMAKE_GENERATOR STREQUAL "Ninja"))
+ AND (CMAKE_GENERATOR STREQUAL "Unix Makefiles"
+ OR CMAKE_GENERATOR STREQUAL "Ninja"
+ OR (CMAKE_GENERATOR STREQUAL "Xcode" AND NOT XCODE_VERSION VERSION_LESS 6.0)))
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-Wunused-variable run_sys_includes_test)
if(run_sys_includes_test)
diff --git a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
index dcee85e..5078f30 100644
--- a/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/SystemIncludeDirectories/CMakeLists.txt
@@ -15,10 +15,17 @@ target_include_directories(upstream SYSTEM PUBLIC
)
add_library(config_specific INTERFACE)
-set(testConfig ${CMAKE_BUILD_TYPE})
-target_include_directories(config_specific SYSTEM INTERFACE
- "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>"
-)
+if(CMAKE_GENERATOR STREQUAL "Xcode")
+ # CMAKE_BUILD_TYPE does not work here for multi-config generators
+ target_include_directories(config_specific SYSTEM INTERFACE
+ "${CMAKE_CURRENT_SOURCE_DIR}/config_specific"
+ )
+else()
+ set(testConfig ${CMAKE_BUILD_TYPE})
+ target_include_directories(config_specific SYSTEM INTERFACE
+ "$<$<CONFIG:${testConfig}>:${CMAKE_CURRENT_SOURCE_DIR}/config_specific>"
+ )
+endif()
add_library(consumer consumer.cpp)
target_link_libraries(consumer upstream config_specific)