diff options
author | Ken Martin <ken.martin@kitware.com> | 2006-12-13 17:19:59 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2006-12-13 17:19:59 (GMT) |
commit | 5d11564c35b7c7f7a578e848b926a63746c3bcf3 (patch) | |
tree | 0abed46cb0dc0ad9f3d458d43188958cb15f9f63 /Source/cmSourceFile.cxx | |
parent | e1a142f033f3842e19cd207c32fad384a0384772 (diff) | |
download | CMake-5d11564c35b7c7f7a578e848b926a63746c3bcf3.zip CMake-5d11564c35b7c7f7a578e848b926a63746c3bcf3.tar.gz CMake-5d11564c35b7c7f7a578e848b926a63746c3bcf3.tar.bz2 |
ENH: allow source file properties to chain to Directories and up
Diffstat (limited to 'Source/cmSourceFile.cxx')
-rw-r--r-- | Source/cmSourceFile.cxx | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index 52148b2..4fc74e8 100644 --- a/Source/cmSourceFile.cxx +++ b/Source/cmSourceFile.cxx @@ -18,6 +18,7 @@ #include "cmSystemTools.h" #include "cmake.h" +#include "cmMakefile.h" // Set the name of the class and the full path to the file. // The class must be found in dir and end in name.cxx, name.txx, @@ -193,8 +194,14 @@ const char *cmSourceFile::GetProperty(const char* prop) const } bool chain = false; - return this->Properties.GetPropertyValue(prop,cmProperty::SOURCE_FILE, - chain); + const char *retVal = + this->Properties.GetPropertyValue(prop, cmProperty::SOURCE_FILE, chain); + if (chain) + { + return this->Makefile->GetProperty(prop,cmProperty::SOURCE_FILE); + } + + return retVal; } bool cmSourceFile::GetPropertyAsBool(const char* prop) const @@ -223,9 +230,20 @@ const std::string& cmSourceFile::GetSourceNameWithoutLastExtension() cmSourceFile::cmSourceFile() { + this->Makefile = 0; this->CustomCommand = 0; } +//---------------------------------------------------------------------------- +void cmSourceFile::SetMakefile(cmMakefile* mf) +{ + // Set our makefile. + this->Makefile = mf; + + // set the cmake instance of the properties + this->Properties.SetCMakeInstance(mf->GetCMakeInstance()); +} + // define properties void cmSourceFile::DefineProperties(cmake *cm) { |