[CMake] [Cmake] Retrieve all runtime dependencies

Klaim - Joël Lamotte mjklaim at gmail.com
Mon Sep 3 11:05:57 EDT 2012


Hi,

Is there any way in CMake to get a list of all binaries related to one
target?
What I mean is that assuming I have a target, say a library lib_a, that
depends on lib_b and lib_c which are either SHARED or MODULE (so they
produce a .dll/.so),
is there a way or macro to get a string with the paths of each binary
output:
   .../.../.../lib_a.dll
   .../.../.../lib_b.dll
   .../.../.../lib_c.dll
on windows, assuming I only provide the target name libi_a?

My first thinking was that as CMake produce project files that have all
these information, then it should be possible to get this list in some way.
However I'm a bit lost on where to find the necessary information, in a
generic way.
Also, I think the build mode should be provided to any function or macro
that would provide such a list.

It would be extremely useful (to me) to get such a list, to apply some
target's post-build scripts to these binaries.
The simpler alternative is to have such list hand-written outside of CMake
scripts, making the information located at more than one locations.

Joel Lamotte / Klaim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120903/e78bc6ad/attachment.htm>


More information about the CMake mailing list