cmSetPropertyCommand.h 1.62 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 cmSetsPropertiesCommand_h
#define cmSetsPropertiesCommand_h

6 7 8 9 10
#include <cmConfigure.h>
#include <set>
#include <string>
#include <vector>

11 12
#include "cmCommand.h"

13 14 15 16 17 18
class cmExecutionStatus;
class cmInstalledFile;
class cmSourceFile;
class cmTarget;
class cmTest;

19 20 21 22 23
class cmSetPropertyCommand : public cmCommand
{
public:
  cmSetPropertyCommand();

24
  cmCommand* Clone() CM_OVERRIDE { return new cmSetPropertyCommand; }
25 26 27 28 29

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

  /**
   * The name of the command as specified in CMakeList.txt.
   */
36
  std::string GetName() const CM_OVERRIDE { return "set_property"; }
37 38 39 40

  /**
   * This determines if the command is invoked when in script mode.
   */
41
  bool IsScriptable() const CM_OVERRIDE { return true; }
42 43

private:
44
  std::set<std::string> Names;
45 46
  std::string PropertyName;
  std::string PropertyValue;
47
  bool Remove;
48
  bool AppendMode;
49
  bool AppendAsString;
50 51 52 53 54 55 56 57 58 59

  // Implementation of each property type.
  bool HandleGlobalMode();
  bool HandleDirectoryMode();
  bool HandleTargetMode();
  bool HandleTarget(cmTarget* target);
  bool HandleSourceMode();
  bool HandleSource(cmSourceFile* sf);
  bool HandleTestMode();
  bool HandleTest(cmTest* test);
60
  bool HandleCacheMode();
61
  bool HandleCacheEntry(std::string const&);
62 63
  bool HandleInstallMode();
  bool HandleInstall(cmInstalledFile* file);
64 65 66
};

#endif