diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2013-06-18 15:11:11 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-06-26 05:53:41 +0200 |
commit | e9d539623aa97b307a0d5d7cd10dbdf392e9b92f (patch) | |
tree | 22b3d8fd5301df6fd3dc03dbfbf66abd6ff029f5 | |
parent | fb6d46131ffc65271684ca39af3ec49d34e6725a (diff) |
introduce "secret" configure -top-level option
shifts the makefile generation one directory level up.
this allows the top-level configure to leave the makefile creation
entirely to the qtbase configure.
this is not very clean modularization-wise, but consistent with -skip.
Change-Id: I7ee2d2f29f2e6619d61fe9b55faa0bacdf3c44c1
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
-rwxr-xr-x | configure | 20 | ||||
-rw-r--r-- | tools/configure/configureapp.cpp | 15 |
2 files changed, 31 insertions, 4 deletions
@@ -61,6 +61,13 @@ if [ -f "$LICENSE_FILE" ]; then diff "${LICENSE_FILE}.tmp" "${LICENSE_FILE}" >/dev/null 2>&1 || LICENSE_FILE="${LICENSE_FILE}.tmp" fi +# do this early so we don't store it in config.status +CFG_TOPLEVEL= +if [ x"$1" = x"-top-level" ]; then + CFG_TOPLEVEL=yes + shift +fi + # later cache the command line in config.status OPT_CMDLINE=`echo $@ | sed "s,-v ,,g; s,-v$,,g"` @@ -6910,14 +6917,23 @@ rm -f "$QMAKE_VARS_FILE" 2>/dev/null #------------------------------------------------------------------------------- if [ "$CFG_PROCESS" != "no" ]; then +( # fork to make the cd stay local + + relpathMangled=$relpath + if [ -n "$CFG_TOPLEVEL" ]; then + relpathMangled=`dirname "$relpath"` + cd .. + fi if [ "$CFG_PROCESS" = "full" ]; then echo "Creating makefiles. Please wait..." - "$outpath/bin/qmake" -r "$relpath" + "$outpath/bin/qmake" -r "$relpathMangled" echo "Done" else - "$outpath/bin/qmake" "$relpath" + "$outpath/bin/qmake" "$relpathMangled" fi + +) fi #------------------------------------------------------------------------------- diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index fbf0de4dce..73ef0dcf23 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -389,6 +389,11 @@ QString Configure::firstLicensePath() void Configure::parseCmdLine() { + if (configCmdLine.size() && configCmdLine.at(0) == "-top-level") { + dictionary[ "TOPLEVEL" ] = "yes"; + configCmdLine.removeAt(0); + } + int argCount = configCmdLine.size(); int i = 0; const QStringList imageFormats = QStringList() << "gif" << "png" << "jpeg"; @@ -3958,6 +3963,12 @@ 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(); + } bool generate = true; bool doDsp = (dictionary["VCPROJFILES"] == "yes" && dictionary["PROCESS"] == "full"); @@ -3977,9 +3988,9 @@ void Configure::generateMakefiles() } if (dictionary[ "PROCESS" ] == "full") args << "-r"; - args << sourcePath; + args << sourcePathMangled; - QDir::setCurrent(buildPath); + QDir::setCurrent(buildPathMangled); if (int exitCode = Environment::execute(args, QStringList(), QStringList())) { cout << "Qmake failed, return code " << exitCode << endl << endl; dictionary[ "DONE" ] = "error"; |