diff options
author | Brad King <brad.king@kitware.com> | 2011-02-22 19:32:48 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2011-02-22 19:32:48 (GMT) |
commit | 6250c7324f874060f43cf760d8ad349add7fb5e2 (patch) | |
tree | 222c20c56b64293d6d0b69274862df03ac25b959 /Source/cmGetCMakePropertyCommand.cxx | |
parent | 6dc8c252266f2464ce8067eea2897818067be53d (diff) | |
parent | a58ace68ce3a0ca69d0f7e3f103eab65d7302a9a (diff) | |
download | CMake-6250c7324f874060f43cf760d8ad349add7fb5e2.zip CMake-6250c7324f874060f43cf760d8ad349add7fb5e2.tar.gz CMake-6250c7324f874060f43cf760d8ad349add7fb5e2.tar.bz2 |
Merge topic 'fix-2828-more-info-in-script-mode'
a58ace6 Fix KWStyle line-too-long complaint (#2828)
106958c Add CMAKE_ARGC and CMAKE_ARGV0..N-1 variables (#2828)
94d1684 Add CMAKE_SCRIPT_MODE_FILE variable (#2828)
Diffstat (limited to 'Source/cmGetCMakePropertyCommand.cxx')
-rw-r--r-- | Source/cmGetCMakePropertyCommand.cxx | 21 |
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; } - |