BUG: add link directories for target link libraries and add a test for it
This commit is contained in:
parent
e8e42bde66
commit
4591e41a62
|
@ -49,6 +49,17 @@ bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string> const& a
|
|||
m_Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(),
|
||||
cmTarget::GENERAL);
|
||||
}
|
||||
// if this is a library that cmake knows about, and LIBRARY_OUTPUT_PATH
|
||||
// is not set, then add the link directory
|
||||
const char* ldir = m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH");
|
||||
if (cmSystemTools::IsOff(ldir))
|
||||
{
|
||||
const char* dir = m_Makefile->GetDefinition(i->c_str());
|
||||
if( dir )
|
||||
{
|
||||
m_Makefile->AddLinkDirectory( dir );
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
# a simple test case
|
||||
PROJECT (simple)
|
||||
ADD_EXECUTABLE (simple simple.cxx)
|
||||
ADD_LIBRARY(simpleLib STATIC simpleLib.cxx)
|
||||
TARGET_LINK_LIBRARIES(simple simpleLib)
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
extern void simpleLib();
|
||||
int main ()
|
||||
{
|
||||
simpleLib();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
void simpleLib()
|
||||
{
|
||||
}
|
Loading…
Reference in New Issue