1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmConfigureFileCommand.h,v $
6 Date: $Date: 2008-01-23 15:27:59 $
7 Version: $Revision: 1.22 $
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 cmConfigureFileCommand_h
18 #define cmConfigureFileCommand_h
20 #include "cmCommand.h"
22 class cmConfigureFileCommand
: public cmCommand
25 cmTypeMacro(cmConfigureFileCommand
, cmCommand
);
27 virtual cmCommand
* Clone()
29 return new cmConfigureFileCommand
;
33 * This is called when the command is first encountered in
36 virtual bool InitialPass(std::vector
<std::string
> const& args
,
37 cmExecutionStatus
&status
);
40 * The name of the command as specified in CMakeList.txt.
42 virtual const char* GetName() { return "configure_file";}
45 * This determines if the command is invoked when in script mode.
47 virtual bool IsScriptable() { return true; }
50 * Succinct documentation.
52 virtual const char* GetTerseDocumentation()
54 return "Copy a file to another location and modify its contents.";
58 * Longer documentation.
60 virtual const char* GetFullDocumentation()
63 " configure_file(InputFile OutputFile\n"
64 " [COPYONLY] [ESCAPE_QUOTES] [@ONLY])\n"
65 "The Input and Output files have to have full paths. "
66 "This command replaces any variables in the input file referenced as "
67 "${VAR} or @VAR@ with their values as determined by CMake. If a "
68 "variable is not defined, it will be replaced with nothing. "
69 "If COPYONLY is specified, then no variable expansion will take "
70 "place. If ESCAPE_QUOTES is specified then any substituted quotes "
71 "will be C-style escaped. "
72 "The file will be configured with the current values of CMake "
73 "variables. If @ONLY is specified, only variables "
74 "of the form @VAR@ will be replaces and ${VAR} will be ignored. "
75 "This is useful for configuring scripts that use ${VAR}. "
76 "Any occurrences of #cmakedefine VAR will be replaced with "
77 "either #define VAR or /* #undef VAR */ depending on "
78 "the setting of VAR in CMake";
81 virtual void FinalPass();
85 std::string InputFile
;
86 std::string OuputFile
;