CMakePM: Resolve paths to build directories

With the default build directory template the CMake build directories
will be displayed as project-source/../build-project-name-kit-build-type
which can be irritating.

With this commit the build directory will contain the resolved path.

Change-Id: I968260caba5b9a47e1bda4eeaea386a04fe817b1
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Cristian Adam
2021-06-25 19:17:05 +02:00
parent 20366297ed
commit fc493c3fcb

View File

@@ -1044,14 +1044,14 @@ FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFi
const QString projectName = projectFilePath.parentDir().fileName();
ProjectMacroExpander expander(projectFilePath, projectName, k, bcName, buildType);
QDir projectDir = QDir(Project::projectDirectory(projectFilePath).toString());
const FilePath projectDir = Project::projectDirectory(projectFilePath);
QString buildPath = expander.expand(ProjectExplorerPlugin::buildDirectoryTemplate());
buildPath.replace(" ", "-");
if (CMakeGeneratorKitAspect::isMultiConfigGenerator(k))
buildPath = buildPath.left(buildPath.lastIndexOf(QString("-%1").arg(bcName)));
return FilePath::fromUserInput(projectDir.absoluteFilePath(buildPath));
return projectDir.resolvePath(buildPath);
}
void CMakeBuildConfiguration::buildTarget(const QString &buildTarget)