summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalKdevelopGenerator.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-26 23:27:33 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-26 23:27:33 (GMT)
commite5dc217f4ee2848ff7a3e36b0fc25bb6f6ed87b4 (patch)
treebd7e5345ede9e1f0b77b745c28260b1e87d85084 /Source/cmGlobalKdevelopGenerator.cxx
parent983e2a9a51939de3c65f22468ef6a47f3147feb5 (diff)
downloadCMake-e5dc217f4ee2848ff7a3e36b0fc25bb6f6ed87b4.zip
CMake-e5dc217f4ee2848ff7a3e36b0fc25bb6f6ed87b4.tar.gz
CMake-e5dc217f4ee2848ff7a3e36b0fc25bb6f6ed87b4.tar.bz2
ENH: add all subdirs of the project to the kdevelop blacklist, so kdevelop
doesn't watch these dirs for added or remved files everytime it is started Alex
Diffstat (limited to 'Source/cmGlobalKdevelopGenerator.cxx')
-rw-r--r--Source/cmGlobalKdevelopGenerator.cxx42
1 files changed, 40 insertions, 2 deletions
diff --git a/Source/cmGlobalKdevelopGenerator.cxx b/Source/cmGlobalKdevelopGenerator.cxx
index aa01d8e..90dedd9 100644
--- a/Source/cmGlobalKdevelopGenerator.cxx
+++ b/Source/cmGlobalKdevelopGenerator.cxx
@@ -23,8 +23,10 @@
#include "cmake.h"
#include "cmSourceFile.h"
#include "cmGeneratedFileStream.h"
+#include "cmSystemTools.h"
#include <cmsys/SystemTools.hxx>
+#include <cmsys/Directory.hxx>
//----------------------------------------------------------------------------
void cmGlobalKdevelopGenerator
@@ -273,6 +275,32 @@ void cmGlobalKdevelopGenerator
const std::string& cmakeFilePattern,
const std::string& fileToOpen)
{
+ // add all subdirectories to the kdevelop blacklist
+ // so they are not monitored for added or removed files
+ // since this is basically handled by adding files to the
+ // cmake files
+ this->Blacklist.clear();
+ cmsys::Directory d;
+ if (d.Load(projectDir.c_str()))
+ {
+ unsigned int i;
+ size_t numf = d.GetNumberOfFiles();
+ for (unsigned int i = 0; i < numf; i++)
+ {
+ std::string nextFile = d.GetFile(i);
+ if ((nextFile!=".") && (nextFile!=".."))
+ {
+ std::string tmp = projectDir;
+ tmp += "/";
+ tmp += nextFile;
+ if (cmSystemTools::FileIsDirectory(tmp.c_str()))
+ {
+ this->Blacklist.push_back(nextFile);
+ }
+ }
+ }
+ }
+
std::string filename=outputDir+"/";
filename+=projectname+".kdevelop";
std::string sessionFilename=outputDir+"/";
@@ -290,7 +318,7 @@ void cmGlobalKdevelopGenerator
executable, cmakeFilePattern,
fileToOpen, sessionFilename);
}
-
+
}
void cmGlobalKdevelopGenerator
@@ -388,7 +416,7 @@ void cmGlobalKdevelopGenerator
// check for a version control system
bool hasSvn = cmSystemTools::FileExists((projectDir + "/.svn").c_str());
bool hasCvs = cmSystemTools::FileExists((projectDir + "/CVS").c_str());
-
+
fout<<"<?xml version = '1.0'?>\n";
fout<<"<kdevelop>\n";
fout<<" <general>\n";
@@ -441,6 +469,16 @@ void cmGlobalKdevelopGenerator
fout<<" <default/>\n";
fout<<" </environments>\n";
fout<<" </make>\n";
+
+ fout<<" <blacklist>\n";
+ for(std::vector<std::string>::const_iterator dirIt=this->Blacklist.begin();
+ dirIt != this->Blacklist.end();
+ ++dirIt)
+ {
+ fout<<" <path>"<<dirIt->c_str()<<"</path>\n";
+ }
+ fout<<" </blacklist>\n";
+
fout<<" </kdevcustomproject>\n";
fout<<" <kdevfilecreate>\n";
fout<<" <filetypes/>\n";