From 317383217baa280b7e7401a5adc4ce976320e272 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Mon, 4 May 2020 15:09:16 +0800 Subject: Add more entries for QMAKE_TARGET_XXX Change-Id: I1cf4a8f19ec47247fbe469b9cc81ed80f6ba5a82 Reviewed-by: Alexandru Croitor --- qmake/doc/src/qmake-manual.qdoc | 40 ++++++++++++++++++++++++++++++++-- qmake/generators/win32/winmakefile.cpp | 22 ++++++++++++++++++- 2 files changed, 59 insertions(+), 3 deletions(-) (limited to 'qmake') diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 574722d08a..bf496e38f5 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -794,8 +794,10 @@ and \l{RC_ICONS}. The generated .rc file is automatically compiled and linked. Elements that are added to the .rc file are defined by the system variables \l{QMAKE_TARGET_COMPANY}, \l{QMAKE_TARGET_DESCRIPTION}, - \l{QMAKE_TARGET_COPYRIGHT}, \l{QMAKE_TARGET_PRODUCT}, \l{RC_CODEPAGE}, - \l{RC_ICONS}, \l{RC_LANG},and \l{VERSION}. + \l{QMAKE_TARGET_COPYRIGHT}, \l{QMAKE_TARGET_PRODUCT}, + \l{QMAKE_TARGET_ORIGINAL_FILENAME}, \l{QMAKE_TARGET_INTERNALNAME}, + \l{QMAKE_TARGET_COMMENTS}, \l{QMAKE_TARGET_TRADEMARKS}, \l{RC_CODEPAGE}, + \l{RC_ICONS}, \l{RC_LANG} and \l{VERSION}. If these elements are not sufficient, qmake has the two system variables \l{RC_FILE} and \l{RES_FILE} that point directly to an externally created @@ -2748,6 +2750,40 @@ This is only utilized if the \l{VERSION} or \l{RC_ICONS} variable is set and the \l{RC_FILE} and \l{RES_FILE} variables are not set. + \target QMAKE_TARGET_ORIGINAL_FILENAME + \section1 QMAKE_TARGET_ORIGINAL_FILENAME + + Windows only. Specifies the original file name for the project target; + this is used where applicable for putting the original file name in the + application's properties. This is only utilized if the \l{VERSION} or + \l{RC_ICONS} variable is set and the \l{RC_FILE} and \l{RES_FILE} + variables are not set. + + \target QMAKE_TARGET_INTERNALNAME + \section1 QMAKE_TARGET_INTERNALNAME + + Windows only. Specifies the internal name for the project target; this is + used where applicable for putting the internal name in the application's + properties. This is only utilized if the \l{VERSION} or \l{RC_ICONS} + variable is set and the \l{RC_FILE} and \l{RES_FILE} variables are not set. + + \target QMAKE_TARGET_COMMENTS + \section1 QMAKE_TARGET_COMMENTS + + Windows only. Specifies the comments for the project target; this is + used where applicable for putting the comments in the application's + properties. This is only utilized if the \l{VERSION} or \l{RC_ICONS} + variable is set and the \l{RC_FILE} and \l{RES_FILE} variables are not set. + + \target QMAKE_TARGET_TRADEMARKS + \section1 QMAKE_TARGET_TRADEMARKS + + Windows only. Specifies the trademark information for the project target; + this is used where applicable for putting the trademark information in the + application's properties. This is only utilized if the \l{VERSION} or + \l{RC_ICONS} variable is set and the \l{RC_FILE} and \l{RES_FILE} variables + are not set. + \section1 QMAKE_TVOS_DEPLOYMENT_TARGET \note This variable is used on the tvOS platform only. diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 6cbd20c187..112ad1f739 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -341,7 +341,24 @@ void Win32MakefileGenerator::processRcFileVar() else productName = project->first("TARGET").toQString(); - QString originalName = project->first("TARGET") + project->first("TARGET_EXT"); + QString originalName; + if (!project->values("QMAKE_TARGET_ORIGINAL_FILENAME").isEmpty()) + originalName = project->values("QMAKE_TARGET_ORIGINAL_FILENAME").join(' '); + else + originalName = project->first("TARGET") + project->first("TARGET_EXT"); + + QString internalName; + if (!project->values("QMAKE_TARGET_INTERNALNAME").isEmpty()) + internalName = project->values("QMAKE_TARGET_INTERNALNAME").join(' '); + + QString comments; + if (!project->values("QMAKE_TARGET_COMMENTS").isEmpty()) + comments = project->values("QMAKE_TARGET_COMMENTS").join(' '); + + QString trademarks; + if (!project->values("QMAKE_TARGET_TRADEMARKS").isEmpty()) + trademarks = project->values("QMAKE_TARGET_TRADEMARKS").join(' '); + int rcLang = project->intValue("RC_LANG", 1033); // default: English(USA) int rcCodePage = project->intValue("RC_CODEPAGE", 1200); // default: Unicode @@ -389,6 +406,9 @@ void Win32MakefileGenerator::processRcFileVar() ts << "\t\t\t\tVALUE \"OriginalFilename\", \"" << originalName << "\\0\"\n"; ts << "\t\t\t\tVALUE \"ProductName\", \"" << productName << "\\0\"\n"; ts << "\t\t\t\tVALUE \"ProductVersion\", \"" << versionString << "\\0\"\n"; + ts << "\t\t\t\tVALUE \"InternalName\", \"" << internalName << "\\0\"\n"; + ts << "\t\t\t\tVALUE \"Comments\", \"" << comments << "\\0\"\n"; + ts << "\t\t\t\tVALUE \"LegalTrademarks\", \"" << trademarks << "\\0\"\n"; ts << "\t\t\tEND\n"; ts << "\t\tEND\n"; ts << "\t\tBLOCK \"VarFileInfo\"\n"; -- cgit v1.2.3