1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmMarkAsAdvancedCommand.cxx,v $
6 Date: $Date: 2008-01-23 15:27:59 $
7 Version: $Revision: 1.15 $
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 "cmMarkAsAdvancedCommand.h"
19 // cmMarkAsAdvancedCommand
20 bool cmMarkAsAdvancedCommand
21 ::InitialPass(std::vector
<std::string
> const& args
, cmExecutionStatus
&)
25 this->SetError("called with incorrect number of arguments");
30 const char* value
= "1";
31 bool overwrite
= false;
32 if(args
[0] == "CLEAR" || args
[0] == "FORCE")
35 if(args
[0] == "CLEAR")
41 for(; i
< args
.size(); ++i
)
43 std::string variable
= args
[i
];
44 cmCacheManager
* manager
= this->Makefile
->GetCacheManager();
45 cmCacheManager::CacheIterator it
=
46 manager
->GetCacheIterator(variable
.c_str());
49 this->Makefile
->GetCacheManager()
50 ->AddCacheEntry(variable
.c_str(), 0, 0,
51 cmCacheManager::UNINITIALIZED
);
54 it
.Find(variable
.c_str());
57 cmSystemTools::Error("This should never happen...");
60 if ( !it
.PropertyExists("ADVANCED") || overwrite
)
62 it
.SetProperty("ADVANCED", value
);