CMake: Fix command line for "staging" an installation

Fix that the "install" target was added too late in the command line
arguments, leading a cmake error for multi-config setups like for iOS.

Change-Id: If35a96725f55b5d250ccdd7386ba02d7a21ede85
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
Eike Ziller
2023-06-14 15:41:20 +02:00
parent 79dd731d87
commit ea8182016b

View File

@@ -426,8 +426,10 @@ CommandLine CMakeBuildStep::cmakeCommand() const
}
return s;
}));
if (m_useStaging->value())
cmd.addArg("install");
auto bs = qobject_cast<CMakeBuildSystem*>(buildSystem());
auto bs = qobject_cast<CMakeBuildSystem *>(buildSystem());
if (bs && bs->isMultiConfigReader()) {
cmd.addArg("--config");
if (m_configuration)
@@ -439,9 +441,6 @@ CommandLine CMakeBuildStep::cmakeCommand() const
if (!m_cmakeArguments->value().isEmpty())
cmd.addArgs(m_cmakeArguments->value(), CommandLine::Raw);
if (m_useStaging->value())
cmd.addArg("install");
bool toolArgumentsSpecified = false;
if (!m_toolArguments->value().isEmpty()) {
cmd.addArg("--");