summaryrefslogtreecommitdiffstats
path: root/Source/cmGraphVizWriter.cxx
diff options
context:
space:
mode:
authorAlex Neundorf <neundorf@kde.org>2010-11-14 18:47:28 (GMT)
committerAlex Neundorf <neundorf@kde.org>2010-11-14 18:47:28 (GMT)
commit78c86f454272a2ac417ad6a89e4c7ed7e4975adb (patch)
treecc1792b361a1d1c6f3a75c0e0b8d4a81e804d4f7 /Source/cmGraphVizWriter.cxx
parent5ea1e4cb36d813bcb1377637779a54f18411763b (diff)
downloadCMake-78c86f454272a2ac417ad6a89e4c7ed7e4975adb.zip
CMake-78c86f454272a2ac417ad6a89e4c7ed7e4975adb.tar.gz
CMake-78c86f454272a2ac417ad6a89e4c7ed7e4975adb.tar.bz2
Exclude targets from the graphviz file based on a regex
This commit adds support for a GRAPHVIZ_TARGET_IGNORE_REGEX variable which can be set() in CMakeGraphVizOptions.cmake. Targets matching this regex will be skipped when generating the graphviz graphs. Alex
Diffstat (limited to 'Source/cmGraphVizWriter.cxx')
-rw-r--r--Source/cmGraphVizWriter.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/Source/cmGraphVizWriter.cxx b/Source/cmGraphVizWriter.cxx
index 00befec..bdb33bc 100644
--- a/Source/cmGraphVizWriter.cxx
+++ b/Source/cmGraphVizWriter.cxx
@@ -117,6 +117,17 @@ void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
__set_bool_if_set(this->GenerateForSharedLibs, "GRAPHVIZ_SHARED_LIBS");
__set_bool_if_set(this->GenerateForModuleLibs , "GRAPHVIZ_MODULE_LIBS");
+ cmStdString tmpRegexString;
+ __set_if_set(tmpRegexString, "GRAPHVIZ_TARGET_IGNORE_REGEX");
+ if (tmpRegexString.size() > 0)
+ {
+ if (!this->TargetIgnoreRegex.compile(tmpRegexString.c_str()))
+ {
+ std::cerr << "Could not compile bad regex \"" << tmpRegexString << "\""
+ << std::endl;
+ }
+ }
+
this->TargetsToIgnore.clear();
const char* ignoreTargets = mf->GetDefinition("GRAPHVIZ_IGNORE_TARGETS");
if ( ignoreTargets )
@@ -391,8 +402,15 @@ int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
}
-bool cmGraphVizWriter::IgnoreThisTarget(const char* name) const
+bool cmGraphVizWriter::IgnoreThisTarget(const char* name)
{
+ if (this->TargetIgnoreRegex.is_valid())
+ {
+ if (this->TargetIgnoreRegex.find(name))
+ {
+ return true;
+ }
+ }
return (this->TargetsToIgnore.find(name) != this->TargetsToIgnore.end());
}