diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-08-23 20:03:50 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-08-25 11:57:45 +0000 |
commit | 1967fc7f63b7b3884667f96507d159be1b23a825 (patch) | |
tree | fd3aa11bd0ca73d849371dfb464f06025806daaa /tools/configure | |
parent | d76a756b03840ef9339ecc30f16e8580c7f323ea (diff) |
fix location of config.{opt,status} in top-level builds
write them to the top-level build dir, not the qtbase build dir.
the old files will be still used for a smooth migration.
Task-number: QTBUG-46974
Change-Id: I6eae678ffc7dfb921ecd9e9012e79e3b915ad3fa
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/configureapp.cpp | 23 | ||||
-rw-r--r-- | tools/configure/configureapp.h | 1 |
2 files changed, 13 insertions, 11 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 650ede7474..467af0e021 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -184,9 +184,13 @@ QString Configure::formatPath(const QString &path) void Configure::parseCmdLine() { + sourcePathMangled = sourcePath; + buildPathMangled = buildPath; if (configCmdLine.size() && configCmdLine.at(0) == "-top-level") { dictionary[ "TOPLEVEL" ] = "yes"; configCmdLine.removeAt(0); + sourcePathMangled = QFileInfo(sourcePath).path(); + buildPathMangled = QFileInfo(buildPath).path(); } int argCount = configCmdLine.size(); @@ -1025,12 +1029,6 @@ void Configure::generateMakefiles() { QString pwd = QDir::currentPath(); { - QString sourcePathMangled = sourcePath; - QString buildPathMangled = buildPath; - if (dictionary.contains("TOPLEVEL")) { - sourcePathMangled = QFileInfo(sourcePath).path(); - buildPathMangled = QFileInfo(buildPath).path(); - } QStringList args; args << buildPath + "/bin/qmake" << sourcePathMangled; @@ -1180,11 +1178,14 @@ void Configure::readLicense() void Configure::reloadCmdLine(int idx) { if (dictionary[ "REDO" ] == "yes") { - QFile inFile(buildPath + "/config.opt"); + QFile inFile(buildPathMangled + "/config.opt"); if (!inFile.open(QFile::ReadOnly)) { - inFile.setFileName(buildPath + "/configure.cache"); - if (!inFile.open(QFile::ReadOnly)) - return; + inFile.setFileName(buildPath + "/config.opt"); + if (!inFile.open(QFile::ReadOnly)) { + inFile.setFileName(buildPath + "/configure.cache"); + if (!inFile.open(QFile::ReadOnly)) + return; + } } QTextStream inStream(&inFile); while (!inStream.atEnd()) @@ -1195,7 +1196,7 @@ void Configure::reloadCmdLine(int idx) void Configure::saveCmdLine() { if (dictionary[ "REDO" ] != "yes") { - QFile outFile(buildPath + "/config.opt"); + QFile outFile(buildPathMangled + "/config.opt"); if (outFile.open(QFile::WriteOnly | QFile::Text)) { QTextStream outStream(&outFile); for (QStringList::Iterator it = configCmdLine.begin(); it != configCmdLine.end(); ++it) { diff --git a/tools/configure/configureapp.h b/tools/configure/configureapp.h index 249080b288..da7d8885ce 100644 --- a/tools/configure/configureapp.h +++ b/tools/configure/configureapp.h @@ -75,6 +75,7 @@ private: QTextStream outStream; QString sourcePath, buildPath; + QString sourcePathMangled, buildPathMangled; QDir sourceDir, buildDir; QString confStrOffsets[2]; |