MantisBT - CMake
View Issue Details
0012435CMakeCMakepublic2011-08-31 09:432016-06-10 14:31
chrislu 
Kitware Robot 
immediateblockalways
closedmoved 
PCWindows7 x64 SP1
CMake 2.8.5 
 
0012435: Possibility to get all link libraries for a target?
Hi,
i need to retrieve all link libraries currently bound to a target. Especially i need all link libraries introduced transitively though dependencies.

So i have a library lib0 that i link lib1 and lib2 against. Now when i create an executable exe0 that i link lib0 against lib1 and lib2 are also linked to exe0. I need a way to retrieve all libraries for the target exe0.

Thanks
-chris
No tags attached.
Issue History
2011-08-31 09:43chrisluNew Issue
2011-09-13 13:17Alex NeundorfNote Added: 0027414
2011-09-19 06:25chrisluNote Added: 0027445
2011-09-19 19:40Alex NeundorfNote Added: 0027456
2012-08-11 11:38David ColeStatusnew => backlog
2012-08-11 11:38David ColeNote Added: 0030307
2013-12-07 10:48Stephen KellyAssigned To => Stephen Kelly
2013-12-07 10:48Stephen KellyStatusbacklog => assigned
2014-06-22 06:32Stephen KellyAssigned ToStephen Kelly =>
2014-06-22 06:32Stephen KellyStatusassigned => backlog
2015-09-25 08:50Johannes S. Mueller-RoemerNote Added: 0039477
2015-09-25 08:50Johannes S. Mueller-RoemerNote Edited: 0039477bug_revision_view_page.php?bugnote_id=39477#r1914
2016-06-10 14:28Kitware RobotNote Added: 0041898
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0027414)
Alex Neundorf   
2011-09-13 13:17   
You could try to write this information into a file using export_library_dependencies(), and then include() this file. Not sure this works, but you can give it a try.

Beside that, for what do you need this information ?

Alex
(0027445)
chrislu   
2011-09-19 06:25   
Hi,
this issue is closely related to the following issue [1]. I need all the dependencies to be able to copy the related dlls to the executable directory.

For this problem CMake is currently more then useless. I is very depressing to see what hurdles we have to take to do something essentially easy (relase and debug targets getting different post build events etc.).

[1] http://public.kitware.com/Bug/view.php?id=12438 [^]

-chris
(0027456)
Alex Neundorf   
2011-09-19 19:40   
For installation ?
There is a cmake macro which does something like that, but I have never used it myself.
You may have a look at GetPrerequisites.cmake and/or BundleUtilities.cmake .

Alex
(0030307)
David Cole   
2012-08-11 11:38   
Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0039477)
Johannes S. Mueller-Roemer   
2015-09-25 08:50   
As I just ran into the issue of this feature missing (see http://stackoverflow.com/questions/32756195/recursive-list-of-link-libraries-in-cmake [^] ), I would like to revive interest in this issue.

In particularly, note how $<TARGET_PROPERTY:tgt,INCLUDE_DIRECTORIES> and $<TARGET_PROPERTY:tgt,COMPILE_DEFINITIONS> already "do the right thing" and report the transitive list of include directories / compile definitions. $<TARGET_PROPERTY:tgt,LINK_LIBRARIES>, however, does not.

(0041898)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.