cmCableClassSetCommand.cxx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 = argsIn;
  25. // First, we want to expand all CMAKE variables in all arguments.
  26. for(std::vector<std::string>::iterator a = args.begin();
  27. a != args.end(); ++a)
  28. {
  29. m_Makefile->ExpandVariablesInString(*a);
  30. }
  31. // The first argument is the name of the set.
  32. std::vector<std::string>::const_iterator arg = args.begin();
  33. m_ClassSetName = *arg++;
  34. // Create the new class set.
  35. cmCableClassSet* classSet = new cmCableClassSet(m_ClassSetName.c_str());
  36. // Add all the regular entries.
  37. for(; (arg != args.end()) && (*arg != "SOURCES_BEGIN"); ++arg)
  38. {
  39. classSet->ParseAndAddElement(arg->c_str(), m_Makefile);
  40. }
  41. // Add any sources that are associated with all the members.
  42. if(arg != args.end())
  43. {
  44. for(++arg; arg != args.end(); ++arg)
  45. {
  46. classSet->AddSource(arg->c_str());
  47. }
  48. }
  49. // Store the class set in the makefile.
  50. m_Makefile->RegisterData(classSet);
  51. return true;
  52. }