cmFindProgramCommand.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 cmFindProgramCommand_h
  4. #define cmFindProgramCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cmFindBase.h"
  9. class cmCommand;
  10. class cmExecutionStatus;
  11. /** \class cmFindProgramCommand
  12. * \brief Define a command to search for an executable program.
  13. *
  14. * cmFindProgramCommand is used to define a CMake variable
  15. * that specifies an executable program. The command searches
  16. * in the current path (e.g., PATH environment variable) for
  17. * an executable that matches one of the supplied names.
  18. */
  19. class cmFindProgramCommand : public cmFindBase
  20. {
  21. public:
  22. cmFindProgramCommand();
  23. /**
  24. * This is a virtual constructor for the command.
  25. */
  26. cmCommand* Clone() override { return new cmFindProgramCommand; }
  27. /**
  28. * This is called when the command is first encountered in
  29. * the CMakeLists.txt file.
  30. */
  31. bool InitialPass(std::vector<std::string> const& args,
  32. cmExecutionStatus& status) override;
  33. private:
  34. std::string FindProgram();
  35. std::string FindNormalProgram();
  36. std::string FindNormalProgramDirsPerName();
  37. std::string FindNormalProgramNamesPerDir();
  38. std::string FindAppBundle();
  39. std::string GetBundleExecutable(std::string const& bundlePath);
  40. };
  41. #endif