1 /*=========================================================================
3 Program: Insight Segmentation & Registration Toolkit
4 Module: $RCSfile: cmLinkLibrariesCommand.cxx,v $
6 Date: $Date: 2002-07-22 14:01:53 $
7 Version: $Revision: 1.14 $
9 Copyright (c) 2002 Insight Consortium. All rights reserved.
10 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #include "cmLinkLibrariesCommand.h"
19 // cmLinkLibrariesCommand
20 bool cmLinkLibrariesCommand::InitialPass(std::vector
<std::string
> const& argsIn
)
22 if(argsIn
.size() < 1 )
26 std::vector
<std::string
> args
;
27 cmSystemTools::ExpandListArguments(argsIn
, args
);
28 // add libraries, nothe that there is an optional prefix
29 // of debug and optimized than can be used
30 for(std::vector
<std::string
>::const_iterator i
= args
.begin();
36 m_Makefile
->AddLinkLibrary(i
->c_str(),
39 else if (*i
== "optimized")
42 m_Makefile
->AddLinkLibrary(i
->c_str(),
47 m_Makefile
->AddLinkLibrary(i
->c_str());
50 const char* ldir
= m_Makefile
->GetDefinition("LIBRARY_OUTPUT_PATH");
51 if (cmSystemTools::IsOff(ldir
))
53 std::string libPath
= *i
+ "_CMAKE_PATH";
54 const char* dir
= m_Makefile
->GetDefinition(libPath
.c_str());
57 m_Makefile
->AddLinkDirectory( dir
);
62 m_Makefile
->AddLinkDirectory( ldir
);