summaryrefslogtreecommitdiffstats
path: root/qmake/generators/win32
diff options
context:
space:
mode:
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp10
-rw-r--r--qmake/generators/win32/winmakefile.cpp21
-rw-r--r--qmake/generators/win32/winmakefile.h1
3 files changed, 21 insertions, 11 deletions
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index d899c707d4..9f5abfb307 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -366,16 +366,6 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t)
}
-static QString cQuoted(const QString &str)
-{
- QString ret = str;
- ret.replace(QLatin1Char('"'), QStringLiteral("\\\""));
- ret.replace(QLatin1Char('\\'), QStringLiteral("\\\\"));
- ret.prepend(QLatin1Char('"'));
- ret.append(QLatin1Char('"'));
- return ret;
-}
-
void NmakeMakefileGenerator::writeBuildRulesPart(QTextStream &t)
{
const ProString templateName = project->first("TEMPLATE");
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index bda035e023..fa1d719a8a 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -382,7 +382,7 @@ void Win32MakefileGenerator::processRcFileVar()
if (Option::qmake_mode == Option::QMAKE_GENERATE_NOTHING)
return;
- if (((!project->values("VERSION").isEmpty())
+ if (((!project->values("VERSION").isEmpty() || !project->values("RC_ICONS").isEmpty())
&& project->values("RC_FILE").isEmpty()
&& project->values("RES_FILE").isEmpty()
&& !project->isActiveConfig("no_generated_target_info")
@@ -397,6 +397,10 @@ void Win32MakefileGenerator::processRcFileVar()
vers += "0";
QString versionString = vers.join('.');
+ QStringList rcIcons;
+ foreach (const ProString &icon, project->values("RC_ICONS"))
+ rcIcons.append(fileFixify(icon.toQString(), FileFixifyAbsolute));
+
QString companyName;
if (!project->values("QMAKE_TARGET_COMPANY").isEmpty())
companyName = project->values("QMAKE_TARGET_COMPANY").join(' ');
@@ -425,6 +429,11 @@ void Win32MakefileGenerator::processRcFileVar()
ts << "# include <winver.h>" << endl;
ts << "# endif" << endl;
ts << endl;
+ if (!rcIcons.isEmpty()) {
+ for (int i = 0; i < rcIcons.size(); ++i)
+ ts << QString("IDI_ICON%1\tICON\tDISCARDABLE\t%2").arg(i + 1).arg(cQuoted(rcIcons[i])) << endl;
+ ts << endl;
+ }
ts << "VS_VERSION_INFO VERSIONINFO" << endl;
ts << "\tFILEVERSION " << QString(versionString).replace(".", ",") << endl;
ts << "\tPRODUCTVERSION " << QString(versionString).replace(".", ",") << endl;
@@ -902,4 +911,14 @@ QString Win32MakefileGenerator::escapeFilePath(const QString &path) const
return ret;
}
+QString Win32MakefileGenerator::cQuoted(const QString &str)
+{
+ QString ret = str;
+ ret.replace(QLatin1Char('"'), QStringLiteral("\\\""));
+ ret.replace(QLatin1Char('\\'), QStringLiteral("\\\\"));
+ ret.prepend(QLatin1Char('"'));
+ ret.append(QLatin1Char('"'));
+ return ret;
+}
+
QT_END_NAMESPACE
diff --git a/qmake/generators/win32/winmakefile.h b/qmake/generators/win32/winmakefile.h
index 8d4bcbcd69..ec68828750 100644
--- a/qmake/generators/win32/winmakefile.h
+++ b/qmake/generators/win32/winmakefile.h
@@ -73,6 +73,7 @@ protected:
void fixTargetExt();
void processRcFileVar();
virtual QString getLibTarget();
+ static QString cQuoted(const QString &str);
};
inline Win32MakefileGenerator::~Win32MakefileGenerator()