From f58663ce1ce1170837c7d5c780072195f357622c Mon Sep 17 00:00:00 2001 From: hjk Date: Tue, 12 Oct 2021 13:51:44 +0200 Subject: [PATCH] CMake: Use FilePath::mapToDevicePath for construction cmake line Change-Id: I178803f39b5fa7707c1e4338ff02b9de18b22858 Reviewed-by: David Schulz --- src/plugins/cmakeprojectmanager/cmakeprocess.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp index 64e59109ddf..d8f24b43623 100644 --- a/src/plugins/cmakeprojectmanager/cmakeprocess.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeprocess.cpp @@ -92,10 +92,8 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & } } - const QString srcDir = parameters.sourceDirectory.path(); - const auto parser = new CMakeParser; - parser->setSourceDirectory(srcDir); + parser->setSourceDirectory(parameters.sourceDirectory.path()); m_parser.addLineParser(parser); // Always use the sourceDir: If we are triggered because the build directory is getting deleted @@ -121,7 +119,13 @@ void CMakeProcess::run(const BuildDirParameters ¶meters, const QStringList & connect(process.get(), &QtcProcess::finished, this, &CMakeProcess::handleProcessFinished); - CommandLine commandLine(cmake->cmakeExecutable(), QStringList({"-S", srcDir, "-B", buildDirectory.path()}) + arguments); + const FilePath cmakeExecutable = cmake->cmakeExecutable(); + const FilePath sourceDirectory = parameters.sourceDirectory.onDevice(cmakeExecutable); + + CommandLine commandLine(cmakeExecutable); + commandLine.addArgs({"-S", sourceDirectory.mapToDevicePath(), + "-B", buildDirectory.mapToDevicePath()}); + commandLine.addArgs(arguments); TaskHub::clearTasks(ProjectExplorer::Constants::TASK_CATEGORY_BUILDSYSTEM);