summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-06-04 12:57:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-06-04 12:57:42 (GMT)
commitd913a22f26b9e527f748d39334a9c435a3146714 (patch)
treedcfb3dfae9604386ebc743007f95929ca963b5c3 /Source
parente449ae8492a3b35cd37f956d28fba08fb3a20f4c (diff)
parentafa1d0d0e355cf4bbe246d86b612a2bc56c7385d (diff)
downloadCMake-d913a22f26b9e527f748d39334a9c435a3146714.zip
CMake-d913a22f26b9e527f748d39334a9c435a3146714.tar.gz
CMake-d913a22f26b9e527f748d39334a9c435a3146714.tar.bz2
Merge topic 'gui-trailing-slash-on-dirs'
afa1d0d0e3 CMakeGUI: Sanitize source and build dirs the same as command line Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !9573
Diffstat (limited to 'Source')
-rw-r--r--Source/QtDialog/QCMake.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx
index 8d63f6d..9a87416 100644
--- a/Source/QtDialog/QCMake.cxx
+++ b/Source/QtDialog/QCMake.cxx
@@ -238,10 +238,16 @@ void QCMake::configure()
#ifdef Q_OS_WIN
UINT lastErrorMode = SetErrorMode(0);
#endif
-
- this->CMakeInstance->SetHomeDirectory(this->SourceDirectory.toStdString());
+ // Apply the same transformations that the command-line invocation does
+ auto sanitizePath = [](QString const& value) -> std::string {
+ std::string path = cmSystemTools::CollapseFullPath(value.toStdString());
+ cmSystemTools::ConvertToUnixSlashes(path);
+ return path;
+ };
+
+ this->CMakeInstance->SetHomeDirectory(sanitizePath(this->SourceDirectory));
this->CMakeInstance->SetHomeOutputDirectory(
- this->BinaryDirectory.toStdString());
+ sanitizePath(this->BinaryDirectory));
this->CMakeInstance->SetGlobalGenerator(
this->CMakeInstance->CreateGlobalGenerator(
this->Generator.toStdString()));