[cmake-developers] Issue on CMAKE_OSX_SYSROOT

Francesco Romano francesco.romano.1987 at gmail.com
Sat Oct 3 05:00:17 EDT 2015


Dear all,
I don’t know if this is the right mailing list (or maybe cmake users was better?) to post before opening an issue in the CMake bug tracker.

We have an issue with CMake in OS X ([1]) in one of our project.
The issue arose for a coincidence because Xcode 7 ships with the 10.11 SDK and not with the 10.10 SDK, while our systems are still in 10.10.
Making the long story short I needed to set the variable `CMAKE_OSX_DEPLOYMENT_TARGET` to 10.10 and this was done after the first “project” call.
This works if the generator is Xcode, but not if it is Unix Makefiles.
I restricted the issue to lie in the following if in DarwinInitialize.cmake (lines 48-51)

elseif("${CMAKE_GENERATOR}" MATCHES Xcode
       OR CMAKE_OSX_DEPLOYMENT_TARGET
       OR CMAKE_OSX_ARCHITECTURES MATCHES "[^;]"
       OR NOT EXISTS "/usr/include/sys/types.h")

Now, the question is: why the Unix Makefile should  not  need the variable “CMAKE_OSX_SYSROOT” but only if the deployment target is not set?
Shouldn’t be correct to set anyway the sysroot (which by the way can be easily found because Xcode is present on the machine)?
Btw: we also build .app with makefiles. Shouldn’t this need the sysroot?

Thanks for the clarification.
Francesco


[1] https://github.com/robotology/yarp/issues/592


More information about the cmake-developers mailing list