diff options
author | David Cole <david.cole@kitware.com> | 2011-02-03 02:17:23 (GMT) |
---|---|---|
committer | David Cole <david.cole@kitware.com> | 2011-02-03 02:19:01 (GMT) |
commit | 106958c047c9af783b0216916c8e0d8c52595ff6 (patch) | |
tree | bf0cf3c08822dda3fe0cdf360128f971e89d3e4f /Source/cmMakefile.cxx | |
parent | 94d1684a8fd0de4310874cd582636a8e26402da2 (diff) | |
download | CMake-106958c047c9af783b0216916c8e0d8c52595ff6.zip CMake-106958c047c9af783b0216916c8e0d8c52595ff6.tar.gz CMake-106958c047c9af783b0216916c8e0d8c52595ff6.tar.bz2 |
Add CMAKE_ARGC and CMAKE_ARGV0..N-1 variables (#2828)
For now, these variables are only available in -P script mode.
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r-- | Source/cmMakefile.cxx | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index daea7bf..3fa846a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -2749,6 +2749,22 @@ void cmMakefile::SetScriptModeFile(const char* scriptfile) this->AddDefinition("CMAKE_SCRIPT_MODE_FILE", scriptfile); } +void cmMakefile::SetArgcArgv(const std::vector<std::string>& args) +{ + cmOStringStream strStream; + strStream << args.size(); + this->AddDefinition("CMAKE_ARGC", strStream.str().c_str()); + //this->MarkVariableAsUsed("CMAKE_ARGC"); + + for (unsigned int t = 0; t < args.size(); ++t) + { + cmOStringStream tmpStream; + tmpStream << "CMAKE_ARGV" << t; + this->AddDefinition(tmpStream.str().c_str(), args[t].c_str()); + //this->MarkVariableAsUsed(tmpStream.str().c_str()); + } +} + //---------------------------------------------------------------------------- cmSourceFile* cmMakefile::GetSource(const char* sourceName) { |