diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-04-19 21:39:03 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-04-19 21:39:03 (GMT) |
commit | b5f62159ca57dfa074b3985e17df2b2a29ab6d0f (patch) | |
tree | afc12bc65ac93fbba86f360ca8d73eef2fba4867 /Source/cmMakefile.cxx | |
parent | 24bce99cbff13cb337c543dce55f056351caa2fc (diff) | |
download | CMake-b5f62159ca57dfa074b3985e17df2b2a29ab6d0f.zip CMake-b5f62159ca57dfa074b3985e17df2b2a29ab6d0f.tar.gz CMake-b5f62159ca57dfa074b3985e17df2b2a29ab6d0f.tar.bz2 |
added if else endif add definition
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 139bcd0..4dd27b4 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -22,6 +22,7 @@ #include "cmMakefileGenerator.h" #include "cmCommands.h" #include "cmCacheManager.h" +#include "cmFunctionBlocker.h" // default is not to be building executables cmMakefile::cmMakefile() @@ -74,10 +75,10 @@ cmMakefile::~cmMakefile() delete m_MakefileGenerator; } -void cmMakefile::PrintStringVector(const char* s, std::vector<std::string>& v) +void cmMakefile::PrintStringVector(const char* s, const std::vector<std::string>& v) const { std::cout << s << ": ( \n"; - for(std::vector<std::string>::iterator i = v.begin(); + for(std::vector<std::string>::const_iterator i = v.begin(); i != v.end(); ++i) { std::cout << (*i).c_str() << " "; @@ -87,7 +88,7 @@ void cmMakefile::PrintStringVector(const char* s, std::vector<std::string>& v) // call print on all the classes in the makefile -void cmMakefile::Print() +void cmMakefile::Print() const { // print the class lists std::cout << "classes:\n"; @@ -178,7 +179,8 @@ bool cmMakefile::ReadListFile(const char* filename) std::vector<std::string> arguments; while ( fin ) { - if(cmSystemTools::ParseFunction(fin, name, arguments) ) + if(cmSystemTools::ParseFunction(fin, name, arguments) && + !this->IsFunctionBlocked(name.c_str(),arguments)) { // Special command that needs to be removed when // ADD_COMMAND is implemented @@ -681,3 +683,37 @@ cmMakefile::GetClassesFromSourceLists( return result; } +bool cmMakefile::IsFunctionBlocked(const char *name, + std::vector<std::string> &args) const +{ + // loop over all function blockers to see if any block this command + std::set<cmFunctionBlocker *>::const_iterator pos; + for (pos = m_FunctionBlockers.begin(); + pos != m_FunctionBlockers.end(); ++pos) + { + if ((*pos)->IsFunctionBlocked(name, args, *this)) + { + return true; + } + } + + return false; +} + +void cmMakefile::RemoveFunctionBlocker(const char *name, + const std::vector<std::string> &args) +{ + // loop over all function blockers to see if any block this command + std::set<cmFunctionBlocker *>::const_iterator pos; + for (pos = m_FunctionBlockers.begin(); + pos != m_FunctionBlockers.end(); ++pos) + { + if ((*pos)->ShouldRemove(name, args, *this)) + { + m_FunctionBlockers.erase(*pos); + return; + } + } + + return; +} |