[cmake-developers] Cross compiling toolchain variables

Brad King brad.king at kitware.com
Tue Nov 12 11:50:34 EST 2013


On 11/09/2013 06:08 AM, Stephen Kelly wrote:
> 1) The user sets the CMAKE_SYSROOT to a path *or* a OSX SDK name. CMake 
> transforms it to a path if it is an SDK name, so that in CMake code, 
> CMAKE_SYSROOT is always a path.
> 
> 2) The user continues to set CMAKE_OSX_SYSROOT, but CMake sets the 
> CMAKE_SYSROOT variable to either the path, if it is a path, or the 
> transformed result of an SDK name.
[snip]
> So, I think, without knowing more than the above, I prefer option 3: Don't 
> merge the features.

Note that we didn't always support a logical name in CMAKE_OSX_SYSROOT.
It was added in CMake 2.8.10:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1786b121

IMO it should probably be transformed to the full SDK path in CMake
code, using the logical name only in CMakeCache.txt and for the Xcode
generator.  I think we can do this with no attempt at compatibility
because projects must always deal with users setting the value to
a path already (and this variable is undocumented anyway).

Would this change your conclusion?

Since none of us seems to understand how to properly merge these
features, perhaps it is simplest to keep them separate.  Once both
have been around for a while perhaps their relationship will be
more clear.  In my understanding, the distinction can simply be
that CMAKE_OSX_SYSROOT is for OS X -> OS X builds, and CMAKE_SYSROOT
is for cross compiling.

-Brad



More information about the cmake-developers mailing list