summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2012-12-06 16:29:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-12-10 10:17:25 +0100
commitf9ebe26aaedf07421f62e7ac47a944c21b3a7f28 (patch)
tree7b9c4e5ee619c8a8e01d5aedb8829ea5f1d08ee7 /qmake
parente23e22449891b7957a693bfd14a42677a95cef32 (diff)
support include paths for the Windows resource compiler
In RC_INCLUDEPATH one can add include paths for the Windows resource compiler. Task-number: QTBUG-13776 Change-Id: If1d9ed44097adb7789df03e4ccd4e3b7df9e8d08 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/generators/win32/mingw_make.cpp17
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp11
-rw-r--r--qmake/generators/win32/winmakefile.cpp14
3 files changed, 37 insertions, 5 deletions
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp
index 234817bcba..1665e23f40 100644
--- a/qmake/generators/win32/mingw_make.cpp
+++ b/qmake/generators/win32/mingw_make.cpp
@@ -416,14 +416,23 @@ void MingwMakefileGenerator::writeRcFilePart(QTextStream &t)
{
const QString rc_file = fileFixify(project->first("RC_FILE").toQString());
- QString incPathStr = fileInfo(rc_file).path();
- if (incPathStr != "." && QDir::isRelativePath(incPathStr))
- incPathStr.prepend("./");
+ ProStringList rcIncPaths = project->values("RC_INCLUDEPATH");
+ rcIncPaths.prepend(fileInfo(rc_file).path());
+ QString incPathStr;
+ for (int i = 0; i < rcIncPaths.count(); ++i) {
+ const ProString &path = rcIncPaths.at(i);
+ if (path.isEmpty())
+ continue;
+ incPathStr += QStringLiteral(" --include-dir=");
+ if (path != "." && QDir::isRelativePath(path.toQString()))
+ incPathStr += "./";
+ incPathStr += escapeFilePath(path);
+ }
if (!rc_file.isEmpty()) {
t << escapeDependencyPath(var("RES_FILE")) << ": " << rc_file << "\n\t"
<< var("QMAKE_RC") << " -i " << rc_file << " -o " << var("RES_FILE")
- << " --include-dir=" << incPathStr << " $(DEFINES)" << endl << endl;
+ << incPathStr << " $(DEFINES)" << endl << endl;
}
}
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 1e3f66a9c0..9f14b61f49 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -1072,6 +1072,17 @@ void VcprojGenerator::initResourceTool()
VCConfiguration &conf = vcProject.Configuration;
conf.resource.PreprocessorDefinitions = conf.compiler.PreprocessorDefinitions;
+ foreach (const ProString &path, project->values("RC_INCLUDEPATH")) {
+ QString fixedPath = fileFixify(path.toQString());
+ if (fileInfo(fixedPath).isRelative()) {
+ if (fixedPath == QStringLiteral("."))
+ fixedPath = QStringLiteral("$(ProjectDir)");
+ else
+ fixedPath.prepend(QStringLiteral("$(ProjectDir)\\"));
+ }
+ conf.resource.AdditionalIncludeDirectories << escapeFilePath(fixedPath);
+ }
+
// We need to add _DEBUG for the debug version of the project, since the normal compiler defines
// do not contain it. (The compiler defines this symbol automatically, which is wy we don't need
// to add it for the compiler) However, the resource tool does not do this.
diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp
index fcc9ceb5aa..fc98c3ddd1 100644
--- a/qmake/generators/win32/winmakefile.cpp
+++ b/qmake/generators/win32/winmakefile.cpp
@@ -783,8 +783,20 @@ void Win32MakefileGenerator::writeRcFilePart(QTextStream &t)
// use these defines in the .rc file itself. Also, we need to add the _DEBUG define manually
// since the compiler defines this symbol by itself, and we use it in the automatically
// created rc file when VERSION is define the .pro file.
+
+ const ProStringList rcIncPaths = project->values("RC_INCLUDEPATH");
+ QString incPathStr;
+ for (int i = 0; i < rcIncPaths.count(); ++i) {
+ const ProString &path = rcIncPaths.at(i);
+ if (path.isEmpty())
+ continue;
+ incPathStr += QStringLiteral(" /i ");
+ incPathStr += escapeFilePath(path);
+ }
+
t << res_file << ": " << rc_file << "\n\t"
- << var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "") << " $(DEFINES) -fo " << res_file << " " << rc_file;
+ << var("QMAKE_RC") << (project->isActiveConfig("debug") ? " -D_DEBUG" : "")
+ << " $(DEFINES)" << incPathStr << " -fo " << res_file << " " << rc_file;
t << endl << endl;
}
}