diff options
author | Craig Scott <craig.scott@crascit.com> | 2019-10-27 21:25:18 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2019-10-28 20:14:08 (GMT) |
commit | c37f4eff5e299212544089f692dc8b090992d7b8 (patch) | |
tree | e85ac52452dfc9925b6c8817927bf30253039a66 /Tests/FindPackageModeMakefileTest/CMakeLists.txt | |
parent | 92eb3a4475e92d993b901c06d967210912390ada (diff) | |
download | CMake-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.txt | 8 |
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" |