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

Method CollectSourceFiles

Source/cmExtraCodeLiteGenerator.cxx:193–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193std::string cmExtraCodeLiteGenerator::CollectSourceFiles(
194 cmMakefile const* makefile, cmGeneratorTarget const* gt,
195 std::map<std::string, cmSourceFile*>& cFiles,
196 std::set<std::string>& otherFiles)
197{
198 std::string projectType;
199 switch (gt->GetType()) {
200 case cmStateEnums::EXECUTABLE: {
201 projectType = "Executable";
202 } break;
203 case cmStateEnums::STATIC_LIBRARY: {
204 projectType = "Static Library";
205 } break;
206 case cmStateEnums::SHARED_LIBRARY:
207 case cmStateEnums::MODULE_LIBRARY: {
208 projectType = "Dynamic Library";
209 } break;
210 default:
211 break;
212 }
213
214 switch (gt->GetType()) {
215 case cmStateEnums::EXECUTABLE:
216 case cmStateEnums::STATIC_LIBRARY:
217 case cmStateEnums::SHARED_LIBRARY:
218 case cmStateEnums::MODULE_LIBRARY: {
219 cmake const* cm = makefile->GetCMakeInstance();
220 std::vector<cmSourceFile*> sources;
221 gt->GetSourceFiles(sources,
222 makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"));
223 for (cmSourceFile* s : sources) {
224 std::string const& fullPath = s->ResolveFullPath();
225 std::string const& extLower =
226 cmSystemTools::LowerCase(s->GetExtension());
227 // check whether it is a source or a include file
228 // then put it accordingly into one of the two containers
229 if (cm->IsAKnownSourceExtension(extLower)) {
230 cFiles[fullPath] = s;
231 } else {
232 otherFiles.insert(fullPath);
233 }
234 }
235 } break;
236 default:
237 break;
238 }
239 return projectType;
240}
241
242void cmExtraCodeLiteGenerator::CreateNewProjectFile(
243 std::vector<cmLocalGenerator*> const& lgs, std::string const& filename)

Callers 1

CreateNewProjectFileMethod · 0.95

Calls 6

GetSourceFilesMethod · 0.80
GetExtensionMethod · 0.80
GetTypeMethod · 0.45
GetCMakeInstanceMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected