cmInstallTargetsCommand.cxx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 "cmInstallTargetsCommand.h"
  14. // cmExecutableCommand
  15. bool cmInstallTargetsCommand::InitialPass(std::vector<std::string> const& args)
  16. {
  17. if(args.size() < 2 )
  18. {
  19. this->SetError("called with incorrect number of arguments");
  20. return false;
  21. }
  22. cmTargets &tgts = m_Makefile->GetTargets();
  23. std::vector<std::string>::const_iterator s = args.begin();
  24. ++s;
  25. std::string runtime_dir = "/bin";
  26. for (;s != args.end(); ++s)
  27. {
  28. if (*s == "RUNTIME_DIRECTORY")
  29. {
  30. ++s;
  31. if ( s == args.end() )
  32. {
  33. this->SetError("called with RUNTIME_DIRECTORY but no actual directory");
  34. return false;
  35. }
  36. runtime_dir = *s;
  37. }
  38. else if (tgts.find(*s) != tgts.end())
  39. {
  40. tgts[*s].SetInstallPath(args[0].c_str());
  41. tgts[*s].SetRuntimeInstallPath(runtime_dir.c_str());
  42. }
  43. }
  44. return true;
  45. }