diff options
author | Brad King <brad.king@kitware.com> | 2024-06-04 12:57:34 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-06-04 12:57:42 (GMT) |
commit | d913a22f26b9e527f748d39334a9c435a3146714 (patch) | |
tree | dcfb3dfae9604386ebc743007f95929ca963b5c3 /Source | |
parent | e449ae8492a3b35cd37f956d28fba08fb3a20f4c (diff) | |
parent | afa1d0d0e355cf4bbe246d86b612a2bc56c7385d (diff) | |
download | CMake-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.cxx | 12 |
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())); |