summaryrefslogtreecommitdiffstats
path: root/Source/cmSetCommand.cxx
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2002-10-09 19:48:59 (GMT)
committerKen Martin <ken.martin@kitware.com>2002-10-09 19:48:59 (GMT)
commitf990777a605f200d00aa5ba980c1acbdc9446ed9 (patch)
tree0eb930f8cf5e3da811220f99f93f8bb780e611a0 /Source/cmSetCommand.cxx
parentcb5763a410181512f762088a2de7338f65181170 (diff)
downloadCMake-f990777a605f200d00aa5ba980c1acbdc9446ed9.zip
CMake-f990777a605f200d00aa5ba980c1acbdc9446ed9.tar.gz
CMake-f990777a605f200d00aa5ba980c1acbdc9446ed9.tar.bz2
added FORCE option
Diffstat (limited to 'Source/cmSetCommand.cxx')
-rw-r--r--Source/cmSetCommand.cxx18
1 files changed, 12 insertions, 6 deletions
diff --git a/Source/cmSetCommand.cxx b/Source/cmSetCommand.cxx
index 083f422..df3240e 100644
--- a/Source/cmSetCommand.cxx
+++ b/Source/cmSetCommand.cxx
@@ -39,6 +39,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args)
const char* variable = args[0].c_str(); // VAR is always first
std::string value; // optional
bool cache = false; // optional
+ bool force = false; // optional
cmCacheManager::CacheEntryType type = cmCacheManager::STRING; // required if cache
const char* docstring = 0; // required if cache
std::string::size_type cacheStart = 0;
@@ -60,19 +61,24 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args)
}
}
-
+ // look for FORCE argument
+ if (args.size() > 4 && args[args.size()-1] == "FORCE")
+ {
+ force = true;
+ }
+
if(args.size() == 2)
{
- // SET (VAR value )
- value= args[1];
+ // SET (VAR value )
+ value= args[1];
}
- else if(args.size() == 4)
+ else if(args.size() == 4 + (force ? 1 : 0))
{
// SET (VAR CACHE TYPE "doc String")
cache = true;
cacheStart = 1;
}
- else if(args.size() == 5)
+ else if(args.size() == 5 + (force ? 1 : 0))
{
// SET (VAR value CACHE TYPE "doc string")
cache = true;
@@ -116,7 +122,7 @@ bool cmSetCommand::InitialPass(std::vector<std::string> const& args)
// is already in the cache and the type is not internal
// then leave now without setting any definitions in the cache
// or the makefile
- if(cache && type != cmCacheManager::INTERNAL)
+ if(cache && type != cmCacheManager::INTERNAL && !force)
{
return true;
}