Start and end this line with "#".
Template variables tell qmake what type of makefile to generate for this application.
Specify compiler options and project configurations, which are recognized internally by qmake and have special significance.
The following configuration values control the compilation flags:
Qmake adds the value of this variable as a compiler C preprocessor macro (-D option).
Specifies the #include directory that should be searched when compiling the project.
Specifies the relevant path that the program depends on at compile time.
Specify the location to place the target file.
Specifies the name of the target file. The base name of the project file that is included by default.
Specify the build directory.
Specify the directory where all intermediate files in moc are stored (the header file containing Q_OBJECT macro is converted into the standard storage directory. H file).
Specifies the directory where all intermediate files are stored. o(。 Obj) is placed.
Specifies the directory of Qt resource compiler output files. Qrc file is converted to qrc_*. H file).
Specifies the list of libraries linked to the project. After -L is the directory of the library file, and after -l is the name of a specific library (no suffix is required). For example:
LIBS += -L$$PWD/../../../ThirdLib/winapi -lWSock32
For Windows only, the specified icon should be included in the generated. Rc file. This option is available only if neither the RC_FILE nor the RES_FILE variables are set.
Specifies the translation list (. Ts) A file containing translated text of the user interface.
The simple scope of the platform-related files added for the Windows platform is as follows:
win32 { SOURCES += hello_win.cpp }
Every time a subproject is added, a project name will be added to the subproject, and the template of the subproject is = subdirs. CONFIG += ordered is to let the projects compile in order. Because the main program depends on the corresponding library, MainApp is usually placed at the end of the subdirectory.
Directory settings (build directory, obj generation directory, moc file generation directory, etc. ) can be written in a pri file:
In the pro file to be referenced:
Including ($$PWD/../../../Path.pri)
Message($$INCLUDEPATH) will print the values of related variables in the summary information.
Template = app of the main program. In addition to the normal pro settings, remember to add the header file directory of your own library and the dll generated through LIBS link:
Template = lib of the library. When creating a library through Creator, a xxx_global.h will be generated, which defines the related information of the exported library:
Remember to add the corresponding macro to the class to be used as an interface in the library:
Class testlibshared _ exporttestlib: public qobject
Static libraries don't seem to need this, they need to be tested. ...