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,7 +49,18 @@ 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;
}

View File

@ -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)

View File

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

View File

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