Is there a less annoying way of doing this?
function(get_dependent_targets TARGET RETURN)
get_property(LOC TARGET ${TARGET} PROPERTY LOCATION)
set(RTN ${LOC})
get_property(LIBS TARGET ${TARGET} PROPERTY LINK_LIBRARIES)
foreach(LIB ${LIBS})
get_dependent_targets(${LIB} LIB_LIST)
foreach(LIBI ${LIB_LIST})
list(APPEND RTN ${LIBI})
endforeach()
endforeach()
set(${RETURN} ${RTN} PARENT_SCOPE)
endfunction()
Specifically I'm trying to generate a list of static link targets for a
library to output ot a file using the template system so that a rust build
can statically link correctly to all the dependent static targets for a
given library...
~
Doug.
--
Powered by www.kitware.com
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Kitware offers various services to support the CMake community. For more
information on each offering, please visit:
CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake