[cmake-developers] LINK_INTERFACE_LIBRARIES-genex topic review

Stephen Kelly steveire at gmail.com
Thu Jan 10 11:06:28 EST 2013


Brad King wrote:

> Steve,
> 
> While reviewing this topic I ran the ExportImport test to look for
> generator expressions in a link interface property.  I do not see
> any.  The test C++ code appears to verify that libraries are linked
> but it is compiled into a static library as added by this commit:
> 
>  http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=894f52f3#patch7
> 
> Therefore it never really links.  If I change add_library to
> add_executable then the test fails with
> 
>  /usr/bin/ld: cannot find -ltestLibsDepends
> 
> If I fix the typo (s/Libs/Lib/) then it fails with
> 
>  deps_iface.cpp:(.text+0x11): undefined reference to `testLibDepends()'
>  deps_iface.cpp:(.text+0x1f): undefined reference to
>  `TestLibLibraryRequired::foo()'
> 
> because the library is not actually linked.
> 
> Please take a look.
> 

Thanks for trying it.

I get the same linking error after applying the typo fix and the change to 
add_executable on master. 

After cd Import/A in the build dir, and make VERBOSE=1, I get this:

/usr/lib/icecc/bin/c++   -g    CMakeFiles/deps_iface.dir/deps_iface.cpp.o  -
o deps_iface -rdynamic 
/home/stephen/dev/src/cmake/Tests/ExportImport/build/Root/lib/libtestLibDepends.a 
/home/stephen/dev/src/cmake/Tests/ExportImport/build/Root/lib/libtestLibRequired.a

so it seems that the libraries are being passed to the linker, but the 
symbols are not being resolved? I haven't yet seen why that is. Any ideas?

Thanks,

Steve.






More information about the cmake-developers mailing list