You get a bonus - 1 coin for daily activity. Now you have 1 coin

Project management. Qmake project setup

Lecture



Qmake project setup

The qmake tool allows you to simplify the build process for the development process on different platforms. qmake automates the generation of the Makefile, so just a few lines of information are enough to create it. qmake can be used for any projects, whether they use Qt or not.

The qmake tool generates a Makefile that is based on information from the project file generated by Qt Creator. It can generate a Makefile for MinGW, Microsoft Visual Studio and CSL ARM on Windows and the GNU Compiler Collection (GCC) on Linux and Mac OS X.

For more information about qmake, see the qmake Handbook.

Qt Profile Selection

Qt Creator allows you to have several versions of Qt installed on your personal computer and use different versions for each of your projects.

If Qt Creator finds qmake in the PATH environment variable, then it uses this version. This version of Qt is called Qt in PATH . If you intend to use only one version of Qt and it is already in your PATH variable and properly configured for use from the command line, you do not need to configure the version of Qt manually.

Windows

To add a Qt profile for MinGW :

  1. Select Tools > Options ... > Qt4 > Qt Profiles .
  2. Click   Project management.  Qmake project setup and enter the profile name in the Profile Name field .
  3. Specify the path to the qmake file in the qmake Location .
  4. Specify the path to the installed MinGW in the MinGW directory .

      Project management.  Qmake project setup

To add a Qt profile for the Microsoft Visual C ++ compiler :

  1. Select Tools > Options ... > Qt4 > Qt Profiles .
  2. Qt Creator automatically sets the correct environment variables for compilation. Select the internal version number of the installed Microsoft Visual C ++ toolkit in the Toolkit drop-down list.

      Project management.  Qmake project setup

If you are using Qt for Symbian and your Symbian SDK is registered with devices.exe, Qt Creator will automatically detect this version of Qt. To add a Qt profile for Symbian:

  1. Select Tools > Options ... > Qt4 > Qt Profiles .
  2. Choose the S60 SDK you want to use with Qt Creator.

      Project management.  Qmake project setup

  3. To build an application for your device using GCCE, enter the path to the CSL ARM Toolchain in the CSL \ GCCE Directory field.

    You do not need to specify this path if the compiler is in a directory included in the PATH environment variable.

  4. To build an emulator application (WINSCW toolkit), enter the path to the Carbide C ++ installation directory in the Carbide Directory field.

    Note: You need Carbide C ++ version 2.0 or later installed.

Compiling a project in Linux

GNU Compiler Collection (GCC) is used to compile a project in Qt Creator in Linux. As an easy replacement for GCC, the Intel Compiler Collection (ICC) is supported.

To add a Qt profile:

  1. Select Tools > Options ... > Qt4 > Qt Profiles .
  2. Click   Project management.  Qmake project setup and enter the profile name in the Profile Name .
  3. Specify the path to the qmake file in the qmake path .

Compiling a project on Mac OS X

To compile a project in Qt Creator on Mac OS X, the GNU Compiler Collection (GCC) is used, which is part of Xcode.

To add a Qt profile:

  1. Select Qt Creator > Options ... > Qt Profiles .
  2. Click   Project management.  Qmake project setup and enter the profile name in the Profile Name .
  3. Specify the path to the qmake file in the qmake path .

      Project management.  Qmake project setup

Adding external libraries to the qmake project

Qt Creator can support code completion and syntax highlighting for external libraries as if they were part of a current project or Qt library.

To add an external library:

  1. Open your project file (.pro) using the Projects panel.
  2. Use the instructions Announcement of other libraries.

Code completion and syntax highlighting will work as soon as your project is successfully assembled and linked to an external library.


Comments


To leave a comment
If you have any suggestion, idea, thanks or comment, feel free to write. We really value feedback and are glad to hear your opinion.
To reply

Cross platform programming

Terms: Cross platform programming