summaryrefslogtreecommitdiffstats
path: root/Tests/FindPackageModeMakefileTest/CMakeLists.txt
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2019-10-27 21:25:18 (GMT)
committerCraig Scott <craig.scott@crascit.com>2019-10-28 20:14:08 (GMT)
commitc37f4eff5e299212544089f692dc8b090992d7b8 (patch)
treee85ac52452dfc9925b6c8817927bf30253039a66 /Tests/FindPackageModeMakefileTest/CMakeLists.txt
parent92eb3a4475e92d993b901c06d967210912390ada (diff)
downloadCMake-c37f4eff5e299212544089f692dc8b090992d7b8.zip
CMake-c37f4eff5e299212544089f692dc8b090992d7b8.tar.gz
CMake-c37f4eff5e299212544089f692dc8b090992d7b8.tar.bz2
FindPackageModeMakefileTest: macOS needs isysroot flag
macOS/Xcode no longer populate /usr/include. Building with the compiler directly instead of using /usr/bin/c++ can result in missing headers without the -isysroot flag. Relates: #19885
Diffstat (limited to 'Tests/FindPackageModeMakefileTest/CMakeLists.txt')
-rw-r--r--Tests/FindPackageModeMakefileTest/CMakeLists.txt8
1 files changed, 8 insertions, 0 deletions
diff --git a/Tests/FindPackageModeMakefileTest/CMakeLists.txt b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
index 23832da..8a87a8c 100644
--- a/Tests/FindPackageModeMakefileTest/CMakeLists.txt
+++ b/Tests/FindPackageModeMakefileTest/CMakeLists.txt
@@ -19,6 +19,14 @@ if(UNIX AND "${CMAKE_GENERATOR}" MATCHES "Makefile" AND
# configure a FindFoo.cmake so it knows where the library can be found
configure_file(FindFoo.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FindFoo.cmake @ONLY)
+ # Need the -isysroot flag on recentish macOS after command line tools
+ # no longer provide headers in /usr/include
+ if(APPLE AND CMAKE_OSX_SYSROOT)
+ set(__EXTRA_OSX_SYSROOT_FLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
+ else()
+ set(__EXTRA_OSX_SYSROOT_FLAGS "")
+ endif()
+
# now set up the test:
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/cmakeExecutable.mk"
CONTENT "CMAKE = \"$<TARGET_FILE:cmake>\"\n"