ProjectExplorer: Create BuildDirectory on device

The BuildDirectory is now assumed to be on the build device.

The default build directory template path is resolved against the
project path mapped to the build directory.

Change-Id: Ie1d147d135e9e551f2ac46cbec583374d524d2d7
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Marcus Tillmanns
2023-04-04 10:39:20 +02:00
parent 6977d28f55
commit ca0bee902f
6 changed files with 25 additions and 11 deletions

View File

@@ -701,7 +701,7 @@ void CMakeBuildSettingsWidget::updateConfigureDetailsWidgetsSummary(
const FilePath buildDirectory = bc ? bc->buildDirectory() : ".";
cmd.addArgs({"-S", m_buildSystem->projectDirectory().path()});
cmd.addArgs({"-B", cmd.executable().withNewMappedPath(buildDirectory).path()}); // FIXME: Just buildDirectory.path()
cmd.addArgs({"-B", buildDirectory.path()});
cmd.addArgs(configurationArguments);
params.setCommandLine(cmd);
@@ -1138,7 +1138,7 @@ static CommandLine defaultInitialCMakeCommand(const Kit *k, const QString buildT
// Package manager auto setup
if (Internal::CMakeSpecificSettings::instance()->packageManagerAutoSetup.value()) {
cmd.addArg(QString("-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH="
"%{buildDir}/%1/auto-setup.cmake")
"%{BuildConfig:BuildDirectory:NativeFilePath}/%1/auto-setup.cmake")
.arg(Constants::PACKAGE_MANAGER_DIR));
}

View File

@@ -383,7 +383,7 @@ CommandLine CMakeBuildStep::cmakeCommand() const
if (buildConfiguration())
buildDirectory = buildConfiguration()->buildDirectory();
cmd.addArgs({"--build", cmd.executable().withNewMappedPath(buildDirectory).path()});
cmd.addArgs({"--build", buildDirectory.path()});
cmd.addArg("--target");
cmd.addArgs(Utils::transform(m_buildTargets, [this](const QString &s) {

View File

@@ -1303,7 +1303,7 @@ MakeInstallCommand CMakeBuildSystem::makeInstallCommand(const FilePath &installR
buildDirectory = bc->buildDirectory();
cmd.command.addArg("--build");
cmd.command.addArg(cmd.command.executable().withNewMappedPath(buildDirectory).path());
cmd.command.addArg(buildDirectory.path());
cmd.command.addArg("--target");
cmd.command.addArg(installTarget);

View File

@@ -74,7 +74,7 @@ CommandLine CMakeInstallStep::cmakeCommand() const
if (buildConfiguration())
buildDirectory = buildConfiguration()->buildDirectory();
cmd.addArgs({"--install", cmd.executable().withNewMappedPath(buildDirectory).path()});
cmd.addArgs({"--install", buildDirectory.path()});
auto bs = qobject_cast<CMakeBuildSystem *>(buildSystem());
if (bs && bs->isMultiConfigReader()) {

View File

@@ -68,7 +68,7 @@ void CMakeProcess::run(const BuildDirParameters &parameters, const QStringList &
}
const FilePath sourceDirectory = cmakeExecutable.withNewMappedPath(parameters.sourceDirectory);
const FilePath buildDirectory = cmakeExecutable.withNewMappedPath(parameters.buildDirectory);
const FilePath buildDirectory = parameters.buildDirectory;
if (!buildDirectory.exists()) {
const QString msg = ::CMakeProjectManager::Tr::tr(