1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmMarkAsAdvancedCommand.cxx,v $
6 Date: $Date: 2002-03-29 19:20:22 $
7 Version: $Revision: 1.5 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 "cmMarkAsAdvancedCommand.h"
19 // cmMarkAsAdvancedCommand
20 bool cmMarkAsAdvancedCommand::InitialPass(std::vector
<std::string
> const& argsIn
)
22 if(argsIn
.size() < 1 )
24 this->SetError("called with incorrect number of arguments");
27 std::vector
<std::string
> args
;
28 cmSystemTools::ExpandListArguments(argsIn
, args
);
31 const char* value
= "1";
32 bool overwrite
= false;
33 if(args
[0] == "CLEAR" || args
[0] == "FORCE")
36 if(args
[0] == "CLEAR")
42 for(; i
< args
.size(); ++i
)
44 std::string variable
= args
[i
];
45 variable
+= "-ADVANCED";
46 std::string doc
= "Advanced flag for variable: ";
48 // if not CLEAR or FORCE or it is not yet defined,
49 // then define variable-ADVANCED
50 if(overwrite
|| !m_Makefile
->GetDefinition(variable
.c_str()))
52 m_Makefile
->AddCacheDefinition(variable
.c_str(), value
,
54 cmCacheManager::INTERNAL
);