diff options
Diffstat (limited to 'Source/cmExtraCodeLiteGenerator.cxx')
-rw-r--r-- | Source/cmExtraCodeLiteGenerator.cxx | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/Source/cmExtraCodeLiteGenerator.cxx b/Source/cmExtraCodeLiteGenerator.cxx index c2cff14..67aa157 100644 --- a/Source/cmExtraCodeLiteGenerator.cxx +++ b/Source/cmExtraCodeLiteGenerator.cxx @@ -68,15 +68,15 @@ void cmExtraCodeLiteGenerator::Generate() const cmMakefile* mf =it->second[0]->GetMakefile(); this->ConfigName = GetConfigurationName( mf ); - if (strcmp(mf->GetCurrentBinaryDirectory(), - mf->GetHomeOutputDirectory()) == 0) + if (strcmp(it->second[0]->GetCurrentBinaryDirectory(), + it->second[0]->GetBinaryDirectory()) == 0) { - workspaceOutputDir = mf->GetCurrentBinaryDirectory(); - workspaceProjectName = mf->GetProjectName(); - workspaceSourcePath = mf->GetHomeDirectory(); + workspaceOutputDir = it->second[0]->GetCurrentBinaryDirectory(); + workspaceProjectName = it->second[0]->GetProjectName(); + workspaceSourcePath = it->second[0]->GetSourceDirectory(); workspaceFileName = workspaceOutputDir+"/"; workspaceFileName += workspaceProjectName + ".workspace"; - this->WorkspacePath = mf->GetCurrentBinaryDirectory();; + this->WorkspacePath = it->second[0]->GetCurrentBinaryDirectory();; fout.Open(workspaceFileName.c_str(), false, false); fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" @@ -91,9 +91,8 @@ void cmExtraCodeLiteGenerator::Generate() ++it) { // retrive project information - const cmMakefile* mf = it->second[0]->GetMakefile(); - std::string outputDir = mf->GetCurrentBinaryDirectory(); - std::string projectName = mf->GetProjectName(); + std::string outputDir = it->second[0]->GetCurrentBinaryDirectory(); + std::string projectName = it->second[0]->GetProjectName(); std::string filename = outputDir + "/" + projectName + ".project"; // Make the project file relative to the workspace @@ -121,9 +120,8 @@ void cmExtraCodeLiteGenerator::Generate() void cmExtraCodeLiteGenerator::CreateProjectFile( const std::vector<cmLocalGenerator*>& lgs) { - const cmMakefile* mf = lgs[0]->GetMakefile(); - std::string outputDir = mf->GetCurrentBinaryDirectory(); - std::string projectName = mf->GetProjectName(); + std::string outputDir = lgs[0]->GetCurrentBinaryDirectory(); + std::string projectName = lgs[0]->GetProjectName(); std::string filename = outputDir + "/"; filename += projectName + ".project"; @@ -143,7 +141,7 @@ void cmExtraCodeLiteGenerator //////////////////////////////////// fout << "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n" - "<CodeLite_Project Name=\"" << mf->GetProjectName() + "<CodeLite_Project Name=\"" << lgs[0]->GetProjectName() << "\" InternalType=\"\">\n"; // Collect all used source files in the project @@ -151,35 +149,40 @@ void cmExtraCodeLiteGenerator // which may have an acompanying header, one for all other files std::string projectType; + std::vector<std::string> srcExts = + this->GlobalGenerator->GetCMakeInstance()->GetSourceExtensions(); + std::vector<std::string> headerExts = + this->GlobalGenerator->GetCMakeInstance()->GetHeaderExtensions(); + std::map<std::string, cmSourceFile*> cFiles; std::set<std::string> otherFiles; for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin(); lg!=lgs.end(); lg++) { cmMakefile* makefile=(*lg)->GetMakefile(); - cmTargets& targets=makefile->GetTargets(); - for (cmTargets::iterator ti = targets.begin(); + std::vector<cmGeneratorTarget*> targets=(*lg)->GetGeneratorTargets(); + for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin(); ti != targets.end(); ti++) { - switch(ti->second.GetType()) + switch((*ti)->GetType()) { - case cmTarget::EXECUTABLE: + case cmState::EXECUTABLE: { projectType = "Executable"; } break; - case cmTarget::STATIC_LIBRARY: + case cmState::STATIC_LIBRARY: { projectType = "Static Library"; } break; - case cmTarget::SHARED_LIBRARY: + case cmState::SHARED_LIBRARY: { projectType = "Dynamic Library"; } break; - case cmTarget::MODULE_LIBRARY: + case cmState::MODULE_LIBRARY: { projectType = "Dynamic Library"; } @@ -188,15 +191,16 @@ void cmExtraCodeLiteGenerator break; } - switch(ti->second.GetType()) + switch((*ti)->GetType()) { - case cmTarget::EXECUTABLE: - case cmTarget::STATIC_LIBRARY: - case cmTarget::SHARED_LIBRARY: - case cmTarget::MODULE_LIBRARY: + case cmState::EXECUTABLE: + case cmState::STATIC_LIBRARY: + case cmState::SHARED_LIBRARY: + case cmState::MODULE_LIBRARY: { std::vector<cmSourceFile*> sources; - ti->second.GetSourceFiles(sources, + cmGeneratorTarget* gt = *ti; + gt->GetSourceFiles(sources, makefile->GetSafeDefinition("CMAKE_BUILD_TYPE")); for (std::vector<cmSourceFile*>::const_iterator si=sources.begin(); si!=sources.end(); si++) @@ -208,9 +212,7 @@ void cmExtraCodeLiteGenerator { std::string srcext = (*si)->GetExtension(); for(std::vector<std::string>::const_iterator - ext = mf->GetSourceExtensions().begin(); - ext != mf->GetSourceExtensions().end(); - ++ext) + ext = srcExts.begin(); ext != srcExts.end(); ++ext) { if (srcext == *ext) { @@ -254,8 +256,8 @@ void cmExtraCodeLiteGenerator // check if there's a matching header around for(std::vector<std::string>::const_iterator - ext = mf->GetHeaderExtensions().begin(); - ext != mf->GetHeaderExtensions().end(); + ext = headerExts.begin(); + ext != headerExts.end(); ++ext) { std::string hname=headerBasename; |