1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmAddCustomCommandCommand.h,v $
6 Date: $Date: 2002-04-11 14:05:47 $
7 Version: $Revision: 1.6 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 cmAddCustomCommandCommand_h
18 #define cmAddCustomCommandCommand_h
20 #include "cmStandardIncludes.h"
21 #include "cmCommand.h"
23 /** \class cmAddCustomCommandCommand
26 * cmAddCustomCommandCommand defines a new command that can
27 * be executed within the CMake
29 * In makefile terms this creates new target in the following form:
30 * OUTPUT1: SOURCE DEPENDS
32 * OUTPUT2: SOURCE DEPENDS
37 * SOURCE ${VTK_TIFF_FAX_EXE}
38 * COMMAND ${VTK_TIFF_FAX_EXE}
39 * ARGS -c const ${VTK_BINARY_DIR}/Utilities/tiff/tif_fax3sm.c
41 * OUTPUTS ${VTK_BINARY_DIR}/Utilities/tiff/tif_fax3sm.c
43 * This will create custom target which will generate file tif_fax3sm.c
44 * using command ${VTK_TIFF_FAX_EXE}.
47 class cmAddCustomCommandCommand
: public cmCommand
51 * This is a virtual constructor for the command.
53 virtual cmCommand
* Clone()
55 return new cmAddCustomCommandCommand
;
59 * This is called when the command is first encountered in
60 * the CMakeLists.txt file.
62 virtual bool InitialPass(std::vector
<std::string
> const& args
);
65 * This determines if the command gets propagated down
66 * to makefiles located in subdirectories.
68 virtual bool IsInherited() {return true;}
71 * The name of the command as specified in CMakeList.txt.
73 virtual const char* GetName() {return "ADD_CUSTOM_COMMAND";}
76 * Succinct documentation.
78 virtual const char* GetTerseDocumentation()
80 return "Create new command within CMake.";
86 virtual const char* GetFullDocumentation()
89 "ADD_CUSTOM_COMMAND([SOURCE source] COMMAND command TARGET target "
90 "[ARGS [args...]] [DEPENDS [depends...]] [OUTPUTS [outputs...]])\n"
91 "Add a custom command.";
94 cmTypeMacro(cmAddCustomCommandCommand
, cmCommand
);