1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #ifndef cmInstallFilesCommand_h
13 #define cmInstallFilesCommand_h
15 #include "cmCommand.h"
17 /** \class cmInstallFilesCommand
18 * \brief Specifies where to install some files
20 * cmInstallFilesCommand specifies the relative path where a list of
21 * files should be installed.
23 class cmInstallFilesCommand : public cmCommand
27 * This is a virtual constructor for the command.
29 virtual cmCommand* Clone()
31 return new cmInstallFilesCommand;
35 * This is called when the command is first encountered in
36 * the CMakeLists.txt file.
38 virtual bool InitialPass(std::vector<std::string> const& args,
39 cmExecutionStatus &status);
42 * The name of the command as specified in CMakeList.txt.
44 virtual const char* GetName() const { return "install_files";}
47 * Succinct documentation.
49 virtual const char* GetTerseDocumentation() const
51 return "Deprecated. Use the install(FILES ) command instead.";
55 * This is called at the end after all the information
56 * specified by the command is accumulated. Most commands do
57 * not implement this method. At this point, reading and
58 * writing to the cache can be done.
60 virtual void FinalPass();
61 virtual bool HasFinalPass() const { return !this->IsFilesForm; }
66 virtual const char* GetFullDocumentation() const
69 "This command has been superceded by the install command. It "
70 "is provided for compatibility with older CMake code. "
71 "The FILES form is directly replaced by the FILES form of the "
72 "install command. The regexp form can be expressed "
73 "more clearly using the GLOB form of the file command.\n"
74 " install_files(<dir> extension file file ...)\n"
75 "Create rules to install the listed files with the given extension "
76 "into the given directory. "
77 "Only files existing in the current source tree or its corresponding "
78 "location in the binary tree may be listed. "
79 "If a file specified already has an extension, that extension will be "
80 "removed first. This is useful for providing lists of source files "
81 "such as foo.cxx when you want the corresponding foo.h to be "
82 "installed. A typical extension is '.h'.\n"
83 " install_files(<dir> regexp)\n"
84 "Any files in the current source directory that match the regular "
85 "expression will be installed.\n"
86 " install_files(<dir> FILES file file ...)\n"
87 "Any files listed after the FILES keyword will be "
88 "installed explicitly from the names given. Full paths are allowed in "
90 "The directory <dir> is relative to the installation prefix, which "
91 "is stored in the variable CMAKE_INSTALL_PREFIX.";
94 /** This command is kept for compatibility with older CMake versions. */
95 virtual bool IsDiscouraged() const
100 cmTypeMacro(cmInstallFilesCommand, cmCommand);
103 void CreateInstallGenerator() const;
104 std::string FindInstallSource(const char* name) const;
107 std::vector<std::string> FinalArgs;
109 std::string Destination;
110 std::vector<std::string> Files;