Utils: Rename FilePath::absolutePath(FilePath) to resolvePath

There was already a similar function taking a QString.

After that, the remaining no-argument version of absolutePath()
can be deprecated.

Change-Id: I5b9ad8c8b68a5723891b0aa9f5a37e90db0fe09e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-09-08 16:13:43 +02:00
parent f7489252df
commit bdefc13eba
8 changed files with 25 additions and 25 deletions

View File

@@ -1255,10 +1255,10 @@ void CMakeBuildSystem::updateInitialCMakeExpandableVars()
// this is not 100% correct since CMake resolve them to CMAKE_CURRENT_SOURCE_DIR
// depending on context, but we cannot do better here
return first == second
|| projectDirectory.absoluteFilePath(first)
== projectDirectory.absoluteFilePath(second)
|| projectDirectory.absoluteFilePath(first).canonicalPath()
== projectDirectory.absoluteFilePath(second).canonicalPath();
|| projectDirectory.resolvePath(first)
== projectDirectory.resolvePath(second)
|| projectDirectory.resolvePath(first).canonicalPath()
== projectDirectory.resolvePath(second).canonicalPath();
};
// Replace path values that do not exist on file system

View File

@@ -201,12 +201,12 @@ QList<CMakeBuildTarget> generateBuildTargets(const PreprocessedData &input,
const QList<CMakeBuildTarget> result = transform<QList>(input.targetDetails,
[&sourceDir, &sourceDirectory, &buildDirectory,
&haveLibrariesRelativeToBuildDirectory](const TargetDetails &t) {
const FilePath currentBuildDir = buildDirectory.absoluteFilePath(t.buildDir);
const FilePath currentBuildDir = buildDirectory.resolvePath(t.buildDir);
CMakeBuildTarget ct;
ct.title = t.name;
if (!t.artifacts.isEmpty())
ct.executable = buildDirectory.absoluteFilePath(t.artifacts.at(0));
ct.executable = buildDirectory.resolvePath(t.artifacts.at(0));
TargetType type = UtilityType;
if (t.type == "EXECUTABLE")
type = ExecutableType;
@@ -222,7 +222,7 @@ QList<CMakeBuildTarget> generateBuildTargets(const PreprocessedData &input,
ct.workingDirectory = ct.executable.isEmpty()
? currentBuildDir.absolutePath()
: ct.executable.parentDir();
ct.sourceDirectory = sourceDirectory.absoluteFilePath(t.sourceDir);
ct.sourceDirectory = sourceDirectory.resolvePath(t.sourceDir);
ct.backtrace = extractBacktraceInformation(t.backtraceGraph, sourceDir, t.backtrace, 0);
@@ -276,7 +276,7 @@ QList<CMakeBuildTarget> generateBuildTargets(const PreprocessedData &input,
continue;
const FilePath buildDir = haveLibrariesRelativeToBuildDirectory ? buildDirectory : currentBuildDir;
FilePath tmp = buildDir.absoluteFilePath(FilePath::fromUserInput(part));
FilePath tmp = buildDir.resolvePath(FilePath::fromUserInput(part));
if (f.role == "libraries")
tmp = tmp.parentDir();

View File

@@ -967,7 +967,7 @@ FilePaths FileApiParser::cmakeQueryFilePaths(const FilePath &buildDirectory)
{
FilePath queryDir = buildDirectory / CMAKE_RELATIVE_QUERY_PATH;
return transform(CMAKE_QUERY_FILENAMES, [&queryDir](const QString &name) {
return queryDir.absoluteFilePath(FilePath::fromString(name));
return queryDir.resolvePath(FilePath::fromString(name));
});
}