[CMake] Computation of CMAKE_OSX_SYSROOT

James Turner james.turner at kdab.com
Mon Oct 1 11:13:31 EDT 2018



> On 1 Oct 2018, at 14:25, Craig Scott <craig.scott at crascit.com> wrote:
> 
> You need to set CMAKE_OSX_DEPLOYMENT_TARGET as a cache variable before calling the project() command. If you set it as a normal (i.e. non-cache) variable, the compiler detection logic triggered by the project() call creates a cache variable if one doesn't exist, which would discard the non-cache variable. It's a bit unfortunate, but that's what happens when you set a cache variable for the first time. The relevant code related to your observations is in Modules/Platform/Darwin-Initialize.cmake.

Thanks, that was indeed the solution.

I’d suggest the docs page for CMAKE_OSX_DEPLOYMENT_TARGET could use some wording to point this out, but I don’t know who . how a docs change gets done.

James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20181001/f4ce4ce2/attachment.html>
-------------- 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/f4ce4ce2/attachment.bin>


More information about the CMake mailing list