ENH: merge in Alex patches

This commit is contained in:
Bill Hoffman 2006-04-23 21:12:22 -04:00
parent 4e9564a0f1
commit 54b1655915
1 changed files with 14 additions and 5 deletions

View File

@ -68,8 +68,9 @@ void cmGlobalKdevelopGenerator::Generate()
std::string projectName=mf->GetProjectName();
std::string cmakeFilePattern("CMakeLists.txt;*.cmake;");
std::string fileToOpen;
std::vector<cmLocalGenerator*>& lgs= it->second;
// create the project.kdevelop.filelist file
if(!this->CreateFilelistFile(it->second[0], it->second,
if(!this->CreateFilelistFile(it->second[0], lgs,
outputDir, projectDir,
projectName, cmakeFilePattern, fileToOpen))
{
@ -79,7 +80,12 @@ void cmGlobalKdevelopGenerator::Generate()
//try to find the name of an executable so we have something to
//run from kdevelop for now just pick the first executable found
std::string executable;
cmTargets& targets=mf->GetTargets();
for (std::vector<cmLocalGenerator*>::const_iterator it=lgs.begin();
it!=lgs.end(); it++)
{
cmMakefile* makefile=(*it)->GetMakefile();
cmTargets& targets=makefile->GetTargets();
for (cmTargets::iterator ti = targets.begin();
ti != targets.end(); ti++)
{
@ -89,6 +95,9 @@ void cmGlobalKdevelopGenerator::Generate()
break;
}
}
if (!executable.empty())
break;
}
// now create a project file
this->CreateProjectFile(outputDir, projectDir, projectName,
executable, cmakeFilePattern, fileToOpen);
@ -121,7 +130,7 @@ bool cmGlobalKdevelopGenerator
tmp=*lt;
cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
// make sure the file is part of this source tree
if (tmp[0]!='/')
if ((tmp[0]!='/') && (strstr(tmp.c_str(), "CMakeFiles/")==0))
{
files.insert(tmp);
tmp=cmSystemTools::GetFilenameName(tmp);
@ -146,7 +155,7 @@ bool cmGlobalKdevelopGenerator
{
tmp=(*si)->GetFullPath();
cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
if (tmp[0]!='/')
if ((tmp[0]!='/') && (strstr(tmp.c_str(), "CMakeFiles/")==0))
{
files.insert(tmp);
}
@ -156,7 +165,7 @@ bool cmGlobalKdevelopGenerator
{
tmp=*lt;
cmSystemTools::ReplaceString(tmp, projectDir.c_str(), "");
if (tmp[0]!='/')
if ((tmp[0]!='/') && (strstr(tmp.c_str(), "CMakeFiles/")==0))
{
files.insert(tmp.c_str());
}