

The primary benefit of this is that the features of Qt (and the modules of Qt) which can be used with CMake do not depend on the version of CMake being used. Such files are called Config files, and usually they are generated by CMake itself.Ī Qt 5 build, will also generate the CMake Config files, but without causing Qt 5 to depend on CMake itself. Apart from making it possible to find your dependencies using a Find file, CMake is also able to read files provided by the dependency itself to locate the libraries and header files. The copying may not even work if the updated Find file uses features of the newer CMake.īehind the scenes, Qt 5 is now found in a slightly different way too.

That means that if someone wanted to use QtMultimedia, they could either have to wait for and then depend on the new CMake release, or attempt to copy the Find file into their project to work with their existing CMake version. Support for that module was not complete until CMake 2.8.2, released in June 2010. For example, when Qt 4.6 was released in December 2009 it included a new QtMultimedia module. One of the disadvantages of this file being part of CMake, and not part of Qt, is that the file could get out-of-date. Once the package has been found, Qt 4 users would use the CMake variables $ for linking, for example. There is likely to be a way in the future to specify the specific modules in one command, but this will not be available with Qt 5.0: find_package(Qt5 COMPONENTS Widgets Declarative) To find Qt 5 you can find all of the modules you wish to use with separate commands: find_package(Qt5Widgets) Whereas when finding Qt 4, with CMake you use find_package(Qt4 COMPONENTS QTCORE QTGUI) One of the major changes when using CMake with Qt is the result of increased modularity in Qt itself. The updated documentation for using CMake with Qt 5 is has been reviewed and generated and repeats the relevant information in this blog post. KDAB contributed some new CMake Config files for Qt 5 to ensure that the integration between Qt and CMake can be even better. KDAB engineers have contributed some features to CMake to ensure that the Qt 5 support for CMake is as good as possible.

KDE was even the tipping point for the popularity of CMake in general, and with Qt 4 in particular, according to Bill Hoffman. Especially when creating large or complex software, CMake can be more suitable to use than QMake.
#Qt5 static cmake prefix path osx generator#
# Maintainer: Martchus # All my PKGBUILDs are managed at where # you also find the URL of a binary repository.CMake is a buildsystem generator developed in the open, and widely used for Qt based development.
