diff options
author | Ken Martin <ken.martin@kitware.com> | 2006-03-22 19:06:52 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2006-03-22 19:06:52 (GMT) |
commit | 10efe3b079caf5237e01d31b09f7947c77c7458f (patch) | |
tree | 4df9c11b285a62fdeb1c7868520e9303f95fd26e /Source/cmMakefile.cxx | |
parent | 43b9f184c2f9cacce2917577f9469f71f64885c5 (diff) | |
download | CMake-10efe3b079caf5237e01d31b09f7947c77c7458f.zip CMake-10efe3b079caf5237e01d31b09f7947c77c7458f.tar.gz CMake-10efe3b079caf5237e01d31b09f7947c77c7458f.tar.bz2 |
ENH: added some new functionality
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 2c94ab6..08223cb 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -391,6 +391,9 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char *external_in) } } + // push the listfile onto the stack + this->ListFileStack.push_back(filenametoread); + cmListFile cacheFile; if( !cacheFile.ParseFile(filenametoread, requireProjectCommand) ) { @@ -405,6 +408,8 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char *external_in) this->ExecuteCommand(cacheFile.Functions[i]); if ( cmSystemTools::GetFatalErrorOccured() ) { + // pop the listfile off the stack + this->ListFileStack.pop_back(); this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentFile.c_str()); return true; } @@ -428,6 +433,10 @@ bool cmMakefile::ReadListFile(const char* filename_in, const char *external_in) } this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentFile.c_str()); + + // pop the listfile off the stack + this->ListFileStack.pop_back(); + return true; } @@ -2430,8 +2439,29 @@ void cmMakefile::SetProperty(const char* prop, const char* value) this->Properties[prop] = value; } -const char *cmMakefile::GetProperty(const char* prop) const +const char *cmMakefile::GetProperty(const char* prop) { + // watch for specific properties + if (!strcmp("PARENT_DIRECTORY",prop)) + { + return this->LocalGenerator->GetParent() + ->GetMakefile()->GetStartDirectory(); + } + // watch for specific properties + if (!strcmp("LISTFILE_STACK",prop)) + { + std::string tmp; + for (std::deque<cmStdString>::iterator i = this->ListFileStack.begin(); + i != this->ListFileStack.end(); ++i) + { + if (i != this->ListFileStack.begin()) + { + tmp += ";"; + } + tmp += *i; + } + this->SetProperty("LISTFILE_STACK",tmp.c_str()); + } std::map<cmStdString,cmStdString>::const_iterator i = this->Properties.find(prop); if (i != this->Properties.end()) |