Qt Qmake Project
Qt creator automatically runs cmake to refresh project information when you edit a cmakelists txt configuration file in a project.
Qt qmake project. Qmake typical pro file. You can use the qt variable to control any additional qt modules that are required by your application. Qmake is installed and configured when you install qt. Build a gui executable.
For best results you should use cmake version 3 7 2 with server. This article show you to use cmake with qt4. The project file format used by qmake can be used to support both simple and fairly complex build systems. The idea behind this wiki page is to collect some material not present there yet and also tips tricks that can be useful.
The project is a qt application and should link against the qt library. Qmake generates a makefile based on the information in a project file. Qmake is a tool that automates the generation of makefiles for projects using qt or not i e acts as a build system tool. Qmake automatically detects whether moc is required by the classes in the headers and adds the appropriate dependencies and files to the project for generating and linking the moc files.
For qt5 see here qt5 cmake manual. This is similar to the headers variable but will let the generated moc files be compiled with the objective c compiler. In this article i describe base functionality that usualy used to build simple project. The project is an x11 application or library.
Qmake contains additional features to support development with qt automatically including build rules for moc and uic. You can use it instead qmake native qt buid system. This value is added by default but you can remove it to use qmake for a non qt project. Qt creator supports cmake version 3 0 or later.
Project information is also automatically refreshed when you build the project. Project files are created by the developer and are usually simple but more sophisticated project files can be created for complex projects. Qmake automates the generation of build configurations so that only a few lines of information are needed to create each configuration. This value is not needed if the target uses qt.
Simple project files will use a straightforward declarative style defining standard variables to indicate the source and header files that are used in the project. Get started with cmake. There is a whole section of the official qt documentation dedicate to this tool. Cmake is a tool to simplify the build process for development projects across different platforms cmake automatically generates build systems such as makefiles and visual studio project files.
Complex projects may use the control flow structures to fine tune the build process.