aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-05-19 16:05:20 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2017-05-20 10:50:36 +0000
commit00a1cf03c3428a0687faca642f343df4257ffc1b (patch)
tree4550fd7c003cbfbec20e881d6d7121dcb27b2f9e /src
parentbc360d7daf36d759a5f271b5c4fe24f4a4996c2f (diff)
When setting the build root, create the directory along the way
... if necessary. Otherwise it makes no sense trying to get the canonical file path. Change-Id: I5a9c4237a8e4081c338ace685f20debb02f848fd Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/lib/corelib/tools/setupprojectparameters.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/corelib/tools/setupprojectparameters.cpp b/src/lib/corelib/tools/setupprojectparameters.cpp
index 10cdca181..db7b11118 100644
--- a/src/lib/corelib/tools/setupprojectparameters.cpp
+++ b/src/lib/corelib/tools/setupprojectparameters.cpp
@@ -45,6 +45,7 @@
#include <tools/scripttools.h>
#include <tools/settings.h>
+#include <QtCore/qdir.h>
#include <QtCore/qfileinfo.h>
namespace qbs {
@@ -195,6 +196,11 @@ void SetupProjectParameters::setBuildRoot(const QString &buildRoot)
{
d->buildRoot = buildRoot;
+ // We don't do error checking here, as this is not a convenient place to report an error.
+ // If creation of the build directory is not possible, we will get sensible error messages
+ // later, e.g. from the code that attempts to store the build graph.
+ QDir::root().mkpath(buildRoot);
+
const QString canonicalBuildRoot = QFileInfo(d->buildRoot).canonicalFilePath();
if (!canonicalBuildRoot.isEmpty())
d->buildRoot = canonicalBuildRoot;