From e9c494005c3a819813aa21c33eca52ad73f01bc7 Mon Sep 17 00:00:00 2001 From: Juan Ramos Date: Wed, 5 Mar 2025 15:21:42 -0800 Subject: [PATCH] cmake-gui: Fix regression that prints an incidental error on fresh build trees Since commit a872844908 (cmake-gui: Handle relative paths in the build directory text input, 2024-04-24, v3.30.0-rc1~5^2), `cmake-gui` gave an incidental error message even when a valid build directory was being passed. Fix this by checking for a non-empty path before using it. Fixes: #26744 --- Source/QtDialog/QCMake.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 45c47171be..dec0c99a9d 100644 --- a/Source/QtDialog/QCMake.cxx +++ b/Source/QtDialog/QCMake.cxx @@ -94,7 +94,8 @@ void QCMake::setSourceDirectory(const QString& _dir) emit this->sourceDirChanged(this->SourceDirectory); this->loadPresets(); this->setPreset(QString{}); - if (!cmSystemTools::FileIsFullPath( + if (!this->MaybeRelativeBinaryDirectory.isEmpty() && + !cmSystemTools::FileIsFullPath( this->MaybeRelativeBinaryDirectory.toStdString())) { this->setBinaryDirectory(this->MaybeRelativeBinaryDirectory); }