mirror of
https://github.com/Kitware/CMake.git
synced 2025-06-13 22:30:25 +08:00
GHS: List predefined targets before user targets in GUI
This commit is contained in:
parent
bdb213819c
commit
93c1acd8ff
@ -317,8 +317,14 @@ void cmGlobalGhsMultiGenerator::WriteTopLevelProject(std::ostream& fout,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cmGlobalGhsMultiGenerator::WriteSubProjects(std::ostream& fout)
|
void cmGlobalGhsMultiGenerator::WriteSubProjects(std::ostream& fout,
|
||||||
|
bool filterPredefined)
|
||||||
{
|
{
|
||||||
|
std::set<std::string> predefinedTargets;
|
||||||
|
predefinedTargets.insert(this->GetInstallTargetName());
|
||||||
|
predefinedTargets.insert(this->GetAllTargetName());
|
||||||
|
predefinedTargets.insert(std::string(CHECK_BUILD_SYSTEM_TARGET));
|
||||||
|
|
||||||
// All known targets
|
// All known targets
|
||||||
for (cmGeneratorTarget const* target : this->ProjectTargets) {
|
for (cmGeneratorTarget const* target : this->ProjectTargets) {
|
||||||
if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
|
if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
|
||||||
@ -328,7 +334,13 @@ void cmGlobalGhsMultiGenerator::WriteSubProjects(std::ostream& fout)
|
|||||||
target->GetName() != this->GetInstallTargetName())) {
|
target->GetName() != this->GetInstallTargetName())) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
fout << target->GetName() + ".tgt" + FILE_EXTENSION << " [Project]\n";
|
/* Check if the current target is a predefined CMake target */
|
||||||
|
bool predefinedTarget =
|
||||||
|
predefinedTargets.find(target->GetName()) != predefinedTargets.end();
|
||||||
|
if ((filterPredefined && predefinedTarget) ||
|
||||||
|
(!filterPredefined && !predefinedTarget)) {
|
||||||
|
fout << target->GetName() + ".tgt" + FILE_EXTENSION << " [Project]\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -454,7 +466,8 @@ void cmGlobalGhsMultiGenerator::OutputTopLevelProject(
|
|||||||
top.SetCopyIfDifferent(true);
|
top.SetCopyIfDifferent(true);
|
||||||
this->WriteTopLevelProject(top, root);
|
this->WriteTopLevelProject(top, root);
|
||||||
this->WriteTargets(root);
|
this->WriteTargets(root);
|
||||||
this->WriteSubProjects(top);
|
this->WriteSubProjects(top, true);
|
||||||
|
this->WriteSubProjects(top, false);
|
||||||
top.Close();
|
top.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ private:
|
|||||||
void WriteTopLevelProject(std::ostream& fout, cmLocalGenerator* root);
|
void WriteTopLevelProject(std::ostream& fout, cmLocalGenerator* root);
|
||||||
void WriteMacros(std::ostream& fout, cmLocalGenerator* root);
|
void WriteMacros(std::ostream& fout, cmLocalGenerator* root);
|
||||||
void WriteHighLevelDirectives(std::ostream& fout, cmLocalGenerator* root);
|
void WriteHighLevelDirectives(std::ostream& fout, cmLocalGenerator* root);
|
||||||
void WriteSubProjects(std::ostream& fout);
|
void WriteSubProjects(std::ostream& fout, bool filterPredefined);
|
||||||
void WriteTargets(cmLocalGenerator* root);
|
void WriteTargets(cmLocalGenerator* root);
|
||||||
void WriteProjectLine(std::ostream& fout, cmGeneratorTarget const* target,
|
void WriteProjectLine(std::ostream& fout, cmGeneratorTarget const* target,
|
||||||
std::string& rootBinaryDir);
|
std::string& rootBinaryDir);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user