qmake 文件扩展名操作
帮助文档Qt 5.12->qmake Manual->Configuring qmake节选
Under normal circumstances qmake will try to use appropriate file extensions for your platform. However, it is sometimes necessary to override the default choices for each platform and explicitly define file extensions for qmake to use. This is achieved by redefining certain built-in variables. For example, the extension used for moc files can be redefined with the following assignment in a project file:
QMAKE_EXT_MOC = .mymocThe following variables can be used to redefine common file extensions recognized by qmake:
- QMAKE_EXT_MOC modifies the extension placed on included moc files.
- QMAKE_EXT_UI modifies the extension used for Qt Designer UI files (usually in FORMS).
- QMAKE_EXT_PRL modifies the extension placed on library dependency files.
- QMAKE_EXT_LEX changes the suffix used in Lex files (usually in LEXSOURCES).
- QMAKE_EXT_YACC changes the suffix used in Yacc files (usually in YACCSOURCES).
- QMAKE_EXT_OBJ changes the suffix used on generated object files.
All of the above accept just the first value, so you must assign to it just one value that will be used throughout your project file. There are two variables that accept a list of values:
- QMAKE_EXT_CPP causes qmake to interpret all files with these suffixes as C++ source files.
- QMAKE_EXT_H causes qmake to interpret all files with these suffixes as C and C++ header files.
qmake 3.1(Qt 5.14.0使用)用户手册9——配置qmake