You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

68 lines
1.9 KiB

  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Insight Consortium. All rights reserved.
  8. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm 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 "cmLinkLibrariesCommand.h"
  14. // cmLinkLibrariesCommand
  15. bool cmLinkLibrariesCommand::InitialPass(std::vector<std::string> const& argsIn)
  16. {
  17. if(argsIn.size() < 1 )
  18. {
  19. return true;
  20. }
  21. std::vector<std::string> args;
  22. cmSystemTools::ExpandListArguments(argsIn, args);
  23. // add libraries, nothe that there is an optional prefix
  24. // of debug and optimized than can be used
  25. for(std::vector<std::string>::const_iterator i = args.begin();
  26. i != args.end(); ++i)
  27. {
  28. if (*i == "debug")
  29. {
  30. ++i;
  31. m_Makefile->AddLinkLibrary(i->c_str(),
  32. cmTarget::DEBUG);
  33. }
  34. else if (*i == "optimized")
  35. {
  36. ++i;
  37. m_Makefile->AddLinkLibrary(i->c_str(),
  38. cmTarget::OPTIMIZED);
  39. }
  40. else
  41. {
  42. m_Makefile->AddLinkLibrary(i->c_str());
  43. }
  44. const char* ldir = m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH");
  45. if (cmSystemTools::IsOff(ldir))
  46. {
  47. std::string libPath = *i + "_CMAKE_PATH";
  48. const char* dir = m_Makefile->GetDefinition(libPath.c_str());
  49. if( dir )
  50. {
  51. m_Makefile->AddLinkDirectory( dir );
  52. }
  53. }
  54. else
  55. {
  56. m_Makefile->AddLinkDirectory( ldir );
  57. }
  58. }
  59. return true;
  60. }