1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmSetDirectoryPropertiesCommand.cxx,v $
6 Date: $Date: 2008-01-23 15:27:59 $
7 Version: $Revision: 1.7 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmSetDirectoryPropertiesCommand.h"
21 // cmSetDirectoryPropertiesCommand
22 bool cmSetDirectoryPropertiesCommand
23 ::InitialPass(std::vector
<std::string
> const& args
, cmExecutionStatus
&)
27 this->SetError("called with incorrect number of arguments");
33 cmSetDirectoryPropertiesCommand::RunCommand(this->Makefile
,
38 this->SetError(errors
.c_str());
43 bool cmSetDirectoryPropertiesCommand
44 ::RunCommand(cmMakefile
*mf
,
45 std::vector
<std::string
>::const_iterator ait
,
46 std::vector
<std::string
>::const_iterator aitend
,
49 for (; ait
!= aitend
; ait
+= 2 )
51 if ( ait
+1 == aitend
)
53 errors
= "Wrong number of arguments";
56 const std::string
& prop
= *ait
;
57 const std::string
& value
= *(ait
+1);
58 if ( prop
== "VARIABLES" )
61 "Variables and cache variables should be set using SET command";
64 else if ( prop
== "MACROS" )
67 "Commands and macros cannot be set using SET_CMAKE_PROPERTIES";
70 mf
->SetProperty(prop
.c_str(), value
.c_str());