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 cmLinkLibrariesCommand_h
13 #define cmLinkLibrariesCommand_h
15 #include "cmCommand.h"
17 /** \class cmLinkLibrariesCommand
18 * \brief Specify a list of libraries to link into executables.
20 * cmLinkLibrariesCommand is used to specify a list of libraries to link
21 * into executable(s) or shared objects. The names of the libraries
22 * should be those defined by the LIBRARY(library) command(s).
24 class cmLinkLibrariesCommand : public cmCommand
28 * This is a virtual constructor for the command.
30 virtual cmCommand* Clone()
32 return new cmLinkLibrariesCommand;
36 * This is called when the command is first encountered in
37 * the CMakeLists.txt file.
39 virtual bool InitialPass(std::vector<std::string> const& args,
40 cmExecutionStatus &status);
43 * The name of the command as specified in CMakeList.txt.
45 virtual const char* GetName() const { return "link_libraries";}
48 * Succinct documentation.
50 virtual const char* GetTerseDocumentation() const
52 return "Deprecated. Use the target_link_libraries() command instead.";
58 virtual const char* GetFullDocumentation() const
61 "Link libraries to all targets added later.\n"
62 " link_libraries(library1 <debug | optimized> library2 ...)\n"
63 "Specify a list of libraries to be linked into "
64 "any following targets (typically added with the add_executable "
65 "or add_library calls). This command is passed "
66 "down to all subdirectories. "
67 "The debug and optimized strings may be used to indicate that "
68 "the next library listed is to be used only for that specific "
72 /** This command is kept for compatibility with older CMake versions. */
73 virtual bool IsDiscouraged() const
78 cmTypeMacro(cmLinkLibrariesCommand, cmCommand);