cmFindLibraryCommand.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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 cmFindLibraryCommand_h
  14. #define cmFindLibraryCommand_h
  15. #include "cmCommand.h"
  16. /** \class cmFindLibraryCommand
  17. * \brief Define a command to search for a library.
  18. *
  19. * cmFindLibraryCommand is used to define a CMake variable
  20. * that specifies a library. The command searches for a given
  21. * file in a list of directories.
  22. */
  23. class cmFindLibraryCommand : public cmCommand
  24. {
  25. public:
  26. /**
  27. * This is a virtual constructor for the command.
  28. */
  29. virtual cmCommand* Clone()
  30. {
  31. return new cmFindLibraryCommand;
  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. * This determines if the command gets propagated down
  40. * to makefiles located in subdirectories.
  41. */
  42. virtual bool IsInherited() {return false;}
  43. /**
  44. * This determines if the command is invoked when in script mode.
  45. */
  46. virtual bool IsScriptable() { return true; }
  47. /**
  48. * The name of the command as specified in CMakeList.txt.
  49. */
  50. virtual const char* GetName() {return "FIND_LIBRARY";}
  51. /**
  52. * Succinct documentation.
  53. */
  54. virtual const char* GetTerseDocumentation()
  55. {
  56. return "Find a library.";
  57. }
  58. /**
  59. * More documentation.
  60. */
  61. virtual const char* GetFullDocumentation()
  62. {
  63. return
  64. " FIND_LIBRARY(<VAR> NAMES name1 [name2 ...]\n"
  65. " [PATHS path1 path2 ...]\n"
  66. " [DOC \"docstring\"])\n"
  67. "Find a library named by one of the names given after the NAMES "
  68. "argument. Paths specified after the PATHS argument are searched "
  69. "in the order specified. A cache entry named by <VAR> is created "
  70. "to store the result. If the library is not found, the result "
  71. "will be <VAR>-NOTFOUND. If DOC is specified then the next "
  72. "argument is treated as a documentation string for the cache "
  73. "entry <VAR>.\n"
  74. " FIND_LIBRARY(VAR libraryName [path1 path2 ...])\n"
  75. "Find a library with the given name by searching in the specified "
  76. "paths. This is a short-hand signature for the command that is "
  77. "sufficient in many cases. The environment variable CMAKE_LIBRARY_PATH "
  78. "is searched as well as the PATH variable.\n";
  79. }
  80. cmTypeMacro(cmFindLibraryCommand, cmCommand);
  81. };
  82. #endif