cmFindBase.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 FillPackageRootPath();
  44. void FillCMakeVariablePath();
  45. void FillCMakeEnvironmentPath();
  46. void FillUserHintsPath();
  47. void FillSystemEnvironmentPath();
  48. void FillCMakeSystemVariablePath();
  49. void FillUserGuessPath();
  50. };
  51. #endif