summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-10-29 15:17:22 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-10-29 15:17:31 (GMT)
commitc299d10a2ee722c21cdcc554a17082b9c01435c7 (patch)
tree9e865e969ae86ce9f78d5459a1ac2fac8399123f
parentb4b6a3e7e54349cffafc5c81ecef72ee4596a0b4 (diff)
parentc37f4eff5e299212544089f692dc8b090992d7b8 (diff)
downloadCMake-c299d10a2ee722c21cdcc554a17082b9c01435c7.zip
CMake-c299d10a2ee722c21cdcc554a17082b9c01435c7.tar.gz
CMake-c299d10a2ee722c21cdcc554a17082b9c01435c7.tar.bz2
Merge topic 'FindPackageModeMakefileTest-isysroot'
c37f4eff5e FindPackageModeMakefileTest: macOS needs isysroot flag Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !3956
-rw-r--r--Tests/FindPackageModeMakefileTest/CMakeLists.txt8
-rw-r--r--Tests/FindPackageModeMakefileTest/Makefile.in3
2 files changed, 10 insertions, 1 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"
diff --git a/Tests/FindPackageModeMakefileTest/Makefile.in b/Tests/FindPackageModeMakefileTest/Makefile.in
index 8e7ff72..5ef67d0 100644
--- a/Tests/FindPackageModeMakefileTest/Makefile.in
+++ b/Tests/FindPackageModeMakefileTest/Makefile.in
@@ -5,6 +5,7 @@ CMAKE_CURRENT_BINARY_DIR = "@CMAKE_CURRENT_BINARY_DIR@"
CMAKE_CXX_COMPILER = "@CMAKE_CXX_COMPILER@"
CMAKE_CXX_COMPILER_ID = "@CMAKE_CXX_COMPILER_ID@"
CMAKE_CXX_FLAGS = @CMAKE_CXX_FLAGS@
+__EXTRA_OSX_SYSROOT_FLAGS = @__EXTRA_OSX_SYSROOT_FLAGS@
CMAKE_FOO = $(CMAKE) --find-package -DCMAKE_MODULE_PATH=$(CMAKE_CURRENT_BINARY_DIR) -DNAME=Foo -DLANGUAGE=CXX -DCOMPILER_ID=$(CMAKE_CXX_COMPILER_ID)
@@ -15,7 +16,7 @@ all: pngtest
main.o: clean main.cpp
@$(CMAKE_FOO) -DMODE=COMPILE >$(tmp)
@foo="`cat $(tmp)`"; \
- printf '"%s" %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$$foo" >$(tmp)
+ printf '"%s" %s %s %s -c main.cpp\n' $(CMAKE_CXX_COMPILER) "$(CMAKE_CXX_FLAGS)" "$(__EXTRA_OSX_SYSROOT_FLAGS)" "$$foo" >$(tmp)
@cat $(tmp)
@sh $(tmp)
@rm -f $(tmp)