diff --git a/Source/QtDialog/QCMake.cxx b/Source/QtDialog/QCMake.cxx index 8d63f6d4b6..9a874166ec 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 + // 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(this->SourceDirectory.toStdString()); + this->CMakeInstance->SetHomeDirectory(sanitizePath(this->SourceDirectory)); this->CMakeInstance->SetHomeOutputDirectory( - this->BinaryDirectory.toStdString()); + sanitizePath(this->BinaryDirectory)); this->CMakeInstance->SetGlobalGenerator( this->CMakeInstance->CreateGlobalGenerator( this->Generator.toStdString()));