[cmake-developers] OpenBSD without SONAME (was: New no-soname-option topic for e.g. Android)

Brad King brad.king at kitware.com
Thu May 29 12:52:41 EDT 2014


On 05/29/2014 12:32 PM, Vadim Zhukov wrote:
> I was not aware of such issue before that question. :) Yes, paths are
> written in NEEDED entries if requested, that's what CMake does for
> "external" libraries (outside project). Internal libraries are linked
> by name, though, allowing to relocate the resulting software package,
> if needed.

CMake does not consider whether a library is internal or external
to the build tree.  If a library is located in an implicit linker
search path like /usr/lib then it will be linked by -l instead of
a full path.

This is because find_library is not arch-aware so when it finds paths
like /usr/lib/libz.so then the proper library might actually be
/usr/lib/$arch/libz.so so we use -lz to let the linker choose it.
This is a hack that should be removed someday by improving find_library.
Since the hack was created, CMake has learned to detect the actual linker
search path used by the compiler front-end, so that information could be
leveraged.

Once find_library is fixed then CMake will link all libraries by full
path.  It would have to be taught to not do so for libraries that do
not have the SONAME set.

-Brad




More information about the cmake-developers mailing list