Qt conditional version check

Alexander Neundorf neundorf at kde.org
Sun Jan 10 20:00:38 CET 2010


On Saturday 09 January 2010, Michael Pyne wrote:
> On Friday 08 January 2010 04:57:51 Will Stephenson wrote:
> > What's the canonical way to enable compilation of a subdirectory
> > depending on the version of Qt found?
> >
> > I want to be able to only compile the Network Management plasmoid if Qt
> > 4.6 is found, but grepping svn yields no good examples, some people are
> > doing manual comparisons of QT_MAJOR_VERSION, QT_MINOR_VERSION etc.
>
> It seems to me after looking at FindQt4.cmake and the cmakecommands manpage
> for if() that the following should be "the best" (assuming you've already
> run find_package for Qt):
>
> set(QT_VERSION
> "${QT_MAJOR_VERSION}.${QT_MINOR_VERSION}.${QT_PATCH_VERSION}")
> if((${QT_VERSION} VERSION_EQUAL x.y.z) OR (${QT_VERSION} VERSION_GREATER
> x.y.z)

Yes, correct :-)

Alex


More information about the Kde-buildsystem mailing list