cmLinkDirectoriesCommand.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmLinkDirectoriesCommand_h
  11. #define cmLinkDirectoriesCommand_h
  12. #include "cmCommand.h"
  13. /** \class cmLinkDirectoriesCommand
  14. * \brief Define a list of directories containing files to link.
  15. *
  16. * cmLinkDirectoriesCommand is used to specify a list
  17. * of directories containing files to link into executable(s).
  18. * Note that the command supports the use of CMake built-in variables
  19. * such as CMAKE_BINARY_DIR and CMAKE_SOURCE_DIR.
  20. */
  21. class cmLinkDirectoriesCommand : public cmCommand
  22. {
  23. public:
  24. /**
  25. * This is a virtual constructor for the command.
  26. */
  27. virtual cmCommand* Clone()
  28. {
  29. return new cmLinkDirectoriesCommand;
  30. }
  31. /**
  32. * This is called when the command is first encountered in
  33. * the CMakeLists.txt file.
  34. */
  35. virtual bool InitialPass(std::vector<std::string> const& args,
  36. cmExecutionStatus &status);
  37. /**
  38. * The name of the command as specified in CMakeList.txt.
  39. */
  40. virtual const char* GetName() const { return "link_directories";}
  41. /**
  42. * Succinct documentation.
  43. */
  44. virtual const char* GetTerseDocumentation() const
  45. {
  46. return "Specify directories in which the linker will look for libraries.";
  47. }
  48. /**
  49. * More documentation.
  50. */
  51. virtual const char* GetFullDocumentation() const
  52. {
  53. return
  54. " link_directories(directory1 directory2 ...)\n"
  55. "Specify the paths in which the linker should search for libraries. "
  56. "The command will apply only to targets created after it is called. "
  57. "Relative paths given to this command are interpreted as relative to "
  58. "the current source directory, see CMP0015. \n"
  59. "Note that this command is rarely necessary. Library locations "
  60. "returned by find_package() and find_library() are absolute paths. "
  61. "Pass these absolute library file paths directly to the "
  62. "target_link_libraries() command. CMake will ensure the linker finds "
  63. "them."
  64. ;
  65. }
  66. cmTypeMacro(cmLinkDirectoriesCommand, cmCommand);
  67. private:
  68. void AddLinkDir(std::string const& dir);
  69. };
  70. #endif