diff options
author | Ken Martin <ken.martin@kitware.com> | 2001-04-23 20:33:24 (GMT) |
---|---|---|
committer | Ken Martin <ken.martin@kitware.com> | 2001-04-23 20:33:24 (GMT) |
commit | b49204ab0db3e6eae2f346f0f2a3a67517dae80c (patch) | |
tree | 95a3d4ba83fa77e2aa5df337201fe620a3560bfa /Source/cmOptionCommand.cxx | |
parent | 8852ed9d2f491288fa61d4babf6250a4f043503b (diff) | |
download | CMake-b49204ab0db3e6eae2f346f0f2a3a67517dae80c.zip CMake-b49204ab0db3e6eae2f346f0f2a3a67517dae80c.tar.gz CMake-b49204ab0db3e6eae2f346f0f2a3a67517dae80c.tar.bz2 |
new command
Diffstat (limited to 'Source/cmOptionCommand.cxx')
-rw-r--r-- | Source/cmOptionCommand.cxx | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Source/cmOptionCommand.cxx b/Source/cmOptionCommand.cxx new file mode 100644 index 0000000..662599f --- /dev/null +++ b/Source/cmOptionCommand.cxx @@ -0,0 +1,43 @@ +/*========================================================================= + + Program: Insight Segmentation & Registration Toolkit + Module: $RCSfile$ + Language: C++ + Date: $Date$ + Version: $Revision$ + + + Copyright (c) 2000 National Library of Medicine + All rights reserved. + + See COPYRIGHT.txt for copyright details. + +=========================================================================*/ +#include "cmOptionCommand.h" + +// cmOptionCommand +bool cmOptionCommand::Invoke(std::vector<std::string>& args) +{ + if(args.size() < 1) + { + this->SetError("called with incorrect number of arguments"); + return false; + } + + // Now check and see if the value has been stored in the cache + // already, if so use that value and don't look for the program + const char* cacheValue + = cmCacheManager::GetInstance()->GetCacheValue(args[0].c_str()); + if(!cacheValue) + { + cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),"0", + cmCacheManager::BOOL); + m_Makefile->AddDefinition(args[0].c_str(), "0"); + } + else + { + m_Makefile->AddDefinition("WRAP_TCL", cacheValue); + } + + return true; +} |