summaryrefslogtreecommitdiffstats
path: root/Source/cmGetCMakePropertyCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2007-06-25 13:51:37 (GMT)
committerKen Martin <ken.martin@kitware.com>2007-06-25 13:51:37 (GMT)
commit509f1fb9cb2d23938f4f4217a7f51597fa4af18a (patch)
treefcaaa9a18d57d26b72b108859ebd6844055170f6 /Source/cmGetCMakePropertyCommand.cxx
parent2d1c85ade3f7824eeb3f342f4a96a8843ee7b7b8 (diff)
downloadCMake-509f1fb9cb2d23938f4f4217a7f51597fa4af18a.zip
CMake-509f1fb9cb2d23938f4f4217a7f51597fa4af18a.tar.gz
CMake-509f1fb9cb2d23938f4f4217a7f51597fa4af18a.tar.bz2
ENH: some property cleanup and added GetProperty
Diffstat (limited to 'Source/cmGetCMakePropertyCommand.cxx')
-rw-r--r--Source/cmGetCMakePropertyCommand.cxx33
1 files changed, 8 insertions, 25 deletions
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx
index 65e7ed4..21ef549 100644
--- a/Source/cmGetCMakePropertyCommand.cxx
+++ b/Source/cmGetCMakePropertyCommand.cxx
@@ -30,15 +30,11 @@ bool cmGetCMakePropertyCommand::InitialPass(
std::vector<std::string>::size_type cc;
std::string variable = args[0];
- std::string output = "";
+ std::string output = "NOTFOUND";
- if ( args[1] == "VARIABLES" || args[1] == "CACHE_VARIABLES" )
+ if ( args[1] == "VARIABLES")
{
int cacheonly = 0;
- if ( args[1] == "CACHE_VARIABLES" )
- {
- cacheonly = 1;
- }
std::vector<std::string> vars = this->Makefile->GetDefinitions(cacheonly);
for ( cc = 0; cc < vars.size(); cc ++ )
{
@@ -49,31 +45,18 @@ bool cmGetCMakePropertyCommand::InitialPass(
output += vars[cc];
}
}
- else if ( args[1] == "COMMANDS" )
- {
- cmake::RegisteredCommandsMap::iterator cmds
- = this->Makefile->GetCMakeInstance()->GetCommands()->begin();
- for (cc=0 ;
- cmds != this->Makefile->GetCMakeInstance()->GetCommands()->end();
- ++ cmds )
- {
- if ( cc > 0 )
- {
- output += ";";
- }
- output += cmds->first.c_str();
- cc++;
- }
- }
else if ( args[1] == "MACROS" )
{
this->Makefile->GetListOfMacros(output);
}
else
{
- std::string emsg = "Unknown CMake property: " + args[1];
- this->SetError(emsg.c_str());
- return false;
+ const char *prop =
+ this->Makefile->GetCMakeInstance()->GetProperty(args[1].c_str());
+ if (prop)
+ {
+ output = prop;
+ }
}
this->Makefile->AddDefinition(variable.c_str(), output.c_str());