[cmake-developers] Cross compiling toolchain variables

clinton at elemtech.com clinton at elemtech.com
Sun Nov 10 01:14:55 EST 2013



----- Original Message -----
> On 10/30/2013 05:27 PM, Stephen Kelly wrote:
> > Brad King wrote:
> > I want to make sure that downstream uses the same GL headers and libraries
> > as the ones used to build Qt itself. The PATHS is populated with
> > information
> > from qmake, and I wanted to prevent cmake finding different headers and
> > libraries.
> > 
> > I've just staged a patch to remove that behavior for mac though:
> > 
> >  https://codereview.qt-project.org/#change,69605
> 
> Can you point me to the source of the qmake logic that uses -isysroot
> plus paths not inside the SDK?  I'd like to understand why qmake is
> generating paths that don't actually exist and depend on -isysroot
> to be found, or if I'm misunderstanding your explanation.

I don't think you'll find that in the source of qmake as Qt doesn't require anything outside the SDK.  Paths in the Qt build files (see qtbase/mkspects/common/mac.conf) such as /System/Library/Frameworks/OpenGL.framework/Headers are rerooted to the SDK by qmake for compiling.  That is, it becomes -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers.

Also, any user of Qt also using something outside the SDK has to give the -F compile flag themselves.

> 
> > Ok. I thought a mac sdk was 'isolated' and self-contained as far as system
> > APIs are concerned (which seems similar to CMAKE_SYSROOT). Where does the
> > isolation break-down? Honestly I don't see much of a distinction.
> 
> The main problem is that the two of us are not educated enough in the
> ways of Mac development to have this debate ;)
> 
> I suppose with the default "root path mode" of searching re-rooted
> paths and then the original paths then treating the OSX SDK path as
> one of the rerooting prefixes makes sense.  That way any library
> provided by the system SDK will be found for the proper target
> version and otherwise the search will fall back to looking elsewhere.
> 
> We'll have to resolve this while combining CMAKE_SYSROOT and
> CMAKE_OSX_SYSROOT.
> 

With Mac OS X 10.9, frameworks under /System/Library/Frameworks no longer include header files (except for a few such as python).
That basically means the SDK needs to be used instead of things under /System/Library/Frameworks.
The same goes for the now empty /usr/include.

I can also reproduce the error here:
https://bugreports.qt-project.org/browse/QTBUG-32308
This is with qtbase at 569dec8e.

Clint



More information about the cmake-developers mailing list