diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-03-09 10:50:23 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-09 14:23:15 +0100 |
commit | 46e51ce1dd17aedc34acbf5e80f824025877afaf (patch) | |
tree | 735f3dc0228142fb7f37ed8cbe5bdf91dcdffdda /tools | |
parent | 38224d8d009a0f35e4316a035636c2c2b929c524 (diff) | |
download | qtbase-46e51ce1dd17aedc34acbf5e80f824025877afaf.tar.gz |
do not copy/symlink qmake to build dir
make is perfectly capable of doing shadow builds
Change-Id: I7e1c27cddc385b7a17ae5645b9cd26fa56d2f029
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/configure/configureapp.cpp | 51 |
1 files changed, 10 insertions, 41 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index dea7415d43..62ec3e8d8c 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -142,46 +142,6 @@ Configure::Configure(int& argc, char** argv) cout << "Preparing build tree..." << endl; QDir(buildPath).mkpath("bin"); - { //duplicate qmake - QStack<QString> qmake_dirs; - qmake_dirs.push("qmake"); - while (!qmake_dirs.isEmpty()) { - QString dir = qmake_dirs.pop(); - QString od(buildPath + "/" + dir); - QString id(sourcePath + "/" + dir); - QFileInfoList entries = QDir(id).entryInfoList(QDir::NoDotAndDotDot|QDir::AllEntries); - for (int i = 0; i < entries.size(); ++i) { - QFileInfo fi(entries.at(i)); - if (fi.isDir()) { - qmake_dirs.push(dir + "/" + fi.fileName()); - QDir().mkpath(od + "/" + fi.fileName()); - } else { - QDir().mkpath(od); - bool justCopy = true; - const QString fname = fi.fileName(); - const QString outFile(od + "/" + fname), inFile(id + "/" + fname); - if (fi.fileName() == "Makefile") { //ignore - } else if (fi.suffix() == "h" || fi.suffix() == "cpp") { - QTemporaryFile tmpFile; - if (tmpFile.open()) { - QTextStream stream(&tmpFile); - stream << "#include \"" << inFile << "\"" << endl; - justCopy = false; - stream.flush(); - tmpFile.flush(); - if (filesDiffer(tmpFile.fileName(), outFile)) { - QFile::remove(outFile); - tmpFile.copy(outFile); - } - } - } - if (justCopy && filesDiffer(inFile, outFile)) - QFile::copy(inFile, outFile); - } - } - } - } - { //make a syncqt script(s) that can be used in the shadow QFile syncqt(buildPath + "/bin/syncqt"); if (syncqt.open(QFile::WriteOnly)) { @@ -3145,7 +3105,16 @@ void Configure::buildQmake() // Build qmake QString pwd = QDir::currentPath(); - QDir::setCurrent(buildPath + "/qmake"); + if (!QDir(buildPath).mkpath("qmake")) { + cout << "Cannot create qmake build dir." << endl; + dictionary[ "DONE" ] = "error"; + return; + } + if (!QDir::setCurrent(buildPath + "/qmake")) { + cout << "Cannot enter qmake build dir." << endl; + dictionary[ "DONE" ] = "error"; + return; + } QString makefile = "Makefile"; { |