[cmake-developers] Issue on CMAKE_OSX_SYSROOT

Brad King brad.king at kitware.com
Mon Oct 12 11:00:34 EDT 2015


On 10/11/2015 06:17 AM, Gregor Jasny wrote:
>> if (SDK is newer than host) && (is not set CMAKE_OSX_DEPLOYMENT_TARGET)
>>   set CMAKE_OSX_DEPLOYMENT_TARGET=<host version>
>> endif()

That logic looks right to me.

> Could you please give the following patch to Darwin-Initialize.cmake a try?
> 
> https://cmake.org/gitweb?p=stage/cmake.git;a=commit;h=d61c6689c7380c810e060fed6bf3a0b9fbfd41d0

Francesco, does that resolve this for you?

> Brad: If we would set in line 33 the CMAKE_OSX_DEPLOYMENT_TARGET cache
> variable only if ENV{MACOSX_DEPLOYMENT_TARGET} actually exists we could
> get rid of the FORCE attribute later. Would that make sense?

The reason it is cached there is so that the initial selection is
cached persistently across runs.  One could refactor the logic to
use a normal variable at first and then cache the value later
once the final value is selected.

I think the FORCE approach is a good fixup to backport to 3.4.
The rest of the refactoring can be done in 'master' only, please.

Thanks,
-Brad



More information about the cmake-developers mailing list