[CMake] Programs linked to .a or .so libraries?

Hendrik Sattler post at hendrik-sattler.de
Tue Aug 28 07:42:04 EDT 2007


Am Dienstag 28 August 2007 12:55 schrieb Convey Christian J NPRI:
> I'm creating installation packages for the software, and we have several
> goals:
>
> 1) We want to minimize the number of external dependencies required to use
> the software, so that installing it requires a minimum of fuss.

You could provide an additional binary package containing the needed 
libraries. Extremely easy ;)

> 2) I'm producing Debian packages for the software, so I need to know which
> dynamic libraries my program will need when it is executed.  For example,
> if my program has been linked to libFLTK.so, then my Debian package must
> state a package-dependency on the libfltk1.1 package.  But if my program
> has been linked to libFLTK.a, no such package dependency exists and
> therefore my own Debian package shouldn't list libfltk1.1 as a dependency.

Debian packages provide both .a and .so files but GNU ld will prefer the .so 
file.

> Because the computer that's being used to create the Debian packages might
> have both libFLTK.a and libFLTK.so installed on it, I need to control, or
> at least know, which version of the FLTK library was linked to my program.

If you build on Debian, can't you use the dh_shlibdeps with a proper debian/ 
directory?
Otherwise, you can use "objdump -x <yourprogram> | grep NEEDED" to get a list 
of linked libs and look up in /var/lib/dpkg/info/*.shlibs the proper 
dependency for the control file.

HS


More information about the CMake mailing list