packaging: Initial packaging
[platform/upstream/cmake.git] / Source / cmLinkDirectoriesCommand.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 cmLinkDirectoriesCommand_h
13 #define cmLinkDirectoriesCommand_h
14
15 #include "cmCommand.h"
16
17 /** \class cmLinkDirectoriesCommand
18  * \brief Define a list of directories containing files to link.
19  *
20  * cmLinkDirectoriesCommand is used to specify a list
21  * of directories containing files to link into executable(s).
22  * Note that the command supports the use of CMake built-in variables
23  * such as CMAKE_BINARY_DIR and CMAKE_SOURCE_DIR.
24  */
25 class cmLinkDirectoriesCommand : public cmCommand
26 {
27 public:
28   /**
29    * This is a virtual constructor for the command.
30    */
31   virtual cmCommand* Clone()
32     {
33     return new cmLinkDirectoriesCommand;
34     }
35
36   /**
37    * This is called when the command is first encountered in
38    * the CMakeLists.txt file.
39    */
40   virtual bool InitialPass(std::vector<std::string> const& args,
41                            cmExecutionStatus &status);
42
43   /**
44    * The name of the command as specified in CMakeList.txt.
45    */
46   virtual const char* GetName() const { return "link_directories";}
47
48   /**
49    * Succinct documentation.
50    */
51   virtual const char* GetTerseDocumentation() const
52     {
53     return "Specify directories in which the linker will look for libraries.";
54     }
55
56   /**
57    * More documentation.
58    */
59   virtual const char* GetFullDocumentation() const
60     {
61     return
62       "  link_directories(directory1 directory2 ...)\n"
63       "Specify the paths in which the linker should search for libraries. "
64       "The command will apply only to targets created after it is called. "
65       "Relative paths given to this command are interpreted as relative to "
66       "the current source directory, see CMP0015. \n"
67       "Note that this command is rarely necessary.  Library locations "
68       "returned by find_package() and find_library() are absolute paths.  "
69       "Pass these absolute library file paths directly to the "
70       "target_link_libraries() command.  CMake will ensure the linker finds "
71       "them."
72       ;
73     }
74
75   cmTypeMacro(cmLinkDirectoriesCommand, cmCommand);
76 private:
77   void AddLinkDir(std::string const& dir);
78 };
79
80
81
82 #endif