cmLinkLibrariesCommand.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmLinkLibrariesCommand_h
  14. #define cmLinkLibrariesCommand_h
  15. #include "cmCommand.h"
  16. /** \class cmLinkLibrariesCommand
  17. * \brief Specify a list of libraries to link into executables.
  18. *
  19. * cmLinkLibrariesCommand is used to specify a list of libraries to link
  20. * into executable(s) or shared objects. The names of the libraries
  21. * should be those defined by the LIBRARY(library) command(s).
  22. */
  23. class cmLinkLibrariesCommand : public cmCommand
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. virtual cmCommand* Clone()
  30. {
  31. return new cmLinkLibrariesCommand;
  32. }
  33. /**
  34. * This is called when the command is first encountered in
  35. * the CMakeLists.txt file.
  36. */
  37. virtual bool InitialPass(std::vector<std::string> const& args);
  38. /**
  39. * The name of the command as specified in CMakeList.txt.
  40. */
  41. virtual const char* GetName() { return "LINK_LIBRARIES";}
  42. /**
  43. * Succinct documentation.
  44. */
  45. virtual const char* GetTerseDocumentation()
  46. {
  47. return "Link libraries to all targets added later.";
  48. }
  49. /**
  50. * More documentation.
  51. */
  52. virtual const char* GetFullDocumentation()
  53. {
  54. return
  55. " LINK_LIBRARIES(library1 <debug | optimized> library2 ...)\n"
  56. "This is an old CMake command for linking libraries. Use "
  57. "TARGET_LINK_LIBRARIES unless you have a good reason for every target "
  58. "to link to the same set of libraries.\n"
  59. "Specify a list of libraries to be linked into "
  60. "any following targets (typically added with the ADD_EXECUTABLE "
  61. "or ADD_LIBRARY calls). This command is passed "
  62. "down to all subdirectories. "
  63. "The debug and optimized strings may be used to indicate that "
  64. "the next library listed is to be used only for that specific "
  65. "type of build.";
  66. }
  67. cmTypeMacro(cmLinkLibrariesCommand, cmCommand);
  68. };
  69. #endif