[CMake] Computation of CMAKE_OSX_SYSROOT

James Turner james.turner at kdab.com
Mon Oct 1 08:46:42 EDT 2018


Hi,

The docs here:

	https://cmake.org/cmake/help/v3.12/variable/CMAKE_OSX_SYSROOT.html

state that CMAKE_OSX_SYSROOT is computed from CMAKE_OSX_DEPLOYMENT_TARGET if not explicitly set. Can anyone comment on how this works, because in my setup it seems to be failing. This showed up as -isysroot not being passed to the compiler, which then causes weird compile failures building on High Sierra with Xcode 10 and the 10.14 SDK.

If explicitly set SDKROOT or CMAKE_OSX_SYSROOT to the 10.14 SDK, everything compiles fine. (Without passing -isysroot, some header is /usr/include are used, and apparently these don’t work for building the 10.14 frameworks)

Deployment target is set to:

	set(CMAKE_OSX_DEPLOYMENT_TARGET "10.7”)

Note that I do this *after* calling project() because contrary to its docs, I find that when I call it before project(), it has no effect. (eg, passing -mmacosx-version-min=10.7 to the compiler).

Full CMakeList.txt is here:

	https://sourceforge.net/p/flightgear/flightgear/ci/next/tree/CMakeLists.txt

Any comments on what is going on, would be appreciated.

Kind regards,
James

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4155 bytes
Desc: not available
URL: <https://cmake.org/pipermail/cmake/attachments/20181001/ce1d2115/attachment.bin>


More information about the CMake mailing list