diff options
author | hjk <hjk@qt.io> | 2021-08-25 12:09:10 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2021-08-25 12:34:55 +0000 |
commit | ca735829b4932b04337a2dc1ebcf80efd222bed5 (patch) | |
tree | 9c99d6a9f16a888d6b97959c42e6a9801a267b49 /src/plugins | |
parent | 48b4af21aad6fd51580be37bee05b9b3b15bdf33 (diff) | |
download | qt-creator-ca735829b4932b04337a2dc1ebcf80efd222bed5.tar.gz |
CMake: Bark about missing build directory
Also, bail out earlier and more directly.
Amends e54c63af5e
Change-Id: Id5a530b3d6f7548a2f786f3400454253c719acce
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeprocess.cpp | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 0cc2638066..e9baa731f6 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -78,7 +78,24 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & QTC_ASSERT(parameters.isValid() && cmake, return); const FilePath buildDirectory = parameters.buildDirectory; - QTC_ASSERT(buildDirectory.exists(), return); + if (!buildDirectory.exists()) { + QString msg = tr("The build directory \"%1\" does not exist") + .arg(buildDirectory.toUserOutput()); + BuildSystem::appendBuildSystemOutput(msg + '\n'); + emit finished(); + return; + } + + if (buildDirectory.needsDevice()) { + if (cmake->cmakeExecutable().host() != buildDirectory.host()) { + QString msg = tr("CMake executable \"%1\" and build directory " + "\"%2\" must be on the same device.") + .arg(cmake->cmakeExecutable().toUserOutput(), buildDirectory.toUserOutput()); + BuildSystem::appendBuildSystemOutput(msg + '\n'); + emit finished(); + return; + } + } const QString srcDir = parameters.sourceDirectory.path(); @@ -109,13 +126,6 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & connect(process.get(), &QtcProcess::finished, this, &CMakeProcess::handleProcessFinished); - if (buildDirectory.needsDevice()) { - if (cmake->cmakeExecutable().host() != buildDirectory.host()) { - m_parser.appendMessage(tr("CMake executable and build dir must be on the same device."), StdErrFormat); - reportCanceled(); - return; - } - } CommandLine commandLine(cmake->cmakeExecutable(), QStringList({"-S", srcDir, "-B", buildDirectory.path()}) + arguments); TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM); |