summaryrefslogtreecommitdiffstats
path: root/Source/cmMathCommand.h
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2005-10-17 20:42:47 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2005-10-17 20:42:47 (GMT)
commit985d092d4d9f6d38c794755c3c64405ef7ec8d35 (patch)
tree382b35ed4376ba936acb4f160dd4fc5b76173dc6 /Source/cmMathCommand.h
parent427ed70363ad4aea83e071f46d9704f69472017d (diff)
downloadCMake-985d092d4d9f6d38c794755c3c64405ef7ec8d35.zip
CMake-985d092d4d9f6d38c794755c3c64405ef7ec8d35.tar.gz
CMake-985d092d4d9f6d38c794755c3c64405ef7ec8d35.tar.bz2
ENH: Add rudamentary mathematical expression support
Diffstat (limited to 'Source/cmMathCommand.h')
-rw-r--r--Source/cmMathCommand.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/Source/cmMathCommand.h b/Source/cmMathCommand.h
new file mode 100644
index 0000000..ddebac5
--- /dev/null
+++ b/Source/cmMathCommand.h
@@ -0,0 +1,80 @@
+/*=========================================================================
+
+ Program: CMake - Cross-Platform Makefile Generator
+ Module: $RCSfile$
+ Language: C++
+ Date: $Date$
+ Version: $Revision$
+
+ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
+ See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even
+ the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the above copyright notices for more information.
+
+=========================================================================*/
+#ifndef cmMathCommand_h
+#define cmMathCommand_h
+
+#include "cmCommand.h"
+
+/** \class cmMathCommand
+ * \brief Common string operations
+ *
+ */
+class cmMathCommand : public cmCommand
+{
+public:
+ /**
+ * This is a virtual constructor for the command.
+ */
+ virtual cmCommand* Clone()
+ {
+ return new cmMathCommand;
+ }
+
+ /**
+ * This is called when the command is first encountered in
+ * the CMakeLists.txt file.
+ */
+ virtual bool InitialPass(std::vector<std::string> const& args);
+
+ /**
+ * This determines if the command is invoked when in script mode.
+ */
+ virtual bool IsScriptable() { return true; }
+
+ /**
+ * The name of the command as specified in CMakeList.txt.
+ */
+ virtual const char* GetName() { return "MATH";}
+
+ /**
+ * Succinct documentation.
+ */
+ virtual const char* GetTerseDocumentation()
+ {
+ return "Mathematical expressions.";
+ }
+
+ /**
+ * More documentation.
+ */
+ virtual const char* GetFullDocumentation()
+ {
+ return
+ " MATH(EXPR <output variable> <math expression>)\n"
+ "EXPR evaluates mathematical expression and return result in the "
+ "output variable. Example mathematical expression is '5 * ( 10 + 13 )'.";
+ }
+
+ cmTypeMacro(cmMathCommand, cmCommand);
+protected:
+
+ bool HandleExprCommand(std::vector<std::string> const& args);
+};
+
+
+#endif
+