cmCableClassSetCommand.cxx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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& argsIn)
  18. {
  19. if(argsIn.size() < 2)
  20. {
  21. this->SetError("called with incorrect number of arguments");
  22. return false;
  23. }
  24. std::vector<std::string> args;
  25. cmSystemTools::ExpandListArguments(argsIn, args);
  26. // The first argument is the name of the set.
  27. std::vector<std::string>::const_iterator arg = args.begin();
  28. m_ClassSetName = *arg++;
  29. // Create the new class set.
  30. cmCableClassSet* classSet = new cmCableClassSet(m_ClassSetName.c_str());
  31. // Add all the regular entries.
  32. for(; (arg != args.end()) && (*arg != "SOURCES_BEGIN"); ++arg)
  33. {
  34. classSet->ParseAndAddElement(arg->c_str(), m_Makefile);
  35. }
  36. // Add any sources that are associated with all the members.
  37. if(arg != args.end())
  38. {
  39. for(++arg; arg != args.end(); ++arg)
  40. {
  41. classSet->AddSource(arg->c_str());
  42. }
  43. }
  44. // Store the class set in the makefile.
  45. m_Makefile->RegisterData(classSet);
  46. return true;
  47. }