diff options
author | Mark Brand <mabrand@mabrand.nl> | 2012-06-29 21:26:11 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-06-29 21:26:11 +0200 |
commit | f4f0c8b99b362822f85dd1859518e89d33e4bd3b (patch) | |
tree | 1de8f74ce9dc211668b8a10f4f873457fcb74363 /tools/configure/configureapp.cpp | |
parent | ddf7233125dbf7dfb218fd47f77a94446ce3c027 (diff) | |
parent | 1491065506eb97c9def93b908db1df9fcdf3fff0 (diff) |
Merge "Merge branch 'buildsystem' (second round)" into refs/staging/master
Diffstat (limited to 'tools/configure/configureapp.cpp')
-rw-r--r-- | tools/configure/configureapp.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index bcb597d72f..fb666e221e 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -3011,7 +3011,7 @@ QString Configure::addDefine(QString def) #if !defined(EVAL) bool Configure::copySpec(const char *name, const char *pfx, const QString &spec) { - // Copy configured mkspec to default directory, but remove the old one first, if there is any + // "Link" configured mkspec to default directory, but remove the old one first, if there is any QString defSpec = buildPath + "/mkspecs/" + name; QFileInfo defSpecInfo(defSpec); if (defSpecInfo.exists()) { @@ -3022,10 +3022,18 @@ bool Configure::copySpec(const char *name, const char *pfx, const QString &spec) } } - QString pltSpec = sourcePath + "/mkspecs/" + spec; - QString includeSpec = buildPath + "/mkspecs/" + spec; - if (!Environment::cpdir(pltSpec, defSpec, includeSpec)) { - cout << "Couldn't update default " << pfx << "mkspec! Does " << qPrintable(pltSpec) << " exist?" << endl; + QDir::current().mkpath(defSpec); + QFile qfile(defSpec + "/qmake.conf"); + if (qfile.open(QFile::WriteOnly | QFile::Text)) { + QTextStream fileStream; + fileStream.setDevice(&qfile); + QString srcSpec = buildPath + "/mkspecs/" + spec; // We copied it to the build dir + fileStream << "QMAKESPEC_ORIGINAL = " << formatPath(srcSpec) << endl; + fileStream << "include(" << formatPath(QDir(defSpec).relativeFilePath(srcSpec + "/qmake.conf")) << ")" << endl; + qfile.close(); + } + if (qfile.error() != QFile::NoError) { + cout << "Couldn't update default " << pfx << "mkspec: " << qPrintable(qfile.errorString()) << endl; dictionary["DONE"] = "error"; return false; } |