1 /*============================================================================
2 CMake - Cross Platform Makefile Generator
3 Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
5 Distributed under the OSI-approved BSD License (the "License");
6 see accompanying file Copyright.txt for details.
8 This software is distributed WITHOUT ANY WARRANTY; without even the
9 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License for more information.
11 ============================================================================*/
12 #include "cmSetDirectoryPropertiesCommand.h"
16 // cmSetDirectoryPropertiesCommand
17 bool cmSetDirectoryPropertiesCommand
18 ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
22 this->SetError("called with incorrect number of arguments");
28 cmSetDirectoryPropertiesCommand::RunCommand(this->Makefile,
33 this->SetError(errors.c_str());
38 bool cmSetDirectoryPropertiesCommand
39 ::RunCommand(cmMakefile *mf,
40 std::vector<std::string>::const_iterator ait,
41 std::vector<std::string>::const_iterator aitend,
44 for (; ait != aitend; ait += 2 )
46 if ( ait +1 == aitend)
48 errors = "Wrong number of arguments";
51 const std::string& prop = *ait;
52 const std::string& value = *(ait+1);
53 if ( prop == "VARIABLES" )
56 "Variables and cache variables should be set using SET command";
59 else if ( prop == "MACROS" )
62 "Commands and macros cannot be set using SET_CMAKE_PROPERTIES";
65 mf->SetProperty(prop.c_str(), value.c_str());