summaryrefslogtreecommitdiffstats
path: root/Source/cmcmd.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-07-11 17:41:30 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2019-07-11 17:41:30 (GMT)
commitb8828ecbbab89f7ab4f99ee0905ab380d855744a (patch)
tree04433ed345d20f4d89a503a666ba17e1605d1734 /Source/cmcmd.cxx
parent0a690fc47427a2ed5656cb0dd4bc17aa172e143a (diff)
downloadCMake-b8828ecbbab89f7ab4f99ee0905ab380d855744a.zip
CMake-b8828ecbbab89f7ab4f99ee0905ab380d855744a.tar.gz
CMake-b8828ecbbab89f7ab4f99ee0905ab380d855744a.tar.bz2
cmake -E: Add true and false commands
Diffstat (limited to 'Source/cmcmd.cxx')
-rw-r--r--Source/cmcmd.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmcmd.cxx b/Source/cmcmd.cxx
index effc094..503dce1 100644
--- a/Source/cmcmd.cxx
+++ b/Source/cmcmd.cxx
@@ -114,6 +114,8 @@ void CMakeCommandUsage(const char* program)
<< " touch <file>... - touch a <file>.\n"
<< " touch_nocreate <file>... - touch a <file> but do not create it.\n"
<< " create_symlink old new - create a symbolic link new -> old\n"
+ << " true - do nothing with an exit code of 0\n"
+ << " false - do nothing with an exit code of 1\n"
#if defined(_WIN32) && !defined(__CYGWIN__)
<< "Available on Windows only:\n"
<< " delete_regv key - delete registry value\n"
@@ -891,6 +893,16 @@ int cmcmd::ExecuteCMakeCommand(std::vector<std::string> const& args)
return 0;
}
+ // Command to do nothing with an exit code of 0.
+ if (args[1] == "true") {
+ return 0;
+ }
+
+ // Command to do nothing with an exit code of 1.
+ if (args[1] == "false") {
+ return 1;
+ }
+
// Internal CMake shared library support.
if (args[1] == "cmake_symlink_library" && args.size() == 5) {
return cmcmd::SymlinkLibrary(args);