diff options
author | Kitware Robot <kwrobot@kitware.com> | 2016-05-16 14:34:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-05-16 20:05:19 (GMT) |
commit | d9fd2f5402eeaa345691313658e02b51038f570b (patch) | |
tree | dca71b9a7e267f4c6300da3eb770415381726785 /Source/cmGlobalKdevelopGenerator.cxx | |
parent | 82df6deaafb36cbbfd450202bb20b320f637751a (diff) | |
download | CMake-d9fd2f5402eeaa345691313658e02b51038f570b.zip CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.gz CMake-d9fd2f5402eeaa345691313658e02b51038f570b.tar.bz2 |
Revise C++ coding style using clang-format
Run the `Utilities/Scripts/clang-format.bash` script to update
all our C++ code to a new style defined by `.clang-format`.
Use `clang-format` version 3.8.
* If you reached this commit for a line in `git blame`, re-run the blame
operation starting at the parent of this commit to see older history
for the content.
* See the parent commit for instructions to rebase a change across this
style transition commit.
Diffstat (limited to 'Source/cmGlobalKdevelopGenerator.cxx')
-rw-r--r-- | Source/cmGlobalKdevelopGenerator.cxx | 475 |
1 files changed, 202 insertions, 273 deletions
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx index f2de750..5c1e733 100644 --- a/Source/cmGlobalKdevelopGenerator.cxx +++ b/Source/cmGlobalKdevelopGenerator.cxx @@ -25,15 +25,15 @@ #include <cmsys/FStream.hxx> #include <cmsys/SystemTools.hxx> -void cmGlobalKdevelopGenerator -::GetDocumentation(cmDocumentationEntry& entry, const std::string&) const +void cmGlobalKdevelopGenerator::GetDocumentation(cmDocumentationEntry& entry, + const std::string&) const { entry.Name = this->GetName(); entry.Brief = "Generates KDevelop 3 project files."; } cmGlobalKdevelopGenerator::cmGlobalKdevelopGenerator() -:cmExternalMakefileProjectGenerator() + : cmExternalMakefileProjectGenerator() { this->SupportedGlobalGenerators.push_back("Unix Makefiles"); #ifdef CMAKE_USE_NINJA @@ -46,372 +46,312 @@ void cmGlobalKdevelopGenerator::Generate() // for each sub project in the project create // a kdevelop project for (std::map<std::string, std::vector<cmLocalGenerator*> >::const_iterator - it = this->GlobalGenerator->GetProjectMap().begin(); - it!= this->GlobalGenerator->GetProjectMap().end(); - ++it) - { - std::string outputDir=it->second[0]->GetCurrentBinaryDirectory(); - std::string projectDir=it->second[0]->GetSourceDirectory(); - std::string projectName=it->second[0]->GetProjectName(); + it = this->GlobalGenerator->GetProjectMap().begin(); + it != this->GlobalGenerator->GetProjectMap().end(); ++it) { + std::string outputDir = it->second[0]->GetCurrentBinaryDirectory(); + std::string projectDir = it->second[0]->GetSourceDirectory(); + std::string projectName = it->second[0]->GetProjectName(); std::string cmakeFilePattern("CMakeLists.txt;*.cmake;"); std::string fileToOpen; - const std::vector<cmLocalGenerator*>& lgs= it->second; + const std::vector<cmLocalGenerator*>& lgs = it->second; // create the project.kdevelop.filelist file - if(!this->CreateFilelistFile(lgs, outputDir, projectDir, - projectName, cmakeFilePattern, fileToOpen)) - { + if (!this->CreateFilelistFile(lgs, outputDir, projectDir, projectName, + cmakeFilePattern, fileToOpen)) { cmSystemTools::Error("Can not create filelist file"); return; - } - //try to find the name of an executable so we have something to - //run from kdevelop for now just pick the first executable found + } + // 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; - for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin(); - lg!=lgs.end(); lg++) - { + for (std::vector<cmLocalGenerator*>::const_iterator lg = lgs.begin(); + lg != lgs.end(); lg++) { std::vector<cmGeneratorTarget*> const& targets = - (*lg)->GetGeneratorTargets(); + (*lg)->GetGeneratorTargets(); for (std::vector<cmGeneratorTarget*>::const_iterator ti = - targets.begin(); ti != targets.end(); ti++) - { - if ((*ti)->GetType()==cmState::EXECUTABLE) - { + targets.begin(); + ti != targets.end(); ti++) { + if ((*ti)->GetType() == cmState::EXECUTABLE) { executable = (*ti)->GetLocation(""); break; - } } - if (!executable.empty()) - { + } + if (!executable.empty()) { break; - } } + } // now create a project file - this->CreateProjectFile(outputDir, projectDir, projectName, - executable, cmakeFilePattern, fileToOpen); - } + this->CreateProjectFile(outputDir, projectDir, projectName, executable, + cmakeFilePattern, fileToOpen); + } } -bool cmGlobalKdevelopGenerator -::CreateFilelistFile(const std::vector<cmLocalGenerator*>& lgs, - const std::string& outputDir, - const std::string& projectDirIn, - const std::string& projectname, - std::string& cmakeFilePattern, - std::string& fileToOpen) +bool cmGlobalKdevelopGenerator::CreateFilelistFile( + const std::vector<cmLocalGenerator*>& lgs, const std::string& outputDir, + const std::string& projectDirIn, const std::string& projectname, + std::string& cmakeFilePattern, std::string& fileToOpen) { std::string projectDir = projectDirIn + "/"; - std::string filename = outputDir+ "/" + projectname +".kdevelop.filelist"; + std::string filename = outputDir + "/" + projectname + ".kdevelop.filelist"; std::set<std::string> files; std::string tmp; std::vector<std::string> hdrExts = - this->GlobalGenerator->GetCMakeInstance()->GetHeaderExtensions(); - - for (std::vector<cmLocalGenerator*>::const_iterator it=lgs.begin(); - it!=lgs.end(); it++) - { - cmMakefile* makefile=(*it)->GetMakefile(); - const std::vector<std::string>& listFiles=makefile->GetListFiles(); - for (std::vector<std::string>::const_iterator lt=listFiles.begin(); - lt!=listFiles.end(); lt++) - { - tmp=*lt; + this->GlobalGenerator->GetCMakeInstance()->GetHeaderExtensions(); + + for (std::vector<cmLocalGenerator*>::const_iterator it = lgs.begin(); + it != lgs.end(); it++) { + cmMakefile* makefile = (*it)->GetMakefile(); + const std::vector<std::string>& listFiles = makefile->GetListFiles(); + for (std::vector<std::string>::const_iterator lt = listFiles.begin(); + lt != listFiles.end(); lt++) { + tmp = *lt; cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); // make sure the file is part of this source tree - if ((tmp[0]!='/') && - (strstr(tmp.c_str(), - cmake::GetCMakeFilesDirectoryPostSlash())==0)) - { + if ((tmp[0] != '/') && + (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == + 0)) { files.insert(tmp); - tmp=cmSystemTools::GetFilenameName(tmp); - //add all files which dont match the default + tmp = cmSystemTools::GetFilenameName(tmp); + // add all files which dont match the default // */CMakeLists.txt;*cmake; to the file pattern - if ((tmp!="CMakeLists.txt") - && (strstr(tmp.c_str(), ".cmake")==0)) - { - cmakeFilePattern+=tmp+";"; - } + if ((tmp != "CMakeLists.txt") && + (strstr(tmp.c_str(), ".cmake") == 0)) { + cmakeFilePattern += tmp + ";"; } } + } - //get all sources - std::vector<cmGeneratorTarget*> targets=(*it)->GetGeneratorTargets(); + // get all sources + std::vector<cmGeneratorTarget*> targets = (*it)->GetGeneratorTargets(); for (std::vector<cmGeneratorTarget*>::iterator ti = targets.begin(); - ti != targets.end(); ti++) - { + ti != targets.end(); ti++) { std::vector<cmSourceFile*> sources; cmGeneratorTarget* gt = *ti; - gt->GetSourceFiles(sources, gt->Target->GetMakefile() - ->GetSafeDefinition("CMAKE_BUILD_TYPE")); - for (std::vector<cmSourceFile*>::const_iterator si=sources.begin(); - si!=sources.end(); si++) - { - tmp=(*si)->GetFullPath(); - std::string headerBasename=cmSystemTools::GetFilenamePath(tmp); - headerBasename+="/"; - headerBasename+=cmSystemTools::GetFilenameWithoutExtension(tmp); + gt->GetSourceFiles(sources, gt->Target->GetMakefile()->GetSafeDefinition( + "CMAKE_BUILD_TYPE")); + for (std::vector<cmSourceFile*>::const_iterator si = sources.begin(); + si != sources.end(); si++) { + tmp = (*si)->GetFullPath(); + std::string headerBasename = cmSystemTools::GetFilenamePath(tmp); + headerBasename += "/"; + headerBasename += cmSystemTools::GetFilenameWithoutExtension(tmp); cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - if ((tmp[0]!='/') && - (strstr(tmp.c_str(), - cmake::GetCMakeFilesDirectoryPostSlash())==0) && - (cmSystemTools::GetFilenameExtension(tmp)!=".moc")) - { + if ((tmp[0] != '/') && + (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == + 0) && + (cmSystemTools::GetFilenameExtension(tmp) != ".moc")) { files.insert(tmp); // check if there's a matching header around - for(std::vector<std::string>::const_iterator - ext = hdrExts.begin(); ext != hdrExts.end(); ++ext) - { - std::string hname=headerBasename; + for (std::vector<std::string>::const_iterator ext = hdrExts.begin(); + ext != hdrExts.end(); ++ext) { + std::string hname = headerBasename; hname += "."; hname += *ext; - if(cmSystemTools::FileExists(hname.c_str())) - { + if (cmSystemTools::FileExists(hname.c_str())) { cmSystemTools::ReplaceString(hname, projectDir.c_str(), ""); files.insert(hname); break; - } } } } - for (std::vector<std::string>::const_iterator lt=listFiles.begin(); - lt!=listFiles.end(); lt++) - { - tmp=*lt; + } + for (std::vector<std::string>::const_iterator lt = listFiles.begin(); + lt != listFiles.end(); lt++) { + tmp = *lt; cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); - if ((tmp[0]!='/') && - (strstr(tmp.c_str(), - cmake::GetCMakeFilesDirectoryPostSlash())==0)) - { + if ((tmp[0] != '/') && + (strstr(tmp.c_str(), cmake::GetCMakeFilesDirectoryPostSlash()) == + 0)) { files.insert(tmp); - } } } } + } - //check if the output file already exists and read it - //insert all files which exist into the set of files + // check if the output file already exists and read it + // insert all files which exist into the set of files cmsys::ifstream oldFilelist(filename.c_str()); - if (oldFilelist) - { - while (cmSystemTools::GetLineFromStream(oldFilelist, tmp)) - { - if (tmp[0]=='/') - { + if (oldFilelist) { + while (cmSystemTools::GetLineFromStream(oldFilelist, tmp)) { + if (tmp[0] == '/') { continue; - } - std::string completePath=projectDir+tmp; - if (cmSystemTools::FileExists(completePath.c_str())) - { + } + std::string completePath = projectDir + tmp; + if (cmSystemTools::FileExists(completePath.c_str())) { files.insert(tmp); - } } - oldFilelist.close(); } + oldFilelist.close(); + } - //now write the new filename + // now write the new filename cmGeneratedFileStream fout(filename.c_str()); - if(!fout) - { + if (!fout) { return false; - } + } - fileToOpen=""; - for (std::set<std::string>::const_iterator it=files.begin(); - it!=files.end(); it++) - { + fileToOpen = ""; + for (std::set<std::string>::const_iterator it = files.begin(); + it != files.end(); it++) { // get the full path to the file - tmp=cmSystemTools::CollapseFullPath(*it, projectDir.c_str()); + tmp = cmSystemTools::CollapseFullPath(*it, projectDir.c_str()); // just select the first source file - if (fileToOpen.empty()) - { - std::string ext = cmSystemTools::GetFilenameExtension(tmp); - if ((ext==".c") || (ext==".cc") || (ext==".cpp") || (ext==".cxx") - || (ext==".C") || (ext==".h") || (ext==".hpp")) - { - fileToOpen=tmp; - } + if (fileToOpen.empty()) { + std::string ext = cmSystemTools::GetFilenameExtension(tmp); + if ((ext == ".c") || (ext == ".cc") || (ext == ".cpp") || + (ext == ".cxx") || (ext == ".C") || (ext == ".h") || + (ext == ".hpp")) { + fileToOpen = tmp; + } } // make it relative to the project dir cmSystemTools::ReplaceString(tmp, projectDir.c_str(), ""); // only put relative paths - if (!tmp.empty() && tmp[0] != '/') - { - fout << tmp.c_str() <<"\n"; - } + if (!tmp.empty() && tmp[0] != '/') { + fout << tmp.c_str() << "\n"; } + } return true; } - /* create the project file, if it already exists, merge it with the existing one, otherwise create a new one */ -void cmGlobalKdevelopGenerator -::CreateProjectFile(const std::string& outputDir, - const std::string& projectDir, - const std::string& projectname, - const std::string& executable, - const std::string& cmakeFilePattern, - const std::string& fileToOpen) +void cmGlobalKdevelopGenerator::CreateProjectFile( + const std::string& outputDir, const std::string& projectDir, + const std::string& projectname, const std::string& executable, + const std::string& cmakeFilePattern, const std::string& fileToOpen) { this->Blacklist.clear(); - std::string filename=outputDir+"/"; - filename+=projectname+".kdevelop"; - std::string sessionFilename=outputDir+"/"; - sessionFilename+=projectname+".kdevses"; + std::string filename = outputDir + "/"; + filename += projectname + ".kdevelop"; + std::string sessionFilename = outputDir + "/"; + sessionFilename += projectname + ".kdevses"; - if (cmSystemTools::FileExists(filename.c_str())) - { - this->MergeProjectFiles(outputDir, projectDir, filename, - executable, cmakeFilePattern, - fileToOpen, sessionFilename); - } - else - { + if (cmSystemTools::FileExists(filename.c_str())) { + this->MergeProjectFiles(outputDir, projectDir, filename, executable, + cmakeFilePattern, fileToOpen, sessionFilename); + } else { // add all subdirectories which are cmake build directories to the // kdevelop blacklist so they are not monitored for added or removed files // since this is handled by adding files to the cmake files cmsys::Directory d; - if (d.Load(projectDir)) - { + if (d.Load(projectDir)) { size_t numf = d.GetNumberOfFiles(); - for (unsigned int i = 0; i < numf; i++) - { + for (unsigned int i = 0; i < numf; i++) { std::string nextFile = d.GetFile(i); - if ((nextFile!=".") && (nextFile!="..")) - { + if ((nextFile != ".") && (nextFile != "..")) { std::string tmp = projectDir; tmp += "/"; tmp += nextFile; - if (cmSystemTools::FileIsDirectory(tmp)) - { + if (cmSystemTools::FileIsDirectory(tmp)) { tmp += "/CMakeCache.txt"; - if ((nextFile == "CMakeFiles") - || (cmSystemTools::FileExists(tmp.c_str()))) - { + if ((nextFile == "CMakeFiles") || + (cmSystemTools::FileExists(tmp.c_str()))) { this->Blacklist.push_back(nextFile); - } } } } } - this->CreateNewProjectFile(outputDir, projectDir, filename, - executable, cmakeFilePattern, - fileToOpen, sessionFilename); } - + this->CreateNewProjectFile(outputDir, projectDir, filename, executable, + cmakeFilePattern, fileToOpen, sessionFilename); + } } -void cmGlobalKdevelopGenerator -::MergeProjectFiles(const std::string& outputDir, - const std::string& projectDir, - const std::string& filename, - const std::string& executable, - const std::string& cmakeFilePattern, - const std::string& fileToOpen, - const std::string& sessionFilename) +void cmGlobalKdevelopGenerator::MergeProjectFiles( + const std::string& outputDir, const std::string& projectDir, + const std::string& filename, const std::string& executable, + const std::string& cmakeFilePattern, const std::string& fileToOpen, + const std::string& sessionFilename) { cmsys::ifstream oldProjectFile(filename.c_str()); - if (!oldProjectFile) - { - this->CreateNewProjectFile(outputDir, projectDir, filename, - executable, cmakeFilePattern, - fileToOpen, sessionFilename); + if (!oldProjectFile) { + this->CreateNewProjectFile(outputDir, projectDir, filename, executable, + cmakeFilePattern, fileToOpen, sessionFilename); return; - } + } /* Read the existing project file (line by line), copy all lines into the new project file, except the ones which can be reliably set from contents of the CMakeLists.txt */ std::string tmp; std::vector<std::string> lines; - while (cmSystemTools::GetLineFromStream(oldProjectFile, tmp)) - { + while (cmSystemTools::GetLineFromStream(oldProjectFile, tmp)) { lines.push_back(tmp); - } + } oldProjectFile.close(); cmGeneratedFileStream fout(filename.c_str()); - if(!fout) - { + if (!fout) { return; - } + } - for (std::vector<std::string>::const_iterator it=lines.begin(); - it!=lines.end(); it++) - { - const char* line=(*it).c_str(); + for (std::vector<std::string>::const_iterator it = lines.begin(); + it != lines.end(); it++) { + const char* line = (*it).c_str(); // skip these tags as they are always replaced - if ((strstr(line, "<projectdirectory>")!=0) - || (strstr(line, "<projectmanagement>")!=0) - || (strstr(line, "<absoluteprojectpath>")!=0) - || (strstr(line, "<filelistdirectory>")!=0) - || (strstr(line, "<buildtool>")!=0) - || (strstr(line, "<builddir>")!=0)) - { + if ((strstr(line, "<projectdirectory>") != 0) || + (strstr(line, "<projectmanagement>") != 0) || + (strstr(line, "<absoluteprojectpath>") != 0) || + (strstr(line, "<filelistdirectory>") != 0) || + (strstr(line, "<buildtool>") != 0) || + (strstr(line, "<builddir>") != 0)) { continue; - } + } // output the line from the file if it is not one of the above tags - fout<<*it<<"\n"; + fout << *it << "\n"; // if this is the <general> tag output the stuff that goes in the // general tag - if (strstr(line, "<general>")) - { - fout<< " <projectmanagement>KDevCustomProject</projectmanagement>\n"; - fout<< " <projectdirectory>" <<projectDir - << "</projectdirectory>\n"; //this one is important - fout<<" <absoluteprojectpath>true</absoluteprojectpath>\n"; - //and this one - } + if (strstr(line, "<general>")) { + fout << " <projectmanagement>KDevCustomProject</projectmanagement>\n"; + fout << " <projectdirectory>" << projectDir + << "</projectdirectory>\n"; // this one is important + fout << " <absoluteprojectpath>true</absoluteprojectpath>\n"; + // and this one + } // inside kdevcustomproject the <filelistdirectory> must be put - if (strstr(line, "<kdevcustomproject>")) - { - fout<<" <filelistdirectory>"<<outputDir - <<"</filelistdirectory>\n"; - } + if (strstr(line, "<kdevcustomproject>")) { + fout << " <filelistdirectory>" << outputDir + << "</filelistdirectory>\n"; + } // buildtool and builddir go inside <build> - if (strstr(line, "<build>")) - { - fout<<" <buildtool>make</buildtool>\n"; - fout<<" <builddir>"<<outputDir<<"</builddir>\n"; - } + if (strstr(line, "<build>")) { + fout << " <buildtool>make</buildtool>\n"; + fout << " <builddir>" << outputDir << "</builddir>\n"; } + } } -void cmGlobalKdevelopGenerator -::CreateNewProjectFile(const std::string& outputDir, - const std::string& projectDir, - const std::string& filename, - const std::string& executable, - const std::string& cmakeFilePattern, - const std::string& fileToOpen, - const std::string& sessionFilename) +void cmGlobalKdevelopGenerator::CreateNewProjectFile( + const std::string& outputDir, const std::string& projectDir, + const std::string& filename, const std::string& executable, + const std::string& cmakeFilePattern, const std::string& fileToOpen, + const std::string& sessionFilename) { cmGeneratedFileStream fout(filename.c_str()); - if(!fout) - { + if (!fout) { return; - } + } cmXMLWriter xml(fout); // check for a version control system bool hasSvn = cmSystemTools::FileExists((projectDir + "/.svn").c_str()); bool hasCvs = cmSystemTools::FileExists((projectDir + "/CVS").c_str()); - bool enableCxx = (this->GlobalGenerator->GetLanguageEnabled("C") - || this->GlobalGenerator->GetLanguageEnabled("CXX")); + bool enableCxx = (this->GlobalGenerator->GetLanguageEnabled("C") || + this->GlobalGenerator->GetLanguageEnabled("CXX")); bool enableFortran = this->GlobalGenerator->GetLanguageEnabled("Fortran"); std::string primaryLanguage = "C++"; - if (enableFortran && !enableCxx) - { - primaryLanguage="Fortran77"; - } + if (enableFortran && !enableCxx) { + primaryLanguage = "Fortran77"; + } xml.StartDocument(); xml.StartElement("kdevelop"); @@ -428,24 +368,19 @@ void cmGlobalKdevelopGenerator // setup additional languages xml.StartElement("secondaryLanguages"); - if (enableFortran && enableCxx) - { + if (enableFortran && enableCxx) { xml.Element("language", "Fortran"); - } - if (enableCxx) - { + } + if (enableCxx) { xml.Element("language", "C"); - } + } xml.EndElement(); - if (hasSvn) - { + if (hasSvn) { xml.Element("versioncontrol", "kdevsubversion"); - } - else if (hasCvs) - { + } else if (hasCvs) { xml.Element("versioncontrol", "kdevcvsservice"); - } + } xml.EndElement(); // general xml.StartElement("kdevcustomproject"); @@ -471,8 +406,9 @@ void cmGlobalKdevelopGenerator xml.Element("abortonerror", "false"); xml.Element("numberofjobs", 1); xml.Element("dontact", "false"); - xml.Element("makebin", this->GlobalGenerator->GetLocalGenerators()[0]-> - GetMakefile()->GetRequiredDefinition("CMAKE_MAKE_PROGRAM")); + xml.Element("makebin", this->GlobalGenerator->GetLocalGenerators()[0] + ->GetMakefile() + ->GetRequiredDefinition("CMAKE_MAKE_PROGRAM")); xml.Element("selectedenvironment", "default"); xml.StartElement("environments"); @@ -493,12 +429,11 @@ void cmGlobalKdevelopGenerator xml.EndElement(); // make xml.StartElement("blacklist"); - for(std::vector<std::string>::const_iterator dirIt=this->Blacklist.begin(); - dirIt != this->Blacklist.end(); - ++dirIt) - { + for (std::vector<std::string>::const_iterator dirIt = + this->Blacklist.begin(); + dirIt != this->Blacklist.end(); ++dirIt) { xml.Element("path", *dirIt); - } + } xml.EndElement(); xml.EndElement(); // kdevcustomproject @@ -534,8 +469,7 @@ void cmGlobalKdevelopGenerator xml.Element("ignoredevhelp"); xml.EndElement(); // kdevdoctreeview; - if (enableCxx) - { + if (enableCxx) { xml.StartElement("cppsupportpart"); xml.StartElement("filetemplates"); xml.Element("interfacesuffix", ".h"); @@ -558,10 +492,9 @@ void cmGlobalKdevelopGenerator xml.EndElement(); // codecompletion xml.Element("references"); xml.EndElement(); // kdevcppsupport; - } + } - if (enableFortran) - { + if (enableFortran) { xml.StartElement("kdevfortransupport"); xml.StartElement("ftnchek"); xml.Element("division", "false"); @@ -582,7 +515,7 @@ void cmGlobalKdevelopGenerator xml.Element("portabilityonly"); xml.EndElement(); // ftnchek xml.EndElement(); // kdevfortransupport; - } + } // set up file groups. maybe this can be used with the CMake SOURCE_GROUP() // command @@ -594,8 +527,7 @@ void cmGlobalKdevelopGenerator xml.Attribute("name", "CMake"); xml.EndElement(); - if (enableCxx) - { + if (enableCxx) { xml.StartElement("group"); xml.Attribute("pattern", "*.h;*.hxx;*.hpp"); xml.Attribute("name", "Header"); @@ -610,16 +542,15 @@ void cmGlobalKdevelopGenerator xml.Attribute("pattern", "*.cpp;*.C;*.cxx;*.cc"); xml.Attribute("name", "C++ Sources"); xml.EndElement(); - } + } - if (enableFortran) - { + if (enableFortran) { xml.StartElement("group"); xml.Attribute("pattern", - "*.f;*.F;*.f77;*.F77;*.f90;*.F90;*.for;*.f95;*.F95"); + "*.f;*.F;*.f77;*.F77;*.f90;*.F90;*.for;*.f95;*.F95"); xml.Attribute("name", "Fortran Sources"); xml.EndElement(); - } + } xml.StartElement("group"); xml.Attribute("pattern", "*.ui"); @@ -638,18 +569,16 @@ void cmGlobalKdevelopGenerator xml.EndElement(); // kdevelop; xml.EndDocument(); - if (sessionFilename.empty()) - { + if (sessionFilename.empty()) { return; - } + } // and a session file, so that kdevelop opens a file if it opens the // project the first time cmGeneratedFileStream devses(sessionFilename.c_str()); - if(!devses) - { + if (!devses) { return; - } + } cmXMLWriter sesxml(devses); sesxml.StartDocument("UTF-8"); sesxml.Doctype("KDevPrjSession"); |