Lecture
taxis
CMake is an alternative to qmake for automating the generation of a Makefile. It controls the process of compiling an application using simple configuration files called CMakeLists.txt files. CMake generates makefiles and workspaces that can be used in the compiler environment of your choice.
Since Qt Creator 1.1, support for CMake projects is available. Qt Creator 1.3 supports the Microsoft toolkit if cmake version is at least 2.8.
You can configure the path for the CMake executable in Tools > Options ...> Projects> CMake .
Note: Before you open the CMake project, you must change the PATH environment variable so that it includes the bin mingw and Qt Creator directories in the SDK.
For example, if you have Qt Creator SDK installed on drive C, use the following command to set environment variables on the command line:
set PATH = C: \ qtsdk \ mingw \ bin; C: \ qtsdk \ qt \ bin;
Then, start Qt Creator by typing:
C: \ qtsdk \ bin \ qtcreator.exe
To open a CMake project:
The wizard will guide you through the remaining steps of the process.
Note: If the CMake project does not have a place to build, Qt Creator will allow you to specify the directory in which the project will be built (shadow assembly).
The screenshot below shows how you can specify command line arguments for CMake in your project.
Usually there is no need to pass any arguments for the project that has already been collected, since CMake caches this information.
Qt Creator builds CMake projects by running make , mingw32-make or nmake depending on your platform. Bugs and assembly warnings are processed and displayed in the Assembly Output panel.
By default, Qt Creator collects all targets. You can specify which goals should be collected in the Projects mode in the Build Settings .
Qt Creator supports multiple build settings. The build directory can be changed after the initial import.
Qt Creator automatically adds Launch Settings for all targets specified in the CMake project file.
Known issues for the current version can be found.
here.
Qt Creator can support code completion and syntax highlighting for external libraries as if they were part of a current project or Qt library.
Qt Creator defines external libraries using the FIND_PACKAGE () macro. Some libraries come with CMake. You can find them in the Modules subdirectory in the CMake installation directory.
Note: If you provide your own libraries, you also need to provide your own FindFoo.cmake file. See the CMake FAQ for more information.
Code completion and syntax highlighting will work as soon as your project is successfully assembled and linked to an external library.
will work as soon as your project is successfully assembled and linked to the external library.
Comments
To leave a comment
Cross platform programming
Terms: Cross platform programming