-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Upgrading to XCode 8 on OSX 10.11 breaks cmake #3197
Copy link
Copy link
Closed
Description
After upgrading to XCode 8 on my OSX 10.11 box, a fresh cmake .. command gives me this error:
CMake Error at /usr/local/Cellar/cmake/3.5.1/share/cmake/Modules/Platform/Darwin.cmake:76 (message):
CMAKE_OSX_DEPLOYMENT_TARGET is '10.11' but CMAKE_OSX_SYSROOT:
""
is not set to a MacOSX SDK with a recognized version. Either set
CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
empty.
It appears that XCode 8 comes with the 10.12 SDK. CMake is using the current OS version to find the SDK, and failing.
The build can be made successfully by being explicit about the SDK path and the minimum OS version for building:
cmake -DCMAKE_OSX_SYSROOT=$(xcrun --sdk macosx --show-sdk-path) -DCMAKE_OSX_DEPLOYMENT_TARGET=10.10 ..
This sets the minimum OSX version to 10.10, and uses the current SDK from XCode, whatever it is.
We should bake these fixes into the base CMakeLists.txt file.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels