Create projects where targets are the projects
| 113 | |
| 114 | // Create projects where targets are the projects |
| 115 | std::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. |
| 156 | std::vector<std::string> cmExtraCodeLiteGenerator::CreateProjectsByProjectMaps( |
no test coverage detected