diff options
author | Brad King <brad.king@kitware.com> | 2008-01-17 23:13:55 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-01-17 23:13:55 (GMT) |
commit | caca9b80652c7c36ed1e39e1faeec64e3397f632 (patch) | |
tree | ed463885ac3f417fdc6838367019615fafef4108 /Source/cmMakefile.cxx | |
parent | 9e8a1c639a92a1c2e37f0beefb62204930e7e61e (diff) | |
download | CMake-caca9b80652c7c36ed1e39e1faeec64e3397f632.zip CMake-caca9b80652c7c36ed1e39e1faeec64e3397f632.tar.gz CMake-caca9b80652c7c36ed1e39e1faeec64e3397f632.tar.bz2 |
ENH: Add AppendProperty methods for use by C++ code in CMake. Simplify implementation of SET_PROPERTY command by using them.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index 1b3ca61..104d007 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2613,6 +2613,42 @@ void cmMakefile::SetProperty(const char* prop, const char* value) this->Properties.SetProperty(prop,value,cmProperty::DIRECTORY); } +void cmMakefile::AppendProperty(const char* prop, const char* value) +{ + if (!prop) + { + return; + } + + // handle special props + std::string propname = prop; + if ( propname == "INCLUDE_DIRECTORIES" ) + { + std::vector<std::string> varArgsExpanded; + cmSystemTools::ExpandListArgument(value, varArgsExpanded); + for(std::vector<std::string>::const_iterator vi = varArgsExpanded.begin(); + vi != varArgsExpanded.end(); ++vi) + { + this->AddIncludeDirectory(vi->c_str()); + } + return; + } + + if ( propname == "LINK_DIRECTORIES" ) + { + std::vector<std::string> varArgsExpanded; + cmSystemTools::ExpandListArgument(value, varArgsExpanded); + for(std::vector<std::string>::const_iterator vi = varArgsExpanded.begin(); + vi != varArgsExpanded.end(); ++vi) + { + this->AddLinkDirectory(vi->c_str()); + } + return; + } + + this->Properties.AppendProperty(prop,value,cmProperty::DIRECTORY); +} + const char *cmMakefile::GetPropertyOrDefinition(const char* prop) { const char *ret = this->GetProperty(prop, cmProperty::DIRECTORY); |