cmIncludeExternalMSProjectCommand.cxx 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. if(m_Makefile->GetDefinition("WIN32")) {
  23. std::string location = args[1];
  24. std::vector<std::string> name_and_location;
  25. name_and_location.push_back(args[0]);
  26. name_and_location.push_back(location);
  27. std::vector<std::string> depends;
  28. if (args.size() > 2) {
  29. for (unsigned int i=2; i<args.size(); ++i) {
  30. depends.push_back(args[i]);
  31. }
  32. }
  33. std::string utility_name("INCLUDE_EXTERNAL_MSPROJECT");
  34. utility_name += "_";
  35. utility_name += args[0];
  36. m_Makefile->AddUtilityCommand(utility_name.c_str(), "echo", "\"Include external project\"",
  37. false, name_and_location, depends);
  38. }
  39. return true;
  40. }