cmOptionCommand.cxx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #include "cmOptionCommand.h"
  12. // cmOptionCommand
  13. bool cmOptionCommand::Invoke(std::vector<std::string>& args)
  14. {
  15. if(args.size() < 1)
  16. {
  17. this->SetError("called with incorrect number of arguments");
  18. return false;
  19. }
  20. // Now check and see if the value has been stored in the cache
  21. // already, if so use that value and don't look for the program
  22. const char* cacheValue
  23. = cmCacheManager::GetInstance()->GetCacheValue(args[0].c_str());
  24. if(!cacheValue)
  25. {
  26. cmCacheManager::GetInstance()->AddCacheEntry(args[0].c_str(),"0",
  27. cmCacheManager::BOOL);
  28. m_Makefile->AddDefinition(args[0].c_str(), "0");
  29. }
  30. else
  31. {
  32. m_Makefile->AddDefinition("WRAP_TCL", cacheValue);
  33. }
  34. return true;
  35. }