QmakeProjectManager: Add lib and app binaries to project tree

Task-number: QTCREATORBUG-28815
Change-Id: I4a3bbab54ce4f5cf6553d61f50b047f63b88cfa3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
Christian Kandeler
2023-03-17 12:44:35 +01:00
parent 0870f2583b
commit 521ce41c09
4 changed files with 45 additions and 16 deletions

View File

@@ -1311,15 +1311,13 @@ static FilePath destDirFor(const TargetInformation &ti)
return ti.destDir;
}
void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentData &deploymentData)
FilePaths QmakeBuildSystem::allLibraryTargetFiles(const QmakeProFile *file) const
{
const QString targetPath = file->installsList().targetPath;
if (targetPath.isEmpty())
return;
const ToolChain *const toolchain = ToolChainKitAspect::cxxToolChain(kit());
if (!toolchain)
return;
return {};
FilePaths libs;
TargetInformation ti = file->targetInformation();
QString targetFileName = ti.target;
const QStringList config = file->variableValue(Variable::Config);
@@ -1339,7 +1337,7 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
}
targetFileName += targetVersionExt + QLatin1Char('.');
targetFileName += QLatin1String(isStatic ? "lib" : "dll");
deploymentData.addFile(destDirFor(ti) / targetFileName, targetPath);
libs << FilePath::fromString(targetFileName);
break;
}
case Abi::DarwinOS: {
@@ -1359,10 +1357,10 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
targetFileName += majorVersion;
}
targetFileName += QLatin1Char('.');
targetFileName += file->singleVariableValue(isStatic
? Variable::StaticLibExtension : Variable::ShLibExtension);
targetFileName += file->singleVariableValue(isStatic ? Variable::StaticLibExtension
: Variable::ShLibExtension);
}
deploymentData.addFile(destDir / targetFileName, targetPath);
libs << destDir / targetFileName;
break;
}
case Abi::LinuxOS:
@@ -1374,10 +1372,10 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
targetFileName += QLatin1Char('.');
if (isStatic) {
targetFileName += QLatin1Char('a');
libs << destDirFor(ti) / (targetFileName + QLatin1Char('a'));
} else {
targetFileName += QLatin1String("so");
deploymentData.addFile(destDirFor(ti) / targetFileName, targetPath);
libs << destDirFor(ti) / targetFileName;
if (nameIsVersioned) {
QString version = file->singleVariableValue(Variable::Version);
if (version.isEmpty())
@@ -1388,9 +1386,7 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
targetFileName += QLatin1Char('.');
while (!versionComponents.isEmpty()) {
const QString versionString = versionComponents.join(QLatin1Char('.'));
deploymentData.addFile(destDirFor(ti).pathAppended(targetFileName
+ versionString),
targetPath);
libs << destDirFor(ti).pathAppended(targetFileName + versionString);
versionComponents.removeLast();
}
}
@@ -1399,6 +1395,18 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
default:
break;
}
return libs;
}
void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentData &deploymentData)
{
const QString targetPath = file->installsList().targetPath;
if (!targetPath.isEmpty()) {
const FilePaths libs = allLibraryTargetFiles(file);
for (const FilePath &lib : libs)
deploymentData.addFile(lib, targetPath);
}
}
static FilePath getFullPathOf(const QmakeProFile *pro, Variable variable,