diff options
author | Brad King <brad.king@kitware.com> | 2009-03-04 20:39:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-03-04 20:39:27 (GMT) |
commit | 170febac528b8f18a6f1b6d8fcb5895d67a8c10b (patch) | |
tree | 40bc6b332a79f9022544214babee411ce6ab3041 /Source/cmake.cxx | |
parent | d35651fb6c59904b3b004474a5501280e694d37c (diff) | |
download | CMake-170febac528b8f18a6f1b6d8fcb5895d67a8c10b.zip CMake-170febac528b8f18a6f1b6d8fcb5895d67a8c10b.tar.gz CMake-170febac528b8f18a6f1b6d8fcb5895d67a8c10b.tar.bz2 |
ENH: Cleanup cmake --build interface.
This cleans up the 'cmake --build' command-line interface:
- Rename --clean to --clean-first to better describe it.
- Replace --extra-options with a -- separator to simplify passing of
multiple native build tool options.
- Document the options in the main CMake man page description of the
--build option, and shares this with the usage message.
- Require --build to be the first argument when present.
- Move implementation into cmakemain where it belongs.
Diffstat (limited to 'Source/cmake.cxx')
-rw-r--r-- | Source/cmake.cxx | 50 |
1 files changed, 2 insertions, 48 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 9a81138..4070755 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -4394,7 +4394,7 @@ std::vector<std::string> const& cmake::GetDebugConfigs() int cmake::Build(const std::string& dir, const std::string& target, const std::string& config, - const std::string& extraBuildOptions, + const std::vector<std::string>& nativeOptions, bool clean) { if(!cmSystemTools::FileIsDirectory(dir.c_str())) @@ -4438,51 +4438,5 @@ int cmake::Build(const std::string& dir, &output, makeProgram.c_str(), config.c_str(), clean, false, 0, true, - extraBuildOptions.c_str()); -} - -int cmake::DoBuild(int ac, char* av[]) -{ -#ifndef CMAKE_BUILD_WITH_CMAKE - std::cerr << "This cmake does not support --build\n"; - return -1; -#else - std::string target; - std::string config = "Debug"; - std::string extraBuildOptions; - std::string dir; - bool clean = false; - cmsys::CommandLineArguments arg; - arg.Initialize(ac, av); - typedef cmsys::CommandLineArguments argT; - arg.AddArgument("--build", argT::SPACE_ARGUMENT, &dir, - "Build a configured cmake project --build dir."); - arg.AddArgument("--target", argT::SPACE_ARGUMENT, &target, - "Specifiy the target to build," - " if missing, all targets are built."); - arg.AddArgument("--config", argT::SPACE_ARGUMENT, &config, - "Specify configuration to build" - " if missing Debug is built."); - arg.AddArgument("--extra-options", argT::SPACE_ARGUMENT, &extraBuildOptions, - "Specify extra options to pass to build program," - " for example with gmake -jN."); - arg.AddArgument("--clean", argT::NO_ARGUMENT, &clean, - "Clean before building."); - if ( !arg.Parse() ) - { - std::cerr << "Problem parsing --build arguments:\n"; - std::cerr << arg.GetHelp() << "\n"; - return 1; - } - - // Hack for vs6 that passes ".\Debug" as "$(IntDir)" value: - // - if (cmSystemTools::StringStartsWith(config.c_str(), ".\\")) - { - config = config.substr(2); - } - - cmake cm; - return cm.Build(dir, target, config, extraBuildOptions, clean); -#endif + 0, nativeOptions); } |