15 lines
546 B
CMake
15 lines
546 B
CMake
|
# Collect all currently added targets in all subdirectories
|
||
|
#
|
||
|
# Parameters:
|
||
|
# - _result the list containing all found targets
|
||
|
# - _dir root directory to start looking from
|
||
|
function(get_all_targets _result _dir)
|
||
|
get_property(_subdirs DIRECTORY "${_dir}" PROPERTY SUBDIRECTORIES)
|
||
|
foreach(_subdir IN LISTS _subdirs)
|
||
|
get_all_targets(${_result} "${_subdir}")
|
||
|
endforeach()
|
||
|
|
||
|
get_directory_property(_sub_targets DIRECTORY "${_dir}" BUILDSYSTEM_TARGETS)
|
||
|
set(${_result} ${${_result}} ${_sub_targets} PARENT_SCOPE)
|
||
|
endfunction()
|