cmIncludeExternalMSProjectCommand.cxx 1.7 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> name_and_location;
  28. name_and_location.push_back(args[0]);
  29. name_and_location.push_back(location);
  30. std::vector<std::string> depends;
  31. if (args.size() > 2)
  32. {
  33. for (unsigned int i=2; i<args.size(); ++i)
  34. {
  35. depends.push_back(args[i]);
  36. }
  37. }
  38. std::string utility_name("INCLUDE_EXTERNAL_MSPROJECT");
  39. utility_name += "_";
  40. utility_name += args[0];
  41. m_Makefile->AddUtilityCommand(utility_name.c_str(), "echo", "\"Include external project\"",
  42. false, name_and_location, depends);
  43. }
  44. #endif
  45. return true;
  46. }