当前位置:网站首页>[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
边栏推荐
- Use and analysis of show profile optimized by MySQL
- < II> ObjectARX development: create and edit basic graphic objects
- C#使用log4net插件,输出日志到文件
- 解决 Chrome 浏览器被毒霸篡改问题
- <二> objectARX开发:创建和编辑基本图形对象
- Kernel pwn 入门 (5)
- 【QT】详解 *.pro、*.pri、*.prf、*.prl文件
- Realization of LED water lamp based on C51
- 你了解MySQL都包含哪些“零件“吗?
- Binary tree knowledge summary
猜你喜欢

buuReserve(4)

强网杯2021 pwn 赛题解析——baby_diary
![[untitled] reprint](/img/6c/df2ebb3e39d1e47b8dd74cfdddbb06.gif)
[untitled] reprint

Queue assistant | product update log in June 2022

Download, installation and development environment construction of "harmonyos" deveco

npm 命令

Delete ^m from VIM

"Niuke | daily question" template stack

你了解MySQL都包含哪些“零件“吗?

28. Implement strstr() implement strstr()
随机推荐
Tiktok web s_ v_ web_ Analysis and implementation of ID parameter generation
IV Actual combat - global unified return result class
[database] CTE (common table expression)
Click "Niuke | daily question" to eliminate it
2万字带你从0到1搭建一套企业级微服务安全框架
字符串和内存函数
Proxyman, a native high-performance packet capturing tool, is for you who love learning
Rectification ideas for the previous article
buuReserve(4)
Introduce you to JVM from architecture
日志轮转logrotate
Binary tree knowledge summary
Is it safe to invest in treasury bonds in 2022? How do individuals buy treasury bonds?
敏捷整洁之道
MySQL intent lock
[graduation season _ advanced technology Er] farewell to yourself who has been confused for the past two years. Regroup, junior I'm coming
Vim中删除^M
[Star Project] small hat aircraft War (III)
On stock price prediction model (3): are you falling into the trap of machine learning
微信小程序 - 从入门到入土