summaryrefslogtreecommitdiff
path: root/Source/cmakemain.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2008-10-15 13:56:07 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2008-10-15 13:56:07 -0400
commit1777bb502a3c8dbcead54b11fe403e13fe9c225c (patch)
treee85da2c575bc1e88254287b220e4e236065f3285 /Source/cmakemain.cxx
parente099dccf4b3772c10c076ec1044dae01da510d28 (diff)
downloadcmake-1777bb502a3c8dbcead54b11fe403e13fe9c225c.tar.gz
BUG: 4244, add a --build option to cmake that can build projects configured by CMake
Diffstat (limited to 'Source/cmakemain.cxx')
-rw-r--r--Source/cmakemain.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
index 0aaf58194e..46a17ef0d8 100644
--- a/Source/cmakemain.cxx
+++ b/Source/cmakemain.cxx
@@ -85,6 +85,11 @@ static const char * cmDocumentationOptions[][3] =
"variables being created. If A is specified, then it will display also "
"advanced variables. If H is specified, it will also display help for "
"each variable."},
+ {"--build dir", "Build a configured cmake tree found in dir.",
+ "This option will use the native build tool from the command line to"
+ " build the project. Other options that can be specified with this one"
+ " are --target, --config, --extra-options, and --clean. For complete "
+ "help run --build with no options."},
{"-N", "View mode only.",
"Only load the cache. Do not actually run configure and generate steps."},
{"-P <file>", "Process script mode.",
@@ -407,6 +412,7 @@ int do_cmake(int ac, char** av)
bool list_help = false;
bool view_only = false;
bool script_mode = false;
+ bool build = false;
std::vector<std::string> args;
for(int i =0; i < ac; ++i)
{
@@ -414,6 +420,10 @@ int do_cmake(int ac, char** av)
{
wiz = true;
}
+ else if(!command && strcmp(av[i], "--build") == 0)
+ {
+ return cmake::DoBuild(ac, av);
+ }
else if(!command && strcmp(av[i], "--system-information") == 0)
{
sysinfo = true;
@@ -465,6 +475,11 @@ int do_cmake(int ac, char** av)
args.push_back(av[i]);
}
}
+ if(build)
+ {
+ int ret = cmake::DoBuild(ac, av);
+ return ret;
+ }
if(command)
{
int ret = cmake::ExecuteCMakeCommand(args);