cmFindLibraryCommand.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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 cmFindLibraryCommand_h
  11. #define cmFindLibraryCommand_h
  12. #include "cmFindBase.h"
  13. /** \class cmFindLibraryCommand
  14. * \brief Define a command to search for a library.
  15. *
  16. * cmFindLibraryCommand is used to define a CMake variable
  17. * that specifies a library. The command searches for a given
  18. * file in a list of directories.
  19. */
  20. class cmFindLibraryCommand : public cmFindBase
  21. {
  22. public:
  23. cmFindLibraryCommand();
  24. /**
  25. * This is a virtual constructor for the command.
  26. */
  27. virtual cmCommand* Clone()
  28. {
  29. return new cmFindLibraryCommand;
  30. }
  31. /**
  32. * This is called when the command is first encountered in
  33. * the CMakeLists.txt file.
  34. */
  35. virtual bool InitialPass(std::vector<std::string> const& args,
  36. cmExecutionStatus &status);
  37. /**
  38. * This determines if the command is invoked when in script mode.
  39. */
  40. virtual bool IsScriptable() { return true; }
  41. /**
  42. * The name of the command as specified in CMakeList.txt.
  43. */
  44. virtual const char* GetName() {return "find_library";}
  45. /**
  46. * Succinct documentation.
  47. */
  48. virtual const char* GetTerseDocumentation()
  49. {
  50. return "Find a library.";
  51. }
  52. cmTypeMacro(cmFindLibraryCommand, cmFindBase);
  53. protected:
  54. void AddArchitecturePaths(const char* suffix);
  55. void AddLib64Paths();
  56. std::string FindLibrary();
  57. virtual void GenerateDocumentation();
  58. private:
  59. std::string FindNormalLibrary();
  60. std::string FindFrameworkLibrary();
  61. };
  62. #endif