BUG: add link directories for target link libraries and add a test for it

This commit is contained in:
Bill Hoffman 2002-04-19 15:28:43 -04:00
parent e8e42bde66
commit 4591e41a62
4 changed files with 19 additions and 1 deletions

View File

@ -49,6 +49,17 @@ bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string> const& a
m_Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(), m_Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(),
cmTarget::GENERAL); 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; return true;
} }

View File

@ -1,3 +1,5 @@
# a simple test case # a simple test case
PROJECT (simple) PROJECT (simple)
ADD_EXECUTABLE (simple simple.cxx) ADD_EXECUTABLE (simple simple.cxx)
ADD_LIBRARY(simpleLib STATIC simpleLib.cxx)
TARGET_LINK_LIBRARIES(simple simpleLib)

View File

@ -1,4 +1,6 @@
extern void simpleLib();
int main () int main ()
{ {
simpleLib();
return 0; return 0;
} }

View File

@ -0,0 +1,3 @@
void simpleLib()
{
}