cmExportLibraryDependencies.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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 cmExportLibraryDependenciesCommand_h
  11. #define cmExportLibraryDependenciesCommand_h
  12. #include "cmCommand.h"
  13. /** \class cmExportLibraryDependenciesCommand
  14. * \brief Add a test to the lists of tests to run.
  15. *
  16. * cmExportLibraryDependenciesCommand adds a test to the list of tests to run
  17. *
  18. */
  19. class cmExportLibraryDependenciesCommand : public cmCommand
  20. {
  21. public:
  22. /**
  23. * This is a virtual constructor for the command.
  24. */
  25. virtual cmCommand* Clone()
  26. {
  27. return new cmExportLibraryDependenciesCommand;
  28. }
  29. /**
  30. * This is called when the command is first encountered in
  31. * the CMakeLists.txt file.
  32. */
  33. virtual bool InitialPass(std::vector<std::string> const& args,
  34. cmExecutionStatus &status);
  35. /**
  36. * This is called at the end after all the information
  37. * specified by the command is accumulated.
  38. */
  39. virtual void FinalPass();
  40. virtual bool HasFinalPass() const { return true; }
  41. /**
  42. * The name of the command as specified in CMakeList.txt.
  43. */
  44. virtual const char* GetName() const { return "export_library_dependencies";}
  45. /**
  46. * Succinct documentation.
  47. */
  48. virtual const char* GetTerseDocumentation() const
  49. {
  50. return "Deprecated. Use INSTALL(EXPORT) or EXPORT command.";
  51. }
  52. /**
  53. * More documentation.
  54. */
  55. virtual const char* GetFullDocumentation() const
  56. {
  57. return
  58. "This command generates an old-style library dependencies file. "
  59. "Projects requiring CMake 2.6 or later should not use the command. "
  60. "Use instead the install(EXPORT) command to help export targets "
  61. "from an installation tree and the export() command to export targets "
  62. "from a build tree.\n"
  63. "The old-style library dependencies file does not take into account "
  64. "per-configuration names of libraries or the LINK_INTERFACE_LIBRARIES "
  65. "target property.\n"
  66. " export_library_dependencies(<file> [APPEND])\n"
  67. "Create a file named <file> that can be included into a CMake listfile "
  68. "with the INCLUDE command. The file will contain a number of SET "
  69. "commands that will set all the variables needed for library dependency "
  70. "information. This should be the last command in the top level "
  71. "CMakeLists.txt file of the project. If the APPEND option is "
  72. "specified, the SET commands will be appended to the given file "
  73. "instead of replacing it.";
  74. }
  75. /** This command is kept for compatibility with older CMake versions. */
  76. virtual bool IsDiscouraged() const
  77. {
  78. return true;
  79. }
  80. cmTypeMacro(cmExportLibraryDependenciesCommand, cmCommand);
  81. private:
  82. std::string Filename;
  83. bool Append;
  84. void ConstFinalPass() const;
  85. };
  86. #endif