Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmTargetLinkLibrariesCommand.h
blobe849832a6965e32f24ee8b2a5dc950dbd2b23866
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmTargetLinkLibrariesCommand.h,v $
5 Language: C++
6 Date: $Date: 2009-02-02 14:42:23 $
7 Version: $Revision: 1.20 $
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 cmTargetLinkLibrariesCommand_h
18 #define cmTargetLinkLibrariesCommand_h
20 #include "cmCommand.h"
22 /** \class cmTargetLinkLibrariesCommand
23 * \brief Specify a list of libraries to link into executables.
25 * cmTargetLinkLibrariesCommand is used to specify a list of libraries to link
26 * into executable(s) or shared objects. The names of the libraries
27 * should be those defined by the LIBRARY(library) command(s).
29 class cmTargetLinkLibrariesCommand : public cmCommand
31 public:
32 /**
33 * This is a virtual constructor for the command.
35 virtual cmCommand* Clone()
37 return new cmTargetLinkLibrariesCommand;
40 /**
41 * This is called when the command is first encountered in
42 * the CMakeLists.txt file.
44 virtual bool InitialPass(std::vector<std::string> const& args,
45 cmExecutionStatus &status);
47 /**
48 * The name of the command as specified in CMakeList.txt.
50 virtual const char* GetName() { return "target_link_libraries";}
52 /**
53 * Succinct documentation.
55 virtual const char* GetTerseDocumentation()
57 return
58 "Link a target to given libraries.";
61 /**
62 * More documentation.
64 virtual const char* GetFullDocumentation()
66 return
67 " target_link_libraries(<target> [item1 [item2 [...]]]\n"
68 " [[debug|optimized|general] <item>] ...)\n"
69 "Specify libraries or flags to use when linking a given target. "
70 "If a library name matches that of another target in the project "
71 "a dependency will automatically be added in the build system to make "
72 "sure the library being linked is up-to-date before the target links. "
73 "Item names starting with '-', but not '-l' or '-framework', are "
74 "treated as linker flags."
75 "\n"
76 "A \"debug\", \"optimized\", or \"general\" keyword indicates that "
77 "the library immediately following it is to be used only for the "
78 "corresponding build configuration. "
79 "The \"debug\" keyword corresponds to the Debug configuration "
80 "(or to configurations named in the DEBUG_CONFIGURATIONS global "
81 "property if it is set). "
82 "The \"optimized\" keyword corresponds to all other configurations. "
83 "The \"general\" keyword corresponds to all configurations, and is "
84 "purely optional (assumed if omitted). "
85 "Higher granularity may be achieved for per-configuration rules "
86 "by creating and linking to IMPORTED library targets. "
87 "See the IMPORTED mode of the add_library command for more "
88 "information. "
89 "\n"
90 "Library dependencies are transitive by default. "
91 "When this target is linked into another target then the libraries "
92 "linked to this target will appear on the link line for the other "
93 "target too. "
94 "See the LINK_INTERFACE_LIBRARIES target property to override the "
95 "set of transitive link dependencies for a target."
96 "\n"
97 " target_link_libraries(<target> LINK_INTERFACE_LIBRARIES\n"
98 " [[debug|optimized|general] <lib>] ...)\n"
99 "The LINK_INTERFACE_LIBRARIES mode appends the libraries "
100 "to the LINK_INTERFACE_LIBRARIES and its per-configuration equivalent "
101 "target properties instead of using them for linking. "
102 "Libraries specified as \"debug\" are appended to the "
103 "the LINK_INTERFACE_LIBRARIES_DEBUG property (or to the properties "
104 "corresponding to configurations listed in the DEBUG_CONFIGURATIONS "
105 "global property if it is set). "
106 "Libraries specified as \"optimized\" are appended to the "
107 "the LINK_INTERFACE_LIBRARIES property. "
108 "Libraries specified as \"general\" (or without any keyword) are "
109 "treated as if specified for both \"debug\" and \"optimized\"."
113 cmTypeMacro(cmTargetLinkLibrariesCommand, cmCommand);
114 private:
115 void LinkLibraryTypeSpecifierWarning(int left, int right);
116 static const char* LinkLibraryTypeNames[3];
118 cmTarget* Target;
119 bool DoingInterface;
121 void HandleLibrary(const char* lib, cmTarget::LinkLibraryType llt);
126 #endif