1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #ifndef cmWriteFileCommand_h
13 #define cmWriteFileCommand_h
15 #include "cmCommand.h"
17 /** \class cmWriteFileCommand
18 * \brief Writes a message to a file
21 class cmWriteFileCommand : public cmCommand
25 * This is a virtual constructor for the command.
27 virtual cmCommand* Clone()
29 return new cmWriteFileCommand;
33 * This is called when the command is first encountered in
34 * the CMakeLists.txt file.
36 virtual bool InitialPass(std::vector<std::string> const& args,
37 cmExecutionStatus &status);
40 * This determines if the command is invoked when in script mode.
42 virtual bool IsScriptable() const { return true; }
45 * The name of the command as specified in CMakeList.txt.
47 virtual const char* GetName() const { return "write_file";}
50 * Succinct documentation.
52 virtual const char* GetTerseDocumentation() const
54 return "Deprecated. Use the file(WRITE ) command instead.";
60 virtual const char* GetFullDocumentation() const
63 " write_file(filename \"message to write\"... [APPEND])\n"
64 "The first argument is the file name, the rest of the arguments are "
65 "messages to write. If the argument APPEND is specified, then "
66 "the message will be appended.\n"
67 "NOTE 1: file(WRITE ... and file(APPEND ... do exactly the same as "
68 "this one but add some more functionality.\n"
69 "NOTE 2: When using write_file the produced file cannot be used as an "
70 "input to CMake (CONFIGURE_FILE, source file ...) because it will "
71 "lead to an infinite loop. Use configure_file if you want to generate "
72 "input files to CMake.";
75 /** This command is kept for compatibility with older CMake versions. */
76 virtual bool IsDiscouraged() const
81 cmTypeMacro(cmWriteFileCommand, cmCommand);