cmFindBase.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 cmFindBase_h
  4. #define cmFindBase_h
  5. #include <cmConfigure.h> // IWYU pragma: keep
  6. #include <string>
  7. #include <vector>
  8. #include "cmFindCommon.h"
  9. /** \class cmFindBase
  10. * \brief Base class for most FIND_XXX commands.
  11. *
  12. * cmFindBase is a parent class for cmFindProgramCommand, cmFindPathCommand,
  13. * and cmFindLibraryCommand, cmFindFileCommand
  14. */
  15. class cmFindBase : public cmFindCommon
  16. {
  17. public:
  18. cmFindBase();
  19. /**
  20. * This is called when the command is first encountered in
  21. * the CMakeLists.txt file.
  22. */
  23. virtual bool ParseArguments(std::vector<std::string> const& args);
  24. protected:
  25. void PrintFindStuff();
  26. void ExpandPaths();
  27. // see if the VariableName is already set in the cache,
  28. // also copy the documentation from the cache to VariableDocumentation
  29. // if it has documentation in the cache
  30. bool CheckForVariableInCache();
  31. // use by command during find
  32. std::string VariableDocumentation;
  33. std::string VariableName;
  34. std::vector<std::string> Names;
  35. bool NamesPerDir;
  36. bool NamesPerDirAllowed;
  37. // CMAKE_*_PATH CMAKE_SYSTEM_*_PATH FRAMEWORK|LIBRARY|INCLUDE|PROGRAM
  38. std::string EnvironmentPath; // LIB,INCLUDE
  39. bool AlreadyInCache;
  40. bool AlreadyInCacheWithoutMetaInfo;
  41. private:
  42. // Add pieces of the search.
  43. void FillCMakeVariablePath();
  44. void FillCMakeEnvironmentPath();
  45. void FillUserHintsPath();
  46. void FillSystemEnvironmentPath();
  47. void FillCMakeSystemVariablePath();
  48. void FillUserGuessPath();
  49. };
  50. #endif