1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmInstallFilesCommand.h,v $
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 cmInstallFilesCommand_h
18 #define cmInstallFilesCommand_h
20 #include "cmCommand.h"
22 /** \class cmInstallFilesCommand
23 * \brief Specifies where to install some files
25 * cmInstallFilesCommand specifies the relative path where a list of
26 * files should be installed.
28 class cmInstallFilesCommand
: public cmCommand
32 * This is a virtual constructor for the command.
34 virtual cmCommand
* Clone()
36 return new cmInstallFilesCommand
;
40 * This is called when the command is first encountered in
41 * the CMakeLists.txt file.
43 virtual bool InitialPass(std::vector
<std::string
> const& args
,
44 cmExecutionStatus
&status
);
47 * The name of the command as specified in CMakeList.txt.
49 virtual const char* GetName() { return "install_files";}
52 * Succinct documentation.
54 virtual const char* GetTerseDocumentation()
56 return "Deprecated. Use the install(FILES ) command instead.";
60 * This is called at the end after all the information
61 * specified by the command is accumulated. Most commands do
62 * not implement this method. At this point, reading and
63 * writing to the cache can be done.
65 virtual void FinalPass();
66 virtual bool HasFinalPass() const { return !this->IsFilesForm
; }
71 virtual const char* GetFullDocumentation()
74 "This command has been superceded by the install command. It "
75 "is provided for compatibility with older CMake code. "
76 "The FILES form is directly replaced by the FILES form of the "
77 "install command. The regexp form can be expressed "
78 "more clearly using the GLOB form of the file command.\n"
79 " install_files(<dir> extension file file ...)\n"
80 "Create rules to install the listed files with the given extension "
81 "into the given directory. "
82 "Only files existing in the current source tree or its corresponding "
83 "location in the binary tree may be listed. "
84 "If a file specified already has an extension, that extension will be "
85 "removed first. This is useful for providing lists of source files "
86 "such as foo.cxx when you want the corresponding foo.h to be "
87 "installed. A typical extension is '.h'.\n"
88 " install_files(<dir> regexp)\n"
89 "Any files in the current source directory that match the regular "
90 "expression will be installed.\n"
91 " install_files(<dir> FILES file file ...)\n"
92 "Any files listed after the FILES keyword will be "
93 "installed explicitly from the names given. Full paths are allowed in "
95 "The directory <dir> is relative to the installation prefix, which "
96 "is stored in the variable CMAKE_INSTALL_PREFIX.";
99 /** This command is kept for compatibility with older CMake versions. */
100 virtual bool IsDiscouraged()
105 cmTypeMacro(cmInstallFilesCommand
, cmCommand
);
108 void CreateInstallGenerator() const;
109 std::string
FindInstallSource(const char* name
) const;
112 std::vector
<std::string
> FinalArgs
;
114 std::string Destination
;
115 std::vector
<std::string
> Files
;