CMake: Show build directory when asking if it should be used

When changing the build directory to a new or empty directory, we ask if
the build directory should be changed and the project be configured
there. Mention the new directory in the dialog.

Change-Id: Ie4d7e9b132e6e90004e4d498b2182562375e7441
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2021-06-24 13:23:36 +02:00
parent c6a4cd293b
commit 8f30ff6987

View File

@@ -852,10 +852,12 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
return newDir; return newDir;
if (QDir(oldDir).exists("CMakeCache.txt") && !QDir(newDir).exists("CMakeCache.txt")) { if (QDir(oldDir).exists("CMakeCache.txt") && !QDir(newDir).exists("CMakeCache.txt")) {
if (QMessageBox::information(Core::ICore::dialogParent(), if (QMessageBox::information(
Core::ICore::dialogParent(),
tr("Changing Build Directory"), tr("Changing Build Directory"),
tr("Change the build directory and start with a " tr("Change the build directory to \"%1\" and start with a "
"basic CMake configuration?"), "basic CMake configuration?")
.arg(newDir),
QMessageBox::Ok, QMessageBox::Ok,
QMessageBox::Cancel) QMessageBox::Cancel)
== QMessageBox::Ok) { == QMessageBox::Ok) {