cmFindLibraryCommand.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
  2. file Copyright.txt or https://cmake.org/licensing for details. */
  3. #ifndef cmFindLibraryCommand_h
  4. #define cmFindLibraryCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cmFindBase.h"
  9. class cmExecutionStatus;
  10. /** \class cmFindLibraryCommand
  11. * \brief Define a command to search for a library.
  12. *
  13. * cmFindLibraryCommand is used to define a CMake variable
  14. * that specifies a library. The command searches for a given
  15. * file in a list of directories.
  16. */
  17. class cmFindLibraryCommand : public cmFindBase
  18. {
  19. public:
  20. cmFindLibraryCommand(cmExecutionStatus& status);
  21. bool InitialPass(std::vector<std::string> const& args);
  22. protected:
  23. void AddArchitecturePaths(const char* suffix);
  24. void AddArchitecturePath(std::string const& dir,
  25. std::string::size_type start_pos,
  26. const char* suffix, bool fresh = true);
  27. std::string FindLibrary();
  28. private:
  29. std::string FindNormalLibrary();
  30. std::string FindNormalLibraryNamesPerDir();
  31. std::string FindNormalLibraryDirsPerName();
  32. std::string FindFrameworkLibrary();
  33. std::string FindFrameworkLibraryNamesPerDir();
  34. std::string FindFrameworkLibraryDirsPerName();
  35. };
  36. bool cmFindLibrary(std::vector<std::string> const& args,
  37. cmExecutionStatus& status);
  38. #endif