1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmWriteFileCommand.h,v $
6 Date: $Date: 2008-01-23 15:27:59 $
7 Version: $Revision: 1.12 $
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 cmWriteFileCommand_h
18 #define cmWriteFileCommand_h
20 #include "cmCommand.h"
22 /** \class cmWriteFileCommand
23 * \brief Writes a message to a file
26 class cmWriteFileCommand
: public cmCommand
30 * This is a virtual constructor for the command.
32 virtual cmCommand
* Clone()
34 return new cmWriteFileCommand
;
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 "write_file";}
55 * Succinct documentation.
57 virtual const char* GetTerseDocumentation()
59 return "Deprecated. Use the file(WRITE ) command instead.";
65 virtual const char* GetFullDocumentation()
68 " write_file(filename \"message to write\"... [APPEND])\n"
69 "The first argument is the file name, the rest of the arguments are "
70 "messages to write. If the argument APPEND is specified, then "
71 "the message will be appended.\n"
72 "NOTE 1: file(WRITE ... and file(APPEND ... do exactly the same as "
73 "this one but add some more functionality.\n"
74 "NOTE 2: When using write_file the produced file cannot be used as an "
75 "input to CMake (CONFIGURE_FILE, source file ...) because it will "
76 "lead to an infinite loop. Use configure_file if you want to generate "
77 "input files to CMake.";
80 /** This command is kept for compatibility with older CMake versions. */
81 virtual bool IsDiscouraged()
86 cmTypeMacro(cmWriteFileCommand
, cmCommand
);