NotePublic/Software/Development/Environment/Qt/QMake/QMake_Pro_文件说明.md

1.5 KiB
Raw Blame History

QMake Pro 文件说明

1.宏/变量

  • DEFINESqmake adds the values of this variable as compiler C preprocessor macros (-D option).
  • DEPENDPATHSpecifies a list of directories for qmake to scan, to resolve dependencies.
  • HEADERSDefines the header files for the project.
  • INCLUDEPATHSpecifies the #include directories which should be searched when compiling the project.
  • LIBSSpecifies a list of libraries to be linked into the project.
  • OUT_PWDSpecifies the full path leading to the directory where qmake places the generated Makefile.
  • PWDSpecifies the full path leading to the directory containing the current file being parsed.
  • QMAKE_RPATHDIR(Unix only)Specifies a list of library paths that are added to the executable at link time so that the paths will be preferentially searched at runtime.
  • QTSpecifies the Qt modules that are used by your project.
  • SOURCESSpecifies the names of all source files in the project.
  • TARGETSpecifies the name of the target file. Contains the base name of the project file by default.
  • TEMPLATESpecifies the name of the template to use when generating the project.

2.条件语句

2.1.区分系统平台

win32:CONFIG(release, debug|release): LIBS += -L$$OUT_PWD/../tlb/release/ -ltlb
else:win32:CONFIG(debug, debug|release): LIBS += -L$$OUT_PWD/../tlb/debug/ -ltlb
else:unix: LIBS += -L$$OUT_PWD/../tlb/ -ltlb

2.2.判断预定义宏

if(contains(DEFINES, MY_DEFINE)){
}

3. QMake 命令

qmake CONFIG+=debug