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 QString projectName = projectFilePath.parentDir().fileName();
|
||||||
const FilePath projectDir = Project::projectDirectory(projectFilePath);
|
const FilePath projectDir = Project::projectDirectory(projectFilePath);
|
||||||
FilePath buildPath = BuildConfiguration::buildDirectoryFromTemplate(projectDir,
|
FilePath buildPath = buildDirectoryFromTemplate(projectDir, projectFilePath, projectName, k,
|
||||||
projectFilePath, projectName, k, bcName, buildType);
|
bcName, buildType, "cmake");
|
||||||
|
|
||||||
if (CMakeGeneratorKitAspect::isMultiConfigGenerator(k)) {
|
if (CMakeGeneratorKitAspect::isMultiConfigGenerator(k)) {
|
||||||
QString path = buildPath.path();
|
QString path = buildPath.path();
|
||||||
|
@@ -83,9 +83,8 @@ FilePath MesonBuildConfiguration::shadowBuildDirectory(const FilePath &projectFi
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
const QString projectName = projectFilePath.parentDir().fileName();
|
const QString projectName = projectFilePath.parentDir().fileName();
|
||||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
return buildDirectoryFromTemplate(Project::projectDirectory(projectFilePath), projectFilePath,
|
||||||
Project::projectDirectory(projectFilePath),
|
projectName, k, bcName, buildType, "meson");
|
||||||
projectFilePath, projectName, k, bcName, buildType);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::BuildSystem *MesonBuildConfiguration::buildSystem() const
|
ProjectExplorer::BuildSystem *MesonBuildConfiguration::buildSystem() const
|
||||||
|
@@ -53,7 +53,7 @@ static FilePath defaultBuildDirectory(const Kit *k,
|
|||||||
{
|
{
|
||||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||||
projectFilePath.parentDir(), projectFilePath, projectFilePath.baseName(),
|
projectFilePath.parentDir(), projectFilePath, projectFilePath.baseName(),
|
||||||
k, bc, buildType);
|
k, bc, buildType, "nim");
|
||||||
}
|
}
|
||||||
|
|
||||||
NimBuildConfiguration::NimBuildConfiguration(Target *target, Utils::Id id)
|
NimBuildConfiguration::NimBuildConfiguration(Target *target, Utils::Id id)
|
||||||
|
@@ -604,7 +604,8 @@ FilePath BuildConfiguration::buildDirectoryFromTemplate(const FilePath &projectD
|
|||||||
const QString &projectName,
|
const QString &projectName,
|
||||||
const Kit *kit,
|
const Kit *kit,
|
||||||
const QString &bcName,
|
const QString &bcName,
|
||||||
BuildType buildType)
|
BuildType buildType,
|
||||||
|
const QString &buildSystem)
|
||||||
{
|
{
|
||||||
MacroExpander exp;
|
MacroExpander exp;
|
||||||
|
|
||||||
@@ -630,6 +631,10 @@ FilePath BuildConfiguration::buildDirectoryFromTemplate(const FilePath &projectD
|
|||||||
QCoreApplication::translate(
|
QCoreApplication::translate(
|
||||||
"ProjectExplorer", "Name of the project's active build configuration"),
|
"ProjectExplorer", "Name of the project's active build configuration"),
|
||||||
[bcName] { return bcName; });
|
[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",
|
exp.registerVariable("CurrentBuild:Type",
|
||||||
QCoreApplication::translate("ProjectExplorer", "Type of current build"),
|
QCoreApplication::translate("ProjectExplorer", "Type of current build"),
|
||||||
[buildType] { return buildTypeName(buildType); }, false);
|
[buildType] { return buildTypeName(buildType); }, false);
|
||||||
|
@@ -115,7 +115,8 @@ public:
|
|||||||
const QString &projectName,
|
const QString &projectName,
|
||||||
const Kit *kit,
|
const Kit *kit,
|
||||||
const QString &bcName,
|
const QString &bcName,
|
||||||
BuildType buildType);
|
BuildType buildType,
|
||||||
|
const QString &buildSystem);
|
||||||
|
|
||||||
bool isActive() const;
|
bool isActive() const;
|
||||||
|
|
||||||
|
@@ -454,7 +454,8 @@ bool Project::copySteps(Target *sourceTarget, Target *newTarget)
|
|||||||
newBc->setBuildDirectory(BuildConfiguration::buildDirectoryFromTemplate(
|
newBc->setBuildDirectory(BuildConfiguration::buildDirectoryFromTemplate(
|
||||||
project->projectDirectory(), project->projectFilePath(),
|
project->projectDirectory(), project->projectFilePath(),
|
||||||
project->displayName(), newTarget->kit(),
|
project->displayName(), newTarget->kit(),
|
||||||
sourceBc->displayName(), sourceBc->buildType()));
|
sourceBc->displayName(), sourceBc->buildType(),
|
||||||
|
sourceBc->buildSystem()->name()));
|
||||||
newTarget->addBuildConfiguration(newBc);
|
newTarget->addBuildConfiguration(newBc);
|
||||||
if (sourceTarget->activeBuildConfiguration() == sourceBc)
|
if (sourceTarget->activeBuildConfiguration() == sourceBc)
|
||||||
SessionManager::setActiveBuildConfiguration(newTarget, newBc, SetActive::NoCascade);
|
SessionManager::setActiveBuildConfiguration(newTarget, newBc, SetActive::NoCascade);
|
||||||
|
@@ -65,7 +65,7 @@ static FilePath defaultBuildDirectory(const FilePath &projectFilePath, const Kit
|
|||||||
const QString projectName = projectFilePath.completeBaseName();
|
const QString projectName = projectFilePath.completeBaseName();
|
||||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||||
Project::projectDirectory(projectFilePath),
|
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();
|
const QString projectName = projectFilePath.completeBaseName();
|
||||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
return BuildConfiguration::buildDirectoryFromTemplate(
|
||||||
Project::projectDirectory(projectFilePath),
|
Project::projectDirectory(projectFilePath),
|
||||||
projectFilePath, projectName, k, QString(), BuildConfiguration::Unknown);
|
projectFilePath, projectName, k, QString(), BuildConfiguration::Unknown, "qbs");
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool hasBuildGraph(const QString &dir)
|
static bool hasBuildGraph(const QString &dir)
|
||||||
|
@@ -103,8 +103,8 @@ FilePath QmakeBuildConfiguration::shadowBuildDirectory(const FilePath &proFilePa
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
const QString projectName = proFilePath.completeBaseName();
|
const QString projectName = proFilePath.completeBaseName();
|
||||||
return BuildConfiguration::buildDirectoryFromTemplate(
|
return buildDirectoryFromTemplate(Project::projectDirectory(proFilePath), proFilePath,
|
||||||
Project::projectDirectory(proFilePath), proFilePath, projectName, k, suffix, buildType);
|
projectName, k, suffix, buildType, "qmake");
|
||||||
}
|
}
|
||||||
|
|
||||||
const char BUILD_CONFIGURATION_KEY[] = "Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration";
|
const char BUILD_CONFIGURATION_KEY[] = "Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration";
|
||||||
|
Reference in New Issue
Block a user