[CMake] FindQt4.cmake to automatically include QT_USE_FILE?

Michael Wild themiwi at gmail.com
Tue Jun 7 09:46:53 EDT 2011


On 06/07/2011 03:21 PM, John Drescher wrote:
>> If you don't care for the macros and want to set up the
>> include-directories and defines yourself, no. Also, it is common to
>> find_package(Qt4) in the top-level CMakeLists.txt file, but then include
>> QT_USE_FILE only in specific subdirectories, where Qt is actually used.
>>
> 
> I have started doing that in my projects. It cuts down on the
> unnecessary includes for subprojects that do not need Qt.
> 
> John


Ah, this reminds me of one of the things on my wish list for FindQt4:
Modern Qt4 uses a Mac-framework compatible layout, such that in order to
e.g. include QObject header, you would do

#include <QtCore/QObject>

If a project is using this include-practice, the module could cut down
considerably on include-paths. Also, it makes the framework detection
ugliness on Mac unnecessary.

So, here my wish: similar to QT_USE_IMPORTED_TARGETS, introduce
QT_USE_FRAMEWORK_INCLUDES (or similar) which only adds the directory
containing all the QtCore, QtGui, QtXml, ... header directories to the
include-path.

Michael


More information about the CMake mailing list