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 cmLinkDirectoriesCommand_h
13 #define cmLinkDirectoriesCommand_h
15 #include "cmCommand.h"
17 /** \class cmLinkDirectoriesCommand
18 * \brief Define a list of directories containing files to link.
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.
25 class cmLinkDirectoriesCommand : public cmCommand
29 * This is a virtual constructor for the command.
31 virtual cmCommand* Clone()
33 return new cmLinkDirectoriesCommand;
37 * This is called when the command is first encountered in
38 * the CMakeLists.txt file.
40 virtual bool InitialPass(std::vector<std::string> const& args,
41 cmExecutionStatus &status);
44 * The name of the command as specified in CMakeList.txt.
46 virtual const char* GetName() const { return "link_directories";}
49 * Succinct documentation.
51 virtual const char* GetTerseDocumentation() const
53 return "Specify directories in which the linker will look for libraries.";
59 virtual const char* GetFullDocumentation() const
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 "
75 cmTypeMacro(cmLinkDirectoriesCommand, cmCommand);
77 void AddLinkDir(std::string const& dir);