Skip to content

Instantly share code, notes, and snippets.

@felix-kolbe
felix-kolbe / tricks.cmake
Last active September 1, 2025 06:22 — forked from mikedld/CMakeLists.txt
Find all library dependencies of a CMake targets, recursively
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()