1
0

cmIncludeExternalMSProjectCommand.cxx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 "cmIncludeExternalMSProjectCommand.h"
  14. // cmIncludeExternalMSProjectCommand
  15. bool cmIncludeExternalMSProjectCommand::InitialPass(std::vector<std::string> const& args)
  16. {
  17. if(args.size() < 2)
  18. {
  19. this->SetError("INCLUDE_EXTERNAL_MSPROJECT called with incorrect number of arguments");
  20. return false;
  21. }
  22. if(m_Makefile->GetDefinition("WIN32")) {
  23. std::string location = args[1];
  24. m_Makefile->ExpandVariablesInString(location);
  25. std::vector<std::string> name_and_location;
  26. name_and_location.push_back(args[0]);
  27. name_and_location.push_back(location);
  28. std::vector<std::string> depends;
  29. if (args.size() > 2) {
  30. for (unsigned int i=2; i<args.size(); ++i) {
  31. depends.push_back(args[i]);
  32. }
  33. }
  34. std::string utility_name("INCLUDE_EXTERNAL_MSPROJECT");
  35. utility_name += "_";
  36. utility_name += args[0];
  37. m_Makefile->AddUtilityCommand(utility_name.c_str(), "echo", "\"Include external project\"",
  38. false, name_and_location, depends);
  39. }
  40. return true;
  41. }