cmGetPropertyCommand.h 1.4 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 cmGetPropertyCommand_h
  4. #define cmGetPropertyCommand_h
  5. #include "cmCommand.h"
  6. class cmGetPropertyCommand : public cmCommand
  7. {
  8. public:
  9. cmGetPropertyCommand();
  10. cmCommand* Clone() CM_OVERRIDE { return new cmGetPropertyCommand; }
  11. /**
  12. * This is called when the command is first encountered in
  13. * the input file.
  14. */
  15. bool InitialPass(std::vector<std::string> const& args,
  16. cmExecutionStatus& status) CM_OVERRIDE;
  17. /**
  18. * This determines if the command is invoked when in script mode.
  19. */
  20. bool IsScriptable() const CM_OVERRIDE { return true; }
  21. /**
  22. * The name of the command as specified in CMakeList.txt.
  23. */
  24. std::string GetName() const CM_OVERRIDE { return "get_property"; }
  25. cmTypeMacro(cmGetPropertyCommand, cmCommand);
  26. private:
  27. enum OutType
  28. {
  29. OutValue,
  30. OutDefined,
  31. OutBriefDoc,
  32. OutFullDoc,
  33. OutSet
  34. };
  35. std::string Variable;
  36. std::string Name;
  37. std::string PropertyName;
  38. OutType InfoType;
  39. // Implementation of result storage.
  40. bool StoreResult(const char* value);
  41. // Implementation of each property type.
  42. bool HandleGlobalMode();
  43. bool HandleDirectoryMode();
  44. bool HandleTargetMode();
  45. bool HandleSourceMode();
  46. bool HandleTestMode();
  47. bool HandleVariableMode();
  48. bool HandleCacheMode();
  49. bool HandleInstallMode();
  50. };
  51. #endif