forked from qt-creator/qt-creator
CMake: Fix deployment path
Previously the path would be created based on the build device instead of the target device. Therefore when building on windows with a linux target the path might become "c:\usr\bin\..." instead of "/usr/bin/...". Fixes: QTCREATORBUG-29797 Change-Id: I13a9941b87b863f3e1b8420bcab230db1f70a28b Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -775,19 +775,20 @@ void CMakeBuildStep::updateDeploymentData()
|
|||||||
DeploymentData deploymentData;
|
DeploymentData deploymentData;
|
||||||
deploymentData.setLocalInstallRoot(rootDir);
|
deploymentData.setLocalInstallRoot(rootDir);
|
||||||
|
|
||||||
IDeviceConstPtr device = BuildDeviceKitAspect::device(buildSystem()->kit());
|
IDeviceConstPtr runDevice = DeviceKitAspect::device(buildSystem()->kit());
|
||||||
|
|
||||||
const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(),
|
const auto appFileNames = transform<QSet<QString>>(buildSystem()->applicationTargets(),
|
||||||
[](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); });
|
[](const BuildTargetInfo &appTarget) { return appTarget.targetFilePath.fileName(); });
|
||||||
|
|
||||||
auto handleFile = [&appFileNames, rootDir, &deploymentData, device](const FilePath &filePath) {
|
auto handleFile =
|
||||||
|
[&appFileNames, rootDir, &deploymentData, runDevice](const FilePath &filePath) {
|
||||||
const DeployableFile::Type type = appFileNames.contains(filePath.fileName())
|
const DeployableFile::Type type = appFileNames.contains(filePath.fileName())
|
||||||
? DeployableFile::TypeExecutable
|
? DeployableFile::TypeExecutable
|
||||||
: DeployableFile::TypeNormal;
|
: DeployableFile::TypeNormal;
|
||||||
|
|
||||||
FilePath targetDirPath = filePath.parentDir().relativePathFrom(rootDir);
|
FilePath targetDirPath = filePath.parentDir().relativePathFrom(rootDir);
|
||||||
|
|
||||||
const FilePath targetDir = device->rootPath().pathAppended(targetDirPath.path());
|
const FilePath targetDir = runDevice->rootPath().pathAppended(targetDirPath.path());
|
||||||
deploymentData.addFile(filePath, targetDir.nativePath(), type);
|
deploymentData.addFile(filePath, targetDir.nativePath(), type);
|
||||||
return IterationPolicy::Continue;
|
return IterationPolicy::Continue;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user