summaryrefslogtreecommitdiffstats
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
authorClinton Stimpson <clinton@elemtech.com>2013-12-18 21:38:56 (GMT)
committerClinton Stimpson <clinton@elemtech.com>2014-01-04 17:43:12 (GMT)
commita1e542f19551072f101404e16e1dad901189f039 (patch)
tree215a0e8627dfabc2e113c5881b52c29aa013abbd /Source/cmakemain.cxx
parent7fb2b806626b9af791d7372d2ff82b2cf1503237 (diff)
downloadCMake-a1e542f19551072f101404e16e1dad901189f039.zip
CMake-a1e542f19551072f101404e16e1dad901189f039.tar.gz
CMake-a1e542f19551072f101404e16e1dad901189f039.tar.bz2
Use Encoding::CommandLineArguments for main() functions.
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 882b072..fcaa127 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -24,6 +24,7 @@
#include "cmGlobalGenerator.h"
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
+#include <cmsys/Encoding.hxx>
#ifdef CMAKE_BUILD_WITH_CMAKE
//----------------------------------------------------------------------------
@@ -79,7 +80,7 @@ static const char * cmDocumentationOptions[][2] =
#endif
-static int do_command(int ac, char** av)
+static int do_command(int ac, char const* const* av)
{
std::vector<std::string> args;
args.push_back(av[0]);
@@ -90,8 +91,8 @@ static int do_command(int ac, char** av)
return cmcmd::ExecuteCMakeCommand(args);
}
-int do_cmake(int ac, char** av);
-static int do_build(int ac, char** av);
+int do_cmake(int ac, char const* const* av);
+static int do_build(int ac, char const* const* av);
static cmMakefile* cmakemainGetMakefile(void *clientdata)
{
@@ -159,8 +160,13 @@ static void cmakemainProgressCallback(const char *m, float prog,
}
-int main(int ac, char** av)
+int main(int ac, char const* const* av)
{
+ cmsys::Encoding::CommandLineArguments args =
+ cmsys::Encoding::CommandLineArguments::Main(ac, av);
+ ac = args.argc();
+ av = args.argv();
+
cmSystemTools::EnableMSVCDebugHook();
cmSystemTools::FindCMakeResources(av[0]);
if(ac > 1)
@@ -181,7 +187,7 @@ int main(int ac, char** av)
return ret;
}
-int do_cmake(int ac, char** av)
+int do_cmake(int ac, char const* const* av)
{
if ( cmSystemTools::GetCurrentWorkingDirectory().size() == 0 )
{
@@ -352,7 +358,7 @@ int do_cmake(int ac, char** av)
}
//----------------------------------------------------------------------------
-static int do_build(int ac, char** av)
+static int do_build(int ac, char const* const* av)
{
#ifndef CMAKE_BUILD_WITH_CMAKE
std::cerr << "This cmake does not support --build\n";