ENH: change the search path order (if several Tcl/Tk are installed, the "current...
[cmake.git] / Source / cmAddCustomCommandCommand.h
blobbfb80486d9e6856dacdc474587f2115983407c79
1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmAddCustomCommandCommand.h,v $
5 Language: C++
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
24 * \brief
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
31 * COMMAND ARGS
32 * OUTPUT2: SOURCE DEPENDS
33 * COMMAND ARGS
34 * ...
35 * Example of usage:
36 * ADD_CUSTOM_COMMAND(
37 * SOURCE ${VTK_TIFF_FAX_EXE}
38 * COMMAND ${VTK_TIFF_FAX_EXE}
39 * ARGS -c const ${VTK_BINARY_DIR}/Utilities/tiff/tif_fax3sm.c
40 * TARGET vtktiff
41 * OUTPUTS ${VTK_BINARY_DIR}/Utilities/tiff/tif_fax3sm.c
42 * )
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
49 public:
50 /**
51 * This is a virtual constructor for the command.
53 virtual cmCommand* Clone()
55 return new cmAddCustomCommandCommand;
58 /**
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);
64 /**
65 * This determines if the command gets propagated down
66 * to makefiles located in subdirectories.
68 virtual bool IsInherited() {return true;}
70 /**
71 * The name of the command as specified in CMakeList.txt.
73 virtual const char* GetName() {return "ADD_CUSTOM_COMMAND";}
75 /**
76 * Succinct documentation.
78 virtual const char* GetTerseDocumentation()
80 return "Create new command within CMake.";
83 /**
84 * More documentation.
86 virtual const char* GetFullDocumentation()
88 return
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);
99 #endif