summaryrefslogtreecommitdiff
path: root/Source/cmParseArgumentsCommand.h
diff options
context:
space:
mode:
authorMatthias Maennich <matthias@maennich.net>2015-12-05 19:01:12 +0100
committerBrad King <brad.king@kitware.com>2015-12-17 10:44:28 -0500
commite8b148318f1fab26b2289cadc2d0c5e12201169d (patch)
treec18ca5a3415761ae65f8db15162ec250c9e5c10a /Source/cmParseArgumentsCommand.h
parentcbbdfc2b6120e192b4248ce89af93cf34ea8a254 (diff)
downloadcmake-e8b148318f1fab26b2289cadc2d0c5e12201169d.tar.gz
CMakeParseArguments: replace by native cmake_parse_arguments command
Implement a native `cmake_parse_arguments` command that is fully compatible with the documented behaviour of the previous implementation. Leave the CMakeParseArguments module empty but existing for compatibility.
Diffstat (limited to 'Source/cmParseArgumentsCommand.h')
-rw-r--r--Source/cmParseArgumentsCommand.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/Source/cmParseArgumentsCommand.h b/Source/cmParseArgumentsCommand.h
new file mode 100644
index 0000000000..7fbf64296d
--- /dev/null
+++ b/Source/cmParseArgumentsCommand.h
@@ -0,0 +1,54 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2015 Matthias Maennich <matthias@maennich.net>
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#ifndef cmParseArgumentsCommand_h
+#define cmParseArgumentsCommand_h
+
+#include "cmCommand.h"
+
+/** \class cmParseArgumentsCommand
+ *
+ */
+class cmParseArgumentsCommand : public cmCommand
+{
+public:
+ /**
+ * This is a virtual constructor for the command.
+ */
+ virtual cmCommand* Clone()
+ {
+ return new cmParseArgumentsCommand;
+ }
+
+ /**
+ * This is called when the command is first encountered in
+ * the CMakeLists.txt file.
+ */
+ virtual bool InitialPass(std::vector<std::string> const& args,
+ cmExecutionStatus &status);
+
+ /**
+ * This determines if the command is invoked when in script mode.
+ */
+ virtual bool IsScriptable() const { return true; }
+
+ /**
+ * The name of the command as specified in CMakeList.txt.
+ */
+ virtual std::string GetName() const { return "cmake_parse_arguments";}
+
+ cmTypeMacro(cmParseArgumentsCommand, cmCommand);
+
+};
+
+
+#endif