1
0

cmCableClassSetCommand.cxx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #include "cmCableClassSetCommand.h"
  14. #include "cmCacheManager.h"
  15. #include "cmTarget.h"
  16. // cmCableClassSetCommand
  17. bool cmCableClassSetCommand::InitialPass(std::vector<std::string> const& args)
  18. {
  19. if(args.size() < 2)
  20. {
  21. this->SetError("called with incorrect number of arguments");
  22. return false;
  23. }
  24. // The first argument is the name of the set.
  25. std::vector<std::string>::const_iterator arg = args.begin();
  26. m_ClassSetName = *arg++;
  27. // Create the new class set.
  28. cmCableClassSet* classSet = new cmCableClassSet(m_ClassSetName.c_str());
  29. // Add all the regular entries.
  30. for(; (arg != args.end()) && (*arg != "SOURCES_BEGIN"); ++arg)
  31. {
  32. classSet->ParseAndAddElement(arg->c_str(), m_Makefile);
  33. }
  34. // Add any sources that are associated with all the members.
  35. if(arg != args.end())
  36. {
  37. for(++arg; arg != args.end(); ++arg)
  38. {
  39. classSet->AddSource(arg->c_str());
  40. }
  41. }
  42. // Store the class set in the makefile.
  43. m_Makefile->RegisterData(classSet);
  44. return true;
  45. }