packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmInstallProgramsCommand.h
1 /*============================================================================
2   CMake - Cross Platform Makefile Generator
3   Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
4
5   Distributed under the OSI-approved BSD License (the "License");
6   see accompanying file Copyright.txt for details.
7
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 cmInstallProgramsCommand_h
13 #define cmInstallProgramsCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmInstallProgramsCommand
18  * \brief Specifies where to install some programs
19  *
20  * cmInstallProgramsCommand specifies the relative path where a list of
21  * programs should be installed.
22  */
23 class cmInstallProgramsCommand : public cmCommand
24 {
25 public:
26   /**
27    * This is a virtual constructor for the command.
28    */
29   virtual cmCommand* Clone()
30     {
31     return new cmInstallProgramsCommand;
32     }
33
34   /**
35    * This is called when the command is first encountered in
36    * the CMakeLists.txt file.
37    */
38   virtual bool InitialPass(std::vector<std::string> const& args,
39                            cmExecutionStatus &status);
40
41   /**
42    * The name of the command as specified in CMakeList.txt.
43    */
44   virtual const char* GetName() const { return "install_programs";}
45
46   /**
47    * Succinct documentation.
48    */
49   virtual const char* GetTerseDocumentation() const
50     {
51     return "Deprecated. Use the install(PROGRAMS ) command instead.";
52     }
53
54   /**
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.
59    */
60   virtual void FinalPass();
61
62   virtual bool HasFinalPass() const { return true; }
63
64   /**
65    * More documentation.
66    */
67   virtual const char* GetFullDocumentation() const
68     {
69     return
70       "This command has been superceded by the install command.  It "
71       "is provided for compatibility with older CMake code.  "
72       "The FILES form is directly replaced by the PROGRAMS form of the "
73       "INSTALL command.  The regexp form can be expressed more clearly "
74       "using the GLOB form of the FILE command.\n"
75       "  install_programs(<dir> file1 file2 [file3 ...])\n"
76       "  install_programs(<dir> FILES file1 [file2 ...])\n"
77       "Create rules to install the listed programs into the given directory. "
78       "Use the FILES argument to guarantee that the file list version of "
79       "the command will be used even when there is only one argument.\n"
80       "  install_programs(<dir> regexp)\n"
81       "In the second form any program in the current source directory that "
82       "matches the regular expression will be installed.\n"
83       "This command is intended to install programs that are not built "
84       "by cmake, such as shell scripts.  See the TARGETS form of "
85       "the INSTALL command to "
86       "create installation rules for targets built by cmake.\n"
87       "The directory <dir> is relative to the installation prefix, which "
88       "is stored in the variable CMAKE_INSTALL_PREFIX.";
89     }
90
91   /** This command is kept for compatibility with older CMake versions. */
92   virtual bool IsDiscouraged() const
93     {
94     return true;
95     }
96
97   cmTypeMacro(cmInstallProgramsCommand, cmCommand);
98
99 protected:
100   std::string FindInstallSource(const char* name) const;
101 private:
102   std::vector<std::string> FinalArgs;
103   std::string Destination;
104   std::vector<std::string> Files;
105 };
106
107
108 #endif