2001-11-27 02:28:27 +03:00
|
|
|
/*=========================================================================
|
|
|
|
|
2002-10-24 02:03:27 +04:00
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
2001-11-27 02:28:27 +03:00
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
2002-10-24 02:03:27 +04: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-27 02:28:27 +03:00
|
|
|
|
2002-01-21 23:30:43 +03: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-27 02:28:27 +03:00
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#include "cmMarkAsAdvancedCommand.h"
|
|
|
|
|
|
|
|
// cmMarkAsAdvancedCommand
|
2002-03-29 22:20:32 +03:00
|
|
|
bool cmMarkAsAdvancedCommand::InitialPass(std::vector<std::string> const& argsIn)
|
2001-11-27 02:28:27 +03:00
|
|
|
{
|
2002-03-29 22:20:32 +03:00
|
|
|
if(argsIn.size() < 1 )
|
2001-11-27 02:28:27 +03:00
|
|
|
{
|
|
|
|
this->SetError("called with incorrect number of arguments");
|
|
|
|
return false;
|
|
|
|
}
|
2002-03-29 22:20:32 +03:00
|
|
|
std::vector<std::string> args;
|
|
|
|
cmSystemTools::ExpandListArguments(argsIn, args);
|
|
|
|
|
2001-12-07 23:47:39 +03: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-27 02:28:27 +03:00
|
|
|
{
|
|
|
|
std::string variable = args[i];
|
2002-09-11 22:05:45 +04:00
|
|
|
cmCacheManager* manager = m_Makefile->GetCacheManager();
|
|
|
|
cmCacheManager::CacheIterator it = manager->GetCacheIterator(variable.c_str());
|
|
|
|
if ( it.IsAtEnd() )
|
2001-12-07 23:47:39 +03:00
|
|
|
{
|
2002-09-11 22:05:45 +04:00
|
|
|
m_Makefile->AddCacheDefinition(variable.c_str(), 0, 0,
|
|
|
|
cmCacheManager::UNINITIALIZED);
|
2002-09-12 17:56:48 +04:00
|
|
|
overwrite = true;
|
2001-12-07 23:47:39 +03:00
|
|
|
}
|
2002-09-11 22:05:45 +04:00
|
|
|
it.Find(variable.c_str());
|
|
|
|
if ( it.IsAtEnd() )
|
|
|
|
{
|
|
|
|
cmSystemTools::Error("This should never happen...");
|
|
|
|
return false;
|
|
|
|
}
|
2002-09-17 19:48:52 +04:00
|
|
|
if ( !it.PropertyExists("ADVANCED") || overwrite )
|
2002-09-12 17:56:48 +04:00
|
|
|
{
|
|
|
|
it.SetProperty("ADVANCED", value);
|
|
|
|
}
|
2001-11-27 02:28:27 +03:00
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|