summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
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;
}
}