summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGhsMultiGenerator.cxx
diff options
context:
space:
mode:
authorFred Baksik <fdk17@ftml.net>2022-03-16 20:25:21 (GMT)
committerFred Baksik <fdk17@ftml.net>2022-03-17 23:11:47 (GMT)
commit93c1acd8ffdd59e127b11a47e13bf058d9cfe43c (patch)
tree1fde38e664bdcd17236771eab9ee805c69ce8cde /Source/cmGlobalGhsMultiGenerator.cxx
parentbdb213819c8e3b5191a7832c4b8fa1aca4b1335f (diff)
downloadCMake-93c1acd8ffdd59e127b11a47e13bf058d9cfe43c.zip
CMake-93c1acd8ffdd59e127b11a47e13bf058d9cfe43c.tar.gz
CMake-93c1acd8ffdd59e127b11a47e13bf058d9cfe43c.tar.bz2
GHS: List predefined targets before user targets in GUI
Diffstat (limited to 'Source/cmGlobalGhsMultiGenerator.cxx')
-rw-r--r--Source/cmGlobalGhsMultiGenerator.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/Source/cmGlobalGhsMultiGenerator.cxx b/Source/cmGlobalGhsMultiGenerator.cxx
index 1db4160..f405a04 100644
--- a/Source/cmGlobalGhsMultiGenerator.cxx
+++ b/Source/cmGlobalGhsMultiGenerator.cxx
@@ -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
for (cmGeneratorTarget const* target : this->ProjectTargets) {
if (target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
@@ -328,7 +334,13 @@ void cmGlobalGhsMultiGenerator::WriteSubProjects(std::ostream& fout)
target->GetName() != this->GetInstallTargetName())) {
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);
this->WriteTopLevelProject(top, root);
this->WriteTargets(root);
- this->WriteSubProjects(top);
+ this->WriteSubProjects(top, true);
+ this->WriteSubProjects(top, false);
top.Close();
}