diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2016-06-30 13:38:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2016-08-16 17:45:05 (GMT) |
commit | 49ad7f9af84dd46e5527e6fefaa47d8bde748bca (patch) | |
tree | 2b12ae61ca840d2b6581f3ccbf12296cffc5e6b7 /Source/cmcmd.cxx | |
parent | 1d408dc10f492d060b8b9546c3ed3521d7051fd8 (diff) | |
download | CMake-49ad7f9af84dd46e5527e6fefaa47d8bde748bca.zip CMake-49ad7f9af84dd46e5527e6fefaa47d8bde748bca.tar.gz CMake-49ad7f9af84dd46e5527e6fefaa47d8bde748bca.tar.bz2 |
cmake: Add `cmake -E capabilities` mode
Add `cmake -E capabilities` to report on generators, cmake version and
possibly other static capabilities of cmake.
Closes: #15462
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r-- | Source/cmcmd.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx index 9d0337a..be023b1 100644 --- a/Source/cmcmd.cxx +++ b/Source/cmcmd.cxx @@ -60,6 +60,8 @@ void CMakeCommandUsage(const char* program) errorStream << "Usage: " << program << " -E <command> [arguments...]\n" << "Available commands: \n" + << " capabilities - Report capabilities built into cmake " + "in JSON format\n" << " chdir dir cmd [args...] - run command in a given directory\n" << " compare_files file1 file2 - check if file1 is same as file2\n" << " copy <file>... destination - copy files to destination " @@ -510,6 +512,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string>& args) } return 0; } + // capabilities + else if (args[1] == "capabilities") { + if (args.size() > 2) { + std::cerr << "-E capabilities accepts no additional arguments\n"; + return 1; + } + cmake cm; + std::cout << cm.ReportCapabilities(); + return 0; + } // Sleep command else if (args[1] == "sleep" && args.size() > 2) { |