Home > Mobile >  One can say in Qt project. The role of the pro file DISTFILES macro?
One can say in Qt project. The role of the pro file DISTFILES macro?

Time:01-17

One can say in the Qt engineering. Pro file DISTFILES macros in the specific use? (through in Qt Creator & gt; Right-click the engineering & gt; Add existing files & gt; Add dynamic library automatically in. Pro file to add the macro, thought this macro is by adding a dynamic library to engineering, and LIBS macro should be the same, are used to dynamic link library, but the actual test and it is not, whether under Windows or Ubuntu, DISTFILES seems to be dispensable, but LIBS are must be some, online check a lot of information is rarely mentioned this macro, although does not affect the use or want to be able to inform,

CodePudding user response:

https://doc.qt.io/qt-5/qmake-variable-reference.html#distfiles

Specifies a list of files to be included in the dist target. This feature is supported by UnixMake specs only.

Copies the files listed to release folder, this option only for unix-like makefile effectively, that is to say under the Windows, only a MinGW compiler

CodePudding user response:

reference 1/f, dext response:

https://doc.qt.io/qt-5/qmake-variable-reference.html#distfiles
Specifies a list of files to be included in the dist target. This feature is supported by UnixMake specs only.

Copies the files listed to release folder, this option is only for unix-like makefile effectively, that is to say under the Windows, only the MinGW compiler have role

Don't understand, ask: look this explanation is embedded into the target in the program?

CodePudding user response:

reference 1/f, dext response:

https://doc.qt.io/qt-5/qmake-variable-reference.html#distfiles
Specifies a list of files to be included in the dist target. This feature is supported by UnixMake specs only.

Copies the files listed to release folder, this option is only for unix-like makefile effectively, that is to say under the Windows, only the MinGW compiler have role
according to the meaning of words, is added to the project by the macro file doesn't need the absolute path can be directly opened by file name (for example, when I open a file with the open, originally need QFile: : setFileName ("../../test. BMP "); , add after this macro can QFile: : setFileName (" test. BMP ");) , I also use the Release mode test under Windows, but no effect, still need to use absolute paths, at the same time, under the project build path Release directory does not add the target file copy, I test environment is under Windows Qt5.11.3, the compiler version is a 32 bit MinGW_53, may be as official document Specifies a list of files to be included in the dist target. This feature is supported by UnixMake specs only. The characteristics of the macro only under Unix can normal use, now I only can find the only function of the macro is in a project involving all of the files are added to the project directory of Other files, convenient people behind the project, clearly understand the whole project architecture, convenient to modify files involved, convenient configuration project running environment, just convenient to view project, no actual effect, but This is only my preliminary understanding, I do not know whether is wrong, hope more,

CodePudding user response:

Dist target refers to a folder

refer to the second floor of dreams leaves response:
don't understand, please ask: look at this explanation is embedded into the target in the program?


-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --


Here work points you to make sure that the folder is not necessarily EXE folder, I think your problem is caused by this,
Another OTHER_FILES variables are used to simply added to the project in the view

reference 3 floor. One response:
according to the meaning of words, is added to the project by the macro file doesn't need the absolute path can be directly opened by file name (for example, when I open a file with the open, originally need QFile: : setFileName ("../../test. BMP "); , add after this macro can QFile: : setFileName (" test. BMP ");) , I also use the Release mode test under Windows, but no effect, still need to use absolute paths, at the same time, under the project build path Release directory does not add the target file copy, I test environment is under Windows Qt5.11.3 MinGW_53 compiler version is 32 bit, may be as official document Specifies a list of files to be included in the dist target. This feature is supported by UnixMake specs only. The characteristics of the macro only under Unix can normal use, now I only can find the only function of the macro is in a project involving all of the files are added to the project directory of Other files, convenient people behind the project, clearly understand the whole project architecture, convenient to modify files involved, convenient configuration project running environment, just convenient to view project, no actual effect, but This is only my preliminary understanding, I do not know whether is wrong, hope more,

CodePudding user response:

DISTFILES
Specifies a list of files to be included in the dist target. This feature is supported by UnixMake specs only.
For example:

DISTFILES +=../program. TXT
Commonly used to indicate when you need to compile the output to the dist directory of other documents, the following example:
DISTFILES=$$PWD/qtcreator. Sh \
QML/query. QML \
Doc/readme. Md

  •  Tags:  
  • Qt
  • Related