cmFindPathCommand.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 cmFindPathCommand_h
  4. #define cmFindPathCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cm_memory.hxx"
  9. #include "cmCommand.h"
  10. #include "cmFindBase.h"
  11. class cmExecutionStatus;
  12. /** \class cmFindPathCommand
  13. * \brief Define a command to search for a library.
  14. *
  15. * cmFindPathCommand is used to define a CMake variable
  16. * that specifies a library. The command searches for a given
  17. * file in a list of directories.
  18. */
  19. class cmFindPathCommand : public cmFindBase
  20. {
  21. public:
  22. cmFindPathCommand();
  23. /**
  24. * This is a virtual constructor for the command.
  25. */
  26. std::unique_ptr<cmCommand> Clone() override
  27. {
  28. return cm::make_unique<cmFindPathCommand>();
  29. }
  30. /**
  31. * This is called when the command is first encountered in
  32. * the CMakeLists.txt file.
  33. */
  34. bool InitialPass(std::vector<std::string> const& args,
  35. cmExecutionStatus& status) override;
  36. bool IncludeFileInPath;
  37. private:
  38. std::string FindHeaderInFramework(std::string const& file,
  39. std::string const& dir);
  40. std::string FindHeader();
  41. std::string FindNormalHeader();
  42. std::string FindFrameworkHeader();
  43. };
  44. #endif