
function(get_all_targets _RESULT _DIRECTORY)
	get_property(_SUBDIRECTORIES DIRECTORY "${_DIRECTORY}" PROPERTY SUBDIRECTORIES)
	foreach(_SUBDIRECTORY IN LISTS _SUBDIRECTORIES)
		get_all_targets(${_RESULT} "${_SUBDIRECTORY}")
	endforeach()
	get_property(_SUBDIRECTORY_TARGETS DIRECTORY "${_DIRECTORY}" PROPERTY BUILDSYSTEM_TARGETS)
	set(${_RESULT} ${${_RESULT}} ${_SUBDIRECTORY_TARGETS} PARENT_SCOPE)
endfunction()
