[cmake-developers] How should Mac frameworks work?

Clinton Stimpson clinton at elemtech.com
Mon Jul 1 14:01:54 EDT 2013


On Monday, July 01, 2013 07:36:24 PM Stephen Kelly wrote:
> Clinton Stimpson wrote:
> > This change hasn't been released yet and will go into CMake 2.8.12.
> 
> Ah, I see. I was mis-reading my gitk.
> 
> > If Qt were to put multiple versions of libraries into one framework, then
> > I think the IMPORTED_LOCATION should be more specific.
> 
> The issue is more about cmake using the correct -F and --framework flags for
> the Qt frameworks. As Qt includes are no longer installed to
> $prefix/include in the 5.1.0 RC2 (pending temporary reversal
> https://codereview.qt-project.org/#change,60232 ), and as there is no
> QtCore directory containing a QObject header, lines like
> 
>  #include <QtCore/QObject>
> 
> are expected to behave in the standard way appropriate for frameworks, which
> I understand to mean:
> 
>  * Use -F to specify paths to look for frameworks
>  * Compile with --framework QtCore
>  * Look in $something/QtCore.framework/Headers for QObject to include
> 
> That means that CMake is expected to generate a buildsystem which contains
> those -F and --framework flags, if I've understood everything.
> 
> As far as I understand, that is not the case currently when trying to use
> CMake with the with the Qt frameworks (feel free to try the RC2 and hack
> around with the Config files).
> 

Yeah, I understand that is the issue.
I don't quite get what is new for Qt 5.1.  I thought Qt 4.x only installed Qt 
headers inside the framework too.  Perhaps its new from 5.0 to 5.1?

On a Mac with a prebuilt Qt 4.7
qmake -query QT_INSTALL_HEADERS => /usr/include
The only Qt headers under there are the headers for the QtUiTools module which 
is a static library and not a framework.
That is why we had this in FindQt4.cmake/UseQt4.cmake
include_directories("/path/to/QtCore.framework;/usr/include") 
which produced a "-F/path/to" and "-I/usr/include" compile flags.

-- 
Clinton Stimpson
Elemental Technologies, Inc
Computational Simulation Software, LLC
www.csimsoft.com



More information about the cmake-developers mailing list