cmIncludeExternalMSProjectCommand.cxx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html 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. // only compile this for win32 to avoid coverage errors
  23. #ifdef _WIN32
  24. if(this->Makefile->GetDefinition("WIN32"))
  25. {
  26. std::string location = args[1];
  27. std::vector<std::string> depends;
  28. if (args.size() > 2)
  29. {
  30. for (unsigned int i=2; i<args.size(); ++i)
  31. {
  32. depends.push_back(args[i]);
  33. }
  34. }
  35. std::string utility_name("INCLUDE_EXTERNAL_MSPROJECT");
  36. utility_name += "_";
  37. utility_name += args[0];
  38. std::string path = args[1];
  39. cmSystemTools::ConvertToUnixSlashes(path);
  40. const char* no_output = 0;
  41. const char* no_working_directory = 0;
  42. this->Makefile->AddUtilityCommand(utility_name.c_str(), true,
  43. no_output, depends,
  44. no_working_directory,
  45. args[0].c_str(), path.c_str());
  46. }
  47. #endif
  48. return true;
  49. }