[CMake] [Cmake] Retrieve all runtime dependencies

John Drescher drescherjm at gmail.com
Mon Sep 3 12:45:56 EDT 2012


On Mon, Sep 3, 2012 at 11:05 AM, Klaim - Joël Lamotte <mjklaim at gmail.com> wrote:
> 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.
>

take a look at the GetPrerequisites cmake module.

-- 
John M. Drescher


More information about the CMake mailing list