forked from qt-creator/qt-creator
ProjectExplorer: Make BuildSystem:Name variable available
... for use in the default build dir template. Task-number: QTCREATORBUG-26147 Change-Id: I1a32d60e0d5e2db514ac315c48c615c55ccda51f Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1369,8 +1369,8 @@ FilePath CMakeBuildConfiguration::shadowBuildDirectory(const FilePath &projectFi
|
||||
|
||||
const QString projectName = projectFilePath.parentDir().fileName();
|
||||
const FilePath projectDir = Project::projectDirectory(projectFilePath);
|
||||
FilePath buildPath = BuildConfiguration::buildDirectoryFromTemplate(projectDir,
|
||||
projectFilePath, projectName, k, bcName, buildType);
|
||||
FilePath buildPath = buildDirectoryFromTemplate(projectDir, projectFilePath, projectName, k,
|
||||
bcName, buildType, "cmake");
|
||||
|
||||
if (CMakeGeneratorKitAspect::isMultiConfigGenerator(k)) {
|
||||
QString path = buildPath.path();
|
||||
|
@@ -83,9 +83,8 @@ FilePath MesonBuildConfiguration::shadowBuildDirectory(const FilePath &projectFi
|
||||
return {};
|
||||
|
||||
const QString projectName = projectFilePath.parentDir().fileName();
|
||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||
Project::projectDirectory(projectFilePath),
|
||||
projectFilePath, projectName, k, bcName, buildType);
|
||||
return buildDirectoryFromTemplate(Project::projectDirectory(projectFilePath), projectFilePath,
|
||||
projectName, k, bcName, buildType, "meson");
|
||||
}
|
||||
|
||||
ProjectExplorer::BuildSystem *MesonBuildConfiguration::buildSystem() const
|
||||
|
@@ -53,7 +53,7 @@ static FilePath defaultBuildDirectory(const Kit *k,
|
||||
{
|
||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||
projectFilePath.parentDir(), projectFilePath, projectFilePath.baseName(),
|
||||
k, bc, buildType);
|
||||
k, bc, buildType, "nim");
|
||||
}
|
||||
|
||||
NimBuildConfiguration::NimBuildConfiguration(Target *target, Utils::Id id)
|
||||
|
@@ -604,7 +604,8 @@ FilePath BuildConfiguration::buildDirectoryFromTemplate(const FilePath &projectD
|
||||
const QString &projectName,
|
||||
const Kit *kit,
|
||||
const QString &bcName,
|
||||
BuildType buildType)
|
||||
BuildType buildType,
|
||||
const QString &buildSystem)
|
||||
{
|
||||
MacroExpander exp;
|
||||
|
||||
@@ -630,6 +631,10 @@ FilePath BuildConfiguration::buildDirectoryFromTemplate(const FilePath &projectD
|
||||
QCoreApplication::translate(
|
||||
"ProjectExplorer", "Name of the project's active build configuration"),
|
||||
[bcName] { return bcName; });
|
||||
exp.registerVariable("BuildSystem:Name",
|
||||
QCoreApplication::translate(
|
||||
"ProjectExplorer", "Name of the project's active build system"),
|
||||
[buildSystem] { return buildSystem; });
|
||||
exp.registerVariable("CurrentBuild:Type",
|
||||
QCoreApplication::translate("ProjectExplorer", "Type of current build"),
|
||||
[buildType] { return buildTypeName(buildType); }, false);
|
||||
|
@@ -115,7 +115,8 @@ public:
|
||||
const QString &projectName,
|
||||
const Kit *kit,
|
||||
const QString &bcName,
|
||||
BuildType buildType);
|
||||
BuildType buildType,
|
||||
const QString &buildSystem);
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
|
@@ -454,7 +454,8 @@ bool Project::copySteps(Target *sourceTarget, Target *newTarget)
|
||||
newBc->setBuildDirectory(BuildConfiguration::buildDirectoryFromTemplate(
|
||||
project->projectDirectory(), project->projectFilePath(),
|
||||
project->displayName(), newTarget->kit(),
|
||||
sourceBc->displayName(), sourceBc->buildType()));
|
||||
sourceBc->displayName(), sourceBc->buildType(),
|
||||
sourceBc->buildSystem()->name()));
|
||||
newTarget->addBuildConfiguration(newBc);
|
||||
if (sourceTarget->activeBuildConfiguration() == sourceBc)
|
||||
SessionManager::setActiveBuildConfiguration(newTarget, newBc, SetActive::NoCascade);
|
||||
|
@@ -65,7 +65,7 @@ static FilePath defaultBuildDirectory(const FilePath &projectFilePath, const Kit
|
||||
const QString projectName = projectFilePath.completeBaseName();
|
||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||
Project::projectDirectory(projectFilePath),
|
||||
projectFilePath, projectName, k, bcName, buildType);
|
||||
projectFilePath, projectName, k, bcName, buildType, "qbs");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
@@ -89,7 +89,7 @@ static FilePath buildDir(const FilePath &projectFilePath, const Kit *k)
|
||||
const QString projectName = projectFilePath.completeBaseName();
|
||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||
Project::projectDirectory(projectFilePath),
|
||||
projectFilePath, projectName, k, QString(), BuildConfiguration::Unknown);
|
||||
projectFilePath, projectName, k, QString(), BuildConfiguration::Unknown, "qbs");
|
||||
}
|
||||
|
||||
static bool hasBuildGraph(const QString &dir)
|
||||
|
@@ -103,8 +103,8 @@ FilePath QmakeBuildConfiguration::shadowBuildDirectory(const FilePath &proFilePa
|
||||
return {};
|
||||
|
||||
const QString projectName = proFilePath.completeBaseName();
|
||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||
Project::projectDirectory(proFilePath), proFilePath, projectName, k, suffix, buildType);
|
||||
return buildDirectoryFromTemplate(Project::projectDirectory(proFilePath), proFilePath,
|
||||
projectName, k, suffix, buildType, "qmake");
|
||||
}
|
||||
|
||||
const char BUILD_CONFIGURATION_KEY[] = "Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration";
|
||||
|
Reference in New Issue
Block a user