MCPcopy Create free account
hub / github.com/Kitware/CMake / cmGetPropertyCommand

Function cmGetPropertyCommand

Source/cmGetPropertyCommand.cxx:72–298  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72bool cmGetPropertyCommand(std::vector<std::string> const& args,
73 cmExecutionStatus& status)
74{
75 OutType infoType = OutValue;
76 if (args.size() < 3) {
77 status.SetError("called with incorrect number of arguments");
78 return false;
79 }
80
81 // The cmake variable in which to store the result.
82 std::string const& variable = args[0];
83
84 std::string name;
85 std::string propertyName;
86
87 std::string file_set_target_name;
88 bool file_set_target_option_enabled = false;
89
90 std::vector<std::string> source_file_directories;
91 std::vector<std::string> source_file_target_directories;
92 bool source_file_directory_option_enabled = false;
93 bool source_file_target_option_enabled = false;
94
95 std::string test_directory;
96 bool test_directory_option_enabled = false;
97
98 // Get the scope from which to get the property.
99 cmProperty::ScopeType scope;
100 if (args[1] == "GLOBAL") {
101 scope = cmProperty::GLOBAL;
102 } else if (args[1] == "DIRECTORY") {
103 scope = cmProperty::DIRECTORY;
104 } else if (args[1] == "TARGET") {
105 scope = cmProperty::TARGET;
106 } else if (args[1] == "FILE_SET") {
107 scope = cmProperty::FILE_SET;
108 } else if (args[1] == "SOURCE") {
109 scope = cmProperty::SOURCE_FILE;
110 } else if (args[1] == "TEST") {
111 scope = cmProperty::TEST;
112 } else if (args[1] == "VARIABLE") {
113 scope = cmProperty::VARIABLE;
114 } else if (args[1] == "CACHE") {
115 scope = cmProperty::CACHE;
116 } else if (args[1] == "INSTALL") {
117 scope = cmProperty::INSTALL;
118 } else {
119 status.SetError(cmStrCat("given invalid scope ", args[1],
120 ". "
121 "Valid scopes are "
122 "GLOBAL, DIRECTORY, TARGET, FILE_SET, SOURCE, "
123 "TEST, VARIABLE, CACHE, INSTALL."));
124 return false;
125 }
126
127 // Parse remaining arguments.
128 enum Doing
129 {

Callers

nothing calls this directly

Calls 15

HandleVariableModeFunction · 0.85
push_backMethod · 0.80
cmStrCatFunction · 0.70
HandleGlobalModeFunction · 0.70
HandleDirectoryModeFunction · 0.70
HandleTargetModeFunction · 0.70
HandleFileSetModeFunction · 0.70
HandleSourceModeFunction · 0.70
HandleTestModeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…