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)
add_subdirectory(widget)
endif()
On the other hand I haven't even bothered to ensure that this is valid syntax
in CMake, let alone that it actually works.
Regards,
- Michael Pyne
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Kde-buildsystem mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-buildsystem
