Introduce "generator expressions" to add_test()
[cmake.git] / Source / cmConfigureFileCommand.h
blobd2b39b4f88d6e35a902ab1dc34037ce72fa5eba4
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmConfigureFileCommand.h,v $
5 Language: C++
6 Date: $Date: 2009-07-24 17:31:34 $
7 Version: $Revision: 1.24 $
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. Any occurrences of #cmakedefine01 VAR "
79 "will be replaced with either #define VAR 1 or #define VAR 0 "
80 "depending on whether VAR evaluates to TRUE or FALSE in CMake";
83 virtual void FinalPass();
84 virtual bool HasFinalPass() const { return !this->Immediate; }
85 private:
86 int ConfigureFile();
88 std::string InputFile;
89 std::string OuputFile;
90 bool CopyOnly;
91 bool EscapeQuotes;
92 bool Immediate;
93 bool AtOnly;
98 #endif