cmAddLibraryCommand.h 2.4 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 cmLibrarysCommand_h
  14. #define cmLibrarysCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmLibrarysCommand
  18. * \brief Defines a list of executables to build.
  19. *
  20. * cmLibrarysCommand defines a list of executable (i.e., test)
  21. * programs to create.
  22. */
  23. class cmAddLibraryCommand : public cmCommand
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. virtual cmCommand* Clone()
  30. {
  31. return new cmAddLibraryCommand;
  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 "ADD_LIBRARY";}
  42. /**
  43. * Succinct documentation.
  44. */
  45. virtual const char* GetTerseDocumentation()
  46. {
  47. return "Add an library to the project using the specified source files.";
  48. }
  49. /**
  50. * More documentation.
  51. */
  52. virtual const char* GetFullDocumentation()
  53. {
  54. return
  55. " ADD_LIBRARY(libname [SHARED | STATIC | MODULE]\n"
  56. " source1 source2 ... sourceN)\n"
  57. "Adds a library target. SHARED, STATIC or MODULE keywords are used "
  58. "to set the library type. If the keyword MODULE appears, the library "
  59. "type is set to MH_BUNDLE on systems which use dyld. On systems "
  60. "without dyld, MODULE is treated like SHARED. If no keywords appear "
  61. " as the second argument, the type defaults to the current value of "
  62. "BUILD_SHARED_LIBS. If this variable is not set, the type defaults "
  63. "to STATIC.";
  64. }
  65. cmTypeMacro(cmAddLibraryCommand, cmCommand);
  66. private:
  67. std::string m_LibName;
  68. };
  69. #endif