1
/*=========================================================================
3
Program: CMake - Cross-Platform Makefile Generator
4
Module: $RCSfile: cmWriteFileCommand.h,v $
6
Date: $Date: 2004/04/18 18:41:46 $
7
Version: $Revision: 1.7 $
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);
44
* This determines if the command is invoked when in script mode.
46
virtual bool IsScriptable() { return true; }
49
* The name of the command as specified in CMakeList.txt.
51
virtual const char* GetName() { return "WRITE_FILE";}
54
* Succinct documentation.
56
virtual const char* GetTerseDocumentation()
58
return "Write a message to a file.";
64
virtual const char* GetFullDocumentation()
67
" WRITE_FILE(filename \"message to write\"... [APPEND])\n"
68
"The first argument is the file name, the rest of the arguments are "
69
"messages to write. If the argument APPEND is specified, then "
70
"the message will be appended.\n"
71
"NOTE 1: FILE WRITE and FILE APPEND do exactly the same as this one "
72
"but add some more functionality.\n"
73
"NOTE 2: When using WRITE_FILE the produced file cannot be used as an "
74
"input to CMake (CONFIGURE_FILE, source file ...) because it will "
75
"lead to infinite loop. Use CONFIGURE_FILE if you want to generate "
76
"input files to CMake.";
79
cmTypeMacro(cmWriteFileCommand, cmCommand);