[cmake-developers] Issue on CMAKE_OSX_SYSROOT
Brad King
brad.king at kitware.com
Tue Oct 6 10:00:44 EDT 2015
On 10/06/2015 09:49 AM, Francesco Romano wrote:
> - Compilation of the project.
> I want the user to be able to compile the project on its machine
> (so build system = deployment system). Of course I can document
> that he has to explicitly pass the variable to cmake, but it
> does not seem too user friendly to me
Your project should not be setting CMAKE_OSX_DEPLOYMENT_TARGET
in its code. If you don't set this then CMAKE_OSX_SYSROOT is
not needed. Both are meant to be set by end users. If the
deployment target is their own machine then neither needs to
be set and it should just work.
> - Brew formula.
> I have to use ruby to detect the user platform and configure
> the arguments to cmake accordingly.
If the build targets the current system then again there is no
need to set either variable. Or, you can set both by using a
symbolic SDK name rather than the path. For example:
-DCMAKE_OSX_DEPLOYMENT_TARGET=10.9
-DCMAKE_OSX_SYSROOT=macosx10.9
> I also want to add that this issue arose with Xcode 7.
> Indeed Apple ships now (first the first time) only the 10.11 SDK,
> even if the system is 10.10. And this is what is causing the issue,
> because cmake automatically set the deployment target to match
> the sdk and not the build system.
Okay, that looks like the underlying issue. The
Modules/Platform/Darwin-Initialize.cmake module will have
to be taught about this case to do the right thing by default
if it does not already.
Gregor, do you mind taking a look at this?
Thanks,
-Brad
More information about the cmake-developers
mailing list