ENH: Return utility target after creation
[cmake.git] / Source / cmConfigureFileCommand.h
blobe2ce55c67d4c461d29dd4ddec30463e83b098f41
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmConfigureFileCommand.h,v $
5 Language: C++
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
24 public:
25 cmTypeMacro(cmConfigureFileCommand, cmCommand);
27 virtual cmCommand* Clone()
29 return new cmConfigureFileCommand;
32 /**
33 * This is called when the command is first encountered in
34 * the input file.
36 virtual bool InitialPass(std::vector<std::string> const& args,
37 cmExecutionStatus &status);
39 /**
40 * The name of the command as specified in CMakeList.txt.
42 virtual const char* GetName() { return "configure_file";}
44 /**
45 * This determines if the command is invoked when in script mode.
47 virtual bool IsScriptable() { return true; }
49 /**
50 * Succinct documentation.
52 virtual const char* GetTerseDocumentation()
54 return "Copy a file to another location and modify its contents.";
57 /**
58 * Longer documentation.
60 virtual const char* GetFullDocumentation()
62 return
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();
82 private:
83 int ConfigureFile();
85 std::string InputFile;
86 std::string OuputFile;
87 bool CopyOnly;
88 bool EscapeQuotes;
89 bool Immediate;
90 bool AtOnly;
95 #endif