1 /* Distributed under the OSI-approved BSD 3-Clause License. See accompanying
2 file Copyright.txt or https://cmake.org/licensing for details. */
3 #include "cmSetDirectoryPropertiesCommand.h"
5 #include "cmExecutionStatus.h"
6 #include "cmMakefile.h"
8 // cmSetDirectoryPropertiesCommand
9 bool cmSetDirectoryPropertiesCommand(std::vector<std::string> const& args,
10 cmExecutionStatus& status)
13 status.SetError("called with incorrect number of arguments");
17 // PROPERTIES followed by prop value pairs
18 if (args.size() % 2 != 1) {
19 status.SetError("Wrong number of arguments");
23 for (auto iter = args.begin() + 1; iter != args.end(); iter += 2) {
24 const std::string& prop = *iter;
25 if (prop == "VARIABLES") {
27 "Variables and cache variables should be set using SET command");
30 if (prop == "MACROS") {
32 "Commands and macros cannot be set using SET_CMAKE_PROPERTIES");
35 status.GetMakefile().SetProperty(prop, *(iter + 1));