1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmMathCommand.h,v $
6 Date: $Date: 2008-01-23 15:27:59 $
7 Version: $Revision: 1.5 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmMathCommand_h
18 #define cmMathCommand_h
20 #include "cmCommand.h"
22 /** \class cmMathCommand
23 * \brief Common string operations
26 class cmMathCommand
: public cmCommand
30 * This is a virtual constructor for the command.
32 virtual cmCommand
* Clone()
34 return new cmMathCommand
;
38 * This is called when the command is first encountered in
39 * the CMakeLists.txt file.
41 virtual bool InitialPass(std::vector
<std::string
> const& args
,
42 cmExecutionStatus
&status
);
45 * This determines if the command is invoked when in script mode.
47 virtual bool IsScriptable() { return true; }
50 * The name of the command as specified in CMakeList.txt.
52 virtual const char* GetName() { return "math";}
55 * Succinct documentation.
57 virtual const char* GetTerseDocumentation()
59 return "Mathematical expressions.";
65 virtual const char* GetFullDocumentation()
68 " math(EXPR <output variable> <math expression>)\n"
69 "EXPR evaluates mathematical expression and return result in the "
70 "output variable. Example mathematical expression is "
71 "'5 * ( 10 + 13 )'. Supported operators are "
72 "+ - * / % | & ^ ~ << >> * / %. They have the same meaning "
73 " as they do in c code.";
76 cmTypeMacro(cmMathCommand
, cmCommand
);
79 bool HandleExprCommand(std::vector
<std::string
> const& args
);