2001-11-26 23:28:27 +00:00
|
|
|
/*=========================================================================
|
|
|
|
|
2002-10-23 22:03:27 +00:00
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
2001-11-26 23:28:27 +00:00
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
2002-10-23 22:03:27 +00:00
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
2001-11-26 23:28:27 +00:00
|
|
|
|
2002-01-21 20:30:43 +00:00
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
2001-11-26 23:28:27 +00:00
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#include "cmMarkAsAdvancedCommand.h"
|
|
|
|
|
|
|
|
// cmMarkAsAdvancedCommand
|
2002-12-11 23:13:33 +00:00
|
|
|
bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& args)
|
2001-11-26 23:28:27 +00:00
|
|
|
{
|
2002-12-11 23:13:33 +00:00
|
|
|
if(args.size() < 1 )
|
2001-11-26 23:28:27 +00:00
|
|
|
{
|
|
|
|
this->SetError("called with incorrect number of arguments");
|
|
|
|
return false;
|
|
|
|
}
|
2002-03-29 19:20:32 +00:00
|
|
|
|
2001-12-07 20:47:39 +00:00
|
|
|
unsigned int i =0;
|
|
|
|
const char* value = "1";
|
|
|
|
bool overwrite = false;
|
|
|
|
if(args[0] == "CLEAR" || args[0] == "FORCE")
|
|
|
|
{
|
|
|
|
overwrite = true;
|
|
|
|
if(args[0] == "CLEAR")
|
|
|
|
{
|
|
|
|
value = "0";
|
|
|
|
}
|
|
|
|
i = 1;
|
|
|
|
}
|
|
|
|
for(; i < args.size(); ++i)
|
2001-11-26 23:28:27 +00:00
|
|
|
{
|
|
|
|
std::string variable = args[i];
|
2002-09-11 18:05:45 +00:00
|
|
|
cmCacheManager* manager = m_Makefile->GetCacheManager();
|
|
|
|
cmCacheManager::CacheIterator it = manager->GetCacheIterator(variable.c_str());
|
|
|
|
if ( it.IsAtEnd() )
|
2001-12-07 20:47:39 +00:00
|
|
|
{
|
2002-09-11 18:05:45 +00:00
|
|
|
m_Makefile->AddCacheDefinition(variable.c_str(), 0, 0,
|
|
|
|
cmCacheManager::UNINITIALIZED);
|
2002-09-12 13:56:48 +00:00
|
|
|
overwrite = true;
|
2001-12-07 20:47:39 +00:00
|
|
|
}
|
2002-09-11 18:05:45 +00:00
|
|
|
it.Find(variable.c_str());
|
|
|
|
if ( it.IsAtEnd() )
|
|
|
|
{
|
|
|
|
cmSystemTools::Error("This should never happen...");
|
|
|
|
return false;
|
|
|
|
}
|
2002-09-17 15:48:52 +00:00
|
|
|
if ( !it.PropertyExists("ADVANCED") || overwrite )
|
2002-09-12 13:56:48 +00:00
|
|
|
{
|
|
|
|
it.SetProperty("ADVANCED", value);
|
|
|
|
}
|
2001-11-26 23:28:27 +00:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|