-
-
Save felix-kolbe/794810d036f40ddf7f96fa0d3a5c1f93 to your computer and use it in GitHub Desktop.
Find all library dependencies of a CMake targets, recursively
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function(print_all_libs TGT INDENT) | |
| get_target_property(LIBS ${TGT} LINK_LIBRARIES) | |
| if (LIBS) | |
| foreach(LIB IN LISTS LIBS) | |
| message(STATUS "${INDENT}> ${LIB}") | |
| print_all_libs(${LIB} "${INDENT} ") | |
| endforeach() | |
| endif() | |
| endfunction() | |
| message(STATUS "All lib dependencies of app:") | |
| print_all_libs(app "") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment