cmLinkLibrariesCommand.h 2.5 KB

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