[cmake-developers] Support for imported targets in CMAKE_REQUIRED_LIBRARIES

Brad King brad.king at kitware.com
Mon Jan 23 09:12:35 EST 2012


On 1/21/2012 5:58 PM, Alexander Neundorf wrote:
> To get the link line I moved code from cmLocalGenerator::OutputLinkLibraries()
> into a separate function GetLinkLine(cmTarget, cmComputeLinkInformation).
> But before I get there I get a segfault:
[snip]
> It crashes in cmTarget::ComputeLinkClosure() because
> mTarget::GetLinkImplementation() returns 0 for imported targets. It probably
> should not get there at all, since calling GetLinkerLanguage() always leads to
> that path.

The OutputLinkLibraries method is in generators so it is meant only for
handling targets that are built in the project.  It is not written to
work for imported targets.

-Brad



More information about the cmake-developers mailing list