Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Displaying a target's list of linked libraries in cmake

Tags:

Is there a way to print a list the filenames for the libraries linked into a target via the target_link_libraries command

or even better, have all a target's dependencies copied to a specific folder?

like image 459
Daniel Ogburn Avatar asked Apr 01 '15 20:04

Daniel Ogburn


People also ask

What does target link libraries do in CMake?

Specify libraries or flags to use when linking a given target and/or its dependents. Usage requirements from linked library targets will be propagated. Usage requirements of a target's dependencies affect compilation of its own sources.

What are targets in CMake?

Introduction. A CMake-based buildsystem is organized as a set of high-level logical targets. Each target corresponds to an executable or library, or is a custom target containing custom commands.


1 Answers

get_target_property(OUT Target LINK_LIBRARIES) message(STATUS ${OUT}) 
like image 185
AGuest Avatar answered Sep 18 '22 16:09

AGuest