cmIncludeExternalMSProjectCommand.cxx 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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(m_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. const char* no_output = 0;
  39. const char* no_working_directory = 0;
  40. m_Makefile->AddUtilityCommand(utility_name.c_str(), true,
  41. no_output, depends,
  42. no_working_directory,
  43. args[0].c_str(), args[1].c_str());
  44. }
  45. #endif
  46. return true;
  47. }