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 cmInstallProgramsCommand_h
13 #define cmInstallProgramsCommand_h
15 #include "cmCommand.h"
17 /** \class cmInstallProgramsCommand
18 * \brief Specifies where to install some programs
20 * cmInstallProgramsCommand specifies the relative path where a list of
21 * programs should be installed.
23 class cmInstallProgramsCommand : public cmCommand
27 * This is a virtual constructor for the command.
29 virtual cmCommand* Clone()
31 return new cmInstallProgramsCommand;
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_programs";}
47 * Succinct documentation.
49 virtual const char* GetTerseDocumentation() const
51 return "Deprecated. Use the install(PROGRAMS ) 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();
62 virtual bool HasFinalPass() const { return true; }
67 virtual const char* GetFullDocumentation() const
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.";
91 /** This command is kept for compatibility with older CMake versions. */
92 virtual bool IsDiscouraged() const
97 cmTypeMacro(cmInstallProgramsCommand, cmCommand);
100 std::string FindInstallSource(const char* name) const;
102 std::vector<std::string> FinalArgs;
103 std::string Destination;
104 std::vector<std::string> Files;