diff options
Diffstat (limited to 'qmake/generators/win32')
-rw-r--r-- | qmake/generators/win32/mingw_make.cpp | 12 | ||||
-rw-r--r-- | qmake/generators/win32/mingw_make.h | 1 | ||||
-rw-r--r-- | qmake/generators/win32/msvc_nmake.cpp | 2 | ||||
-rw-r--r-- | qmake/generators/win32/winmakefile.cpp | 2 |
4 files changed, 15 insertions, 2 deletions
diff --git a/qmake/generators/win32/mingw_make.cpp b/qmake/generators/win32/mingw_make.cpp index 97bfef88a4..1837c6c0cf 100644 --- a/qmake/generators/win32/mingw_make.cpp +++ b/qmake/generators/win32/mingw_make.cpp @@ -112,6 +112,18 @@ bool MingwMakefileGenerator::writeMakefile(QTextStream &t) return false; } +QString MingwMakefileGenerator::installRoot() const +{ + /* + We include a magic prefix on the path to bypass mingw-make's "helpful" + intervention in the environment, recognising variables that look like + paths and adding the msys system root as prefix, which we don't want. + Once this hack has smuggled INSTALL_ROOT into make's variable space, we + can trivially strip the magic prefix back off to get the path we meant. + */ + return QStringLiteral("$(INSTALL_ROOT:@msyshack@%=%)"); +} + void createLdObjectScriptFile(const QString &fileName, const ProStringList &objList) { QString filePath = Option::output_dir + QDir::separator() + fileName; diff --git a/qmake/generators/win32/mingw_make.h b/qmake/generators/win32/mingw_make.h index 4e94a23ae2..1525f04955 100644 --- a/qmake/generators/win32/mingw_make.h +++ b/qmake/generators/win32/mingw_make.h @@ -50,6 +50,7 @@ protected: virtual QString getManifestFileForRcFile() const; bool writeMakefile(QTextStream &); void init(); + virtual QString installRoot() const; private: void writeMingwParts(QTextStream &); void writeIncPart(QTextStream &t); diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 7499d76e75..27427db68b 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -268,7 +268,7 @@ QString NmakeMakefileGenerator::defaultInstall(const QString &t) QString ret = Win32MakefileGenerator::defaultInstall(t); - const QString root = "$(INSTALL_ROOT)"; + const QString root = installRoot(); ProStringList &uninst = project->values(ProKey(t + ".uninstall")); QString targetdir = fileFixify(project->first(ProKey(t + ".path")).toQString(), FileFixifyAbsolute); if(targetdir.right(1) != Option::dir_sep) diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index 1fba7057ab..a042cb0d4b 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -689,7 +689,7 @@ QString Win32MakefileGenerator::defaultInstall(const QString &t) project->first("TEMPLATE") == "subdirs" || project->first("TEMPLATE") == "aux") return QString(); - const QString root = "$(INSTALL_ROOT)"; + const QString root = installRoot(); ProStringList &uninst = project->values(ProKey(t + ".uninstall")); QString ret; QString targetdir = fileFixify(project->first(ProKey(t + ".path")).toQString(), FileFixifyAbsolute); |