[CMake] QT_DEFINITIONS

Michael Hertling mhertling at online.de
Sun May 23 10:26:42 EDT 2010


Dear CMake community,

after having taken a look into FindQt4.cmake, UseQt4.cmake and
Qt4ConfigDependentSettings.cmake, I wonder how the QT_DEFINITIONS
variable gets populated. As far as I can see, this variable remains
empty, perhaps except for -DQT_DLL on Windows; in particular, it does
not receive the -DQT_<library>_LIB flags which are solely enabled via
ADD_DEFINITIONS() by UseQt4.cmake, i.e. with INCLUDE(${QT_USE_FILE})
as suggested by FindQt4.cmake. Of course, from within a FindXXX.cmake
or XXXConfig.cmake for a package depending on Qt4, one does not want
to have the build environment modified by ADD_DEFINITIONS() et al.,
but convey the necessary settings by variables like QT_DEFINITIONS.
Therefore, my question is how to get to know about the flags for
compiling Qt4-dependent packages without including UseQt4.cmake.

BTW, what is the recommendation for a package XXX which depends on a
package YYY regarding FindXXX.cmake and FindYYY.cmake, i.e. would one
expect FindXXX.cmake to call FIND_PACKAGE(YYY), or is the user expected
to call FIND_PACKAGE() for XXX and YYY in the correct order and, as the
case may be, with sufficient sets of components? In general, the latter
is easier for the finders, but the former would be more convenient for
the user.

Any comments, suggestions etc. would be greatly appreciated.

Best regards,

Michael


More information about the CMake mailing list