cmGetPropertyCommand.h 1.29 KB
Newer Older
1 2
/* Distributed under the OSI-approved BSD 3-Clause License.  See accompanying
   file Copyright.txt or https://cmake.org/licensing for details.  */
3 4 5
#ifndef cmGetPropertyCommand_h
#define cmGetPropertyCommand_h

6
#include "cmConfigure.h" // IWYU pragma: keep
7

8 9 10
#include <string>
#include <vector>

11 12
#include "cm_memory.hxx"

13 14
#include "cmCommand.h"

15 16
class cmExecutionStatus;

17 18 19
class cmGetPropertyCommand : public cmCommand
{
public:
20 21
  cmGetPropertyCommand();

22 23 24 25
  std::unique_ptr<cmCommand> Clone() override
  {
    return cm::make_unique<cmGetPropertyCommand>();
  }
26 27 28 29 30

  /**
   * This is called when the command is first encountered in
   * the input file.
   */
31
  bool InitialPass(std::vector<std::string> const& args,
32
                   cmExecutionStatus& status) override;
33

34
private:
35 36 37 38 39 40 41 42
  enum OutType
  {
    OutValue,
    OutDefined,
    OutBriefDoc,
    OutFullDoc,
    OutSet
  };
43 44 45 46
  std::string Variable;
  std::string Name;
  std::string PropertyName;
  OutType InfoType;
47

48 49
  // Implementation of result storage.
  bool StoreResult(const char* value);
50

51 52 53 54 55 56 57
  // Implementation of each property type.
  bool HandleGlobalMode();
  bool HandleDirectoryMode();
  bool HandleTargetMode();
  bool HandleSourceMode();
  bool HandleTestMode();
  bool HandleVariableMode();
58
  bool HandleCacheMode();
59
  bool HandleInstallMode();
60
};
61 62

#endif