当前位置:网站首页>[QT] detailed explanation of *.pro, *.pri, *.prf, *.prl files
[QT] detailed explanation of *.pro, *.pri, *.prf, *.prl files
2022-07-26 06:58:00 【Cappuccino-jay】
1、*.pro
qmake The engineering of (project) file , Everyone must be very familiar with this . Direct example :
This is a typical Qt Of the sample program .pro file (propriprfprl.pro):
TEMPLATE = app
CONFIG += QT
QT += core gui
TARGET = propriprfprl
SOURCES += main.cpp/
widget.cpp
HEADERS += widget.h
FORMS += widget.ui
- front 3 Line is qmake The default value of
- TARGET This line specifies the project name
2、*.pri
i What does that mean? ? contain (include) The first letter of . Be similar to C、C++ Header file in , Anyway, you can put
*.proPart of the document is put into a separate*.priIn the file , And then include .
Take the previous example , Separate the settings of the source file , Put it in propriprfprl.pri In the file :
SOURCES += main.cpp/
widget.cpp
HEADERS += widget.h
FORMS += widget.ui
At this time ,propriprfprl.pro The file can be simplified to :
TEMPLATE = app
CONFIG += QT
QT += core gui
TARGET = propriprfprl
include(propriprfprl.pri)
- What's the use ? For this example , It's really useless , Instead, there is one more file , More trouble .
- But , If a larger project , Contains multiple
*.proWhat about the documents , these pro Need some common settings or required files , At this time, it is necessary .
3、*.prf
f God horse Dongdong again ? characteristic (feature) First character
and pri File similar , This file is also to be included pro Of documents
- It's just : It's more hidden
- You often deal with it , May have been blind
- Actually, this example has been used , This is it. CONFIG+=QT
When we're in CONFIG When you specify something in ,qmake Will try to load the corresponding feature file :
- Qt Install under directory mkspecs/features/qt.prf
- features The file name of the file must be lowercase
- qmake Which directories to search features What about the documents ?
For the time being, I only know what I mentioned above $$QTDIR/mkspecs/features That's all right.
Write your own features file :propriprfprl.prf
win32:CONFIG += console
- by win32 Add console to your program , A little many times in one fell swoop .
- Put this file in the directory we mentioned earlier
And then in pro Add in file
CONFIG += propriprfprl
See and CONFIG += console The same effect ?
notes : We can also use load Command to load prf file , For example, the previous command can be considered equivalent to
load(propriprfprl)
4、*.prl
l This thing is easy to understand , link (link) First character . Mainly related to the generation and use of static libraries ( The dynamic library can also have this file , Go to Qt Install under directory lib Just look under the directory ).
- When generating static libraries , We need to use the following configuration ( And then generate... With the same name as the library file
*.prlfile )
CONFIG += create_prl
- When engineering TEMPLATE by app when , The following instructions will be automatically added ( When looking for library files , Will try to find the corresponding
*.prlfile )
CONFIG += link_pri
So what is the use of this file ? Take an example that you may be familiar with QextSerialPort1.2 This library (windows Under the circumstances ):
- Compile time , need setupapi.lib advapi32.lib user32.lib These library files
- After compiling into a static library , It does not contain this 3 Library file information
- therefore , When we use this QextSerialPort Static library , You still need to specify these library files
If there is prl What about the documents , This file will contain the dependency information :
QMAKE_PRL_BUILD_DIR = D:/buildlib
QMAKE_PRO_INPUT = buildlib.pro
QMAKE_PRL_TARGET = qextserialport-1.2
QMAKE_PRL_CONFIG = include_source_dir incredibuild_xge lex yacc warn_on uic resources incremental_off windows release ReleaseBuild Release build_pass qt warn_on release incremental flat link_prl precompile_header autogen_precompile_source copy_dir_files debug_and_release debug_and_release_target embed_manifest_dll embed_manifest_exe stl exceptions rtti mmx 3dnow sse sse2 release ReleaseBuild Release build_pass qt qextserialport-buildlib create_prl qextserialport-uselib qextserialport-static static debug_and_release build_all release ReleaseBuild Release build_pass no_autoqmake staticlib static moc thread
QMAKE_PRL_LIBS = setupapi.lib advapi32.lib user32.lib d://Qt//4.7.0//lib//QtGui4.lib d://Qt//4.7.0//lib//QtCore4.lib
边栏推荐
- IR tool in JIT and download, compile and use of jitwatch
- Function of hot air pad
- Open includeexceptiondetailinfaults on the server (from servicebehaviorattribute or from & lt; servicedebug & gt; to configure behavior) to send exception information back
- C#使用log4net插件,输出日志到文件
- MySQL基础篇(二)-- MySQL 基础
- How to solve the crash when the easygbs platform edits the device management group?
- buuReserve(4)
- Introduce you to JVM from architecture
- vulnhub Lampião: 1
- Kernel pwn 入门 (5)
猜你喜欢

基于C51实现led流水灯

【Star项目】小帽飞机大战(三)

Realization of LED water lamp based on C51

Click "Niuke | daily question" to eliminate it
![[arm learning (8) AXF tool analysis]](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[arm learning (8) AXF tool analysis]

Realize the full link grayscale based on Apache APIs IX through MSE

怎样在win10家庭版中使用Hyper-V

火焰图分析Flink反压

LeetCode刷题1:题目分类

Download, installation and development environment construction of "harmonyos" deveco
随机推荐
[today in history] July 18: Intel was founded; The first photo was posted on the world wide web; EBay spins off PayPal
供应链的多目标协同决策
Summarize and learn STM32 to create project template
[hardware ten treasures] - 7.1 [dynamic RAM] key points of DDR hardware design
在第一次使用德国小鸡要注意的地方
How to realize digital production mode in garment industry
"Niuke | daily question" template stack
opengauss简易版安装报错
源代码加密技术发展阶段
【Star项目】小帽飞机大战(二)
2万字带你从0到1搭建一套企业级微服务安全框架
MySql 执行计划
File server fastdfs
docker修改挂载到宿主机上的mysql配置文件不生效?
MySQL Foundation (II) -- MySQL Foundation
How to open an account online for Guohai Securities? Is it safe to open an account
Torth file read vulnerability (cnvd-2020-27769)
【Star项目】小帽飞机大战(四)
基于C51实现led流水灯
强网杯2021 pwn 赛题解析——baby_diary