MCPcopy Create free account
hub / github.com/Kitware/CMake / CreateProjectsByTarget

Method CreateProjectsByTarget

Source/cmExtraCodeLiteGenerator.cxx:115–153  ·  view source on GitHub ↗

Create projects where targets are the projects

Source from the content-addressed store, hash-verified

113
114// Create projects where targets are the projects
115std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByTarget(
116 cmXMLWriter* xml)
117{
118 std::vector<std::string> retval;
119 // for each target in the workspace create a codelite project
120 auto const& lgs = this->GlobalGenerator->GetLocalGenerators();
121 for (auto const& lg : lgs) {
122 for (auto const& lt : lg->GetGeneratorTargets()) {
123 cmStateEnums::TargetType type = lt->GetType();
124 std::string const& outputDir = lg->GetCurrentBinaryDirectory();
125 std::string targetName = lt->GetName();
126 std::string filename = cmStrCat(outputDir, '/', targetName, ".project");
127 retval.push_back(targetName);
128 // Make the project file relative to the workspace
129 std::string relafilename =
130 cmSystemTools::RelativePath(this->WorkspacePath, filename);
131 std::string visualname = targetName;
132 switch (type) {
133 case cmStateEnums::SHARED_LIBRARY:
134 case cmStateEnums::STATIC_LIBRARY:
135 case cmStateEnums::MODULE_LIBRARY:
136 visualname = cmStrCat("lib", visualname);
137 CM_FALLTHROUGH;
138 case cmStateEnums::EXECUTABLE:
139 xml->StartElement("Project");
140 xml->Attribute("Name", visualname);
141 xml->Attribute("Path", relafilename);
142 xml->Attribute("Active", "No");
143 xml->EndElement();
144
145 this->CreateNewProjectFile(lt.get(), filename);
146 break;
147 default:
148 break;
149 }
150 }
151 }
152 return retval;
153}
154
155// The "older way of doing it.
156std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByProjectMaps(

Callers 1

GenerateMethod · 0.95

Calls 9

CreateNewProjectFileMethod · 0.95
push_backMethod · 0.80
AttributeMethod · 0.80
cmStrCatFunction · 0.70
GetTypeMethod · 0.45
GetNameMethod · 0.45
StartElementMethod · 0.45
EndElementMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected