summaryrefslogtreecommitdiffstats
path: root/Source/cmGetCMakePropertyCommand.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-02-02 23:18:14 (GMT)
committerDavid Cole <david.cole@kitware.com>2011-02-02 23:18:14 (GMT)
commit94d1684a8fd0de4310874cd582636a8e26402da2 (patch)
tree1c0d1dbdb4f8aedc046d6c6329002ce87f679ea7 /Source/cmGetCMakePropertyCommand.cxx
parent4f1e1fe7821da7d5af17d18f031f72daa05c89e1 (diff)
downloadCMake-94d1684a8fd0de4310874cd582636a8e26402da2.zip
CMake-94d1684a8fd0de4310874cd582636a8e26402da2.tar.gz
CMake-94d1684a8fd0de4310874cd582636a8e26402da2.tar.bz2
Add CMAKE_SCRIPT_MODE_FILE variable (#2828)
New CMake variable is set when processing a -P script file, but not when configuring a project.
Diffstat (limited to 'Source/cmGetCMakePropertyCommand.cxx')
-rw-r--r--Source/cmGetCMakePropertyCommand.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/Source/cmGetCMakePropertyCommand.cxx b/Source/cmGetCMakePropertyCommand.cxx
index e3448de..8bb5487 100644
--- a/Source/cmGetCMakePropertyCommand.cxx
+++ b/Source/cmGetCMakePropertyCommand.cxx
@@ -22,21 +22,22 @@ bool cmGetCMakePropertyCommand
this->SetError("called with incorrect number of arguments");
return false;
}
-
+
std::vector<std::string>::size_type cc;
std::string variable = args[0];
std::string output = "NOTFOUND";
- if ( args[1] == "VARIABLES")
+ if ( args[1] == "VARIABLES" )
{
int cacheonly = 0;
std::vector<std::string> vars = this->Makefile->GetDefinitions(cacheonly);
- for ( cc = 0; cc < vars.size(); cc ++ )
+ if (vars.size()>0)
{
- if ( cc > 0 )
- {
- output += ";";
- }
+ output = vars[0];
+ }
+ for ( cc = 1; cc < vars.size(); ++cc )
+ {
+ output += ";";
output += vars[cc];
}
}
@@ -62,15 +63,15 @@ bool cmGetCMakePropertyCommand
}
else
{
- const char *prop =
+ const char *prop =
this->Makefile->GetCMakeInstance()->GetProperty(args[1].c_str());
if (prop)
{
output = prop;
}
}
+
this->Makefile->AddDefinition(variable.c_str(), output.c_str());
-
+
return true;
}
-