cmLoadCacheCommand.h 1.1 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 cmLoadCacheCommand_h
  4. #define cmLoadCacheCommand_h
  5. #include "cmConfigure.h" // IWYU pragma: keep
  6. #include <set>
  7. #include <string>
  8. #include <vector>
  9. #include <cm/memory>
  10. #include "cmCommand.h"
  11. class cmExecutionStatus;
  12. /** \class cmLoadCacheCommand
  13. * \brief load a cache file
  14. *
  15. * cmLoadCacheCommand loads the non internal values of a cache file
  16. */
  17. class cmLoadCacheCommand : public cmCommand
  18. {
  19. public:
  20. /**
  21. * This is a virtual constructor for the command.
  22. */
  23. std::unique_ptr<cmCommand> Clone() override
  24. {
  25. return cm::make_unique<cmLoadCacheCommand>();
  26. }
  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. protected:
  34. std::set<std::string> VariablesToRead;
  35. std::string Prefix;
  36. bool ReadWithPrefix(std::vector<std::string> const& args);
  37. void CheckLine(const char* line);
  38. };
  39. #endif