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 "cmMarkAsAdvancedCommand.h"
14 // cmMarkAsAdvancedCommand
15 bool cmMarkAsAdvancedCommand
16 ::InitialPass(std::vector<std::string> const& args, cmExecutionStatus &)
20 this->SetError("called with incorrect number of arguments");
25 const char* value = "1";
26 bool overwrite = false;
27 if(args[0] == "CLEAR" || args[0] == "FORCE")
30 if(args[0] == "CLEAR")
36 for(; i < args.size(); ++i)
38 std::string variable = args[i];
39 cmCacheManager* manager = this->Makefile->GetCacheManager();
40 cmCacheManager::CacheIterator it =
41 manager->GetCacheIterator(variable.c_str());
44 this->Makefile->GetCacheManager()
45 ->AddCacheEntry(variable.c_str(), 0, 0,
46 cmCacheManager::UNINITIALIZED);
49 it.Find(variable.c_str());
52 cmSystemTools::Error("This should never happen...");
55 if ( !it.PropertyExists("ADVANCED") || overwrite )
57 it.SetProperty("ADVANCED", value);