cmLoadCacheCommand.cxx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 "cmLoadCacheCommand.h"
  12. // cmLoadcacheCommand
  13. bool cmLoadCacheCommand::InitialPass(std::vector<std::string>& args)
  14. {
  15. if (args.size()< 1)
  16. {
  17. this->SetError("called with wrong number of arguments.");
  18. }
  19. bool excludeFiles=false;
  20. unsigned int excludeIndex=0;
  21. unsigned int i;
  22. std::set<std::string> excludes;
  23. for(i=0; i<args.size(); i++)
  24. {
  25. if (excludeFiles)
  26. {
  27. m_Makefile->ExpandVariablesInString(args[i]);
  28. excludes.insert(args[i]);
  29. }
  30. if (args[i] == "EXCLUDE")
  31. {
  32. excludeFiles=true;
  33. }
  34. }
  35. for(i=0; i<args.size(); i++)
  36. {
  37. if (args[i] == "EXCLUDE")
  38. {
  39. break;
  40. }
  41. m_Makefile->ExpandVariablesInString(args[i]);
  42. cmCacheManager::GetInstance()->LoadCache(args[i].c_str(),false,excludes);
  43. cmCacheManager::GetInstance()->DefineCache(m_Makefile);
  44. }
  45. return true;
  46. }