summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-02-03 02:17:23 (GMT)
committerDavid Cole <david.cole@kitware.com>2011-02-03 02:19:01 (GMT)
commit106958c047c9af783b0216916c8e0d8c52595ff6 (patch)
treebf0cf3c08822dda3fe0cdf360128f971e89d3e4f /Source/cmMakefile.cxx
parent94d1684a8fd0de4310874cd582636a8e26402da2 (diff)
downloadCMake-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.cxx16
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)
{