1function(get_fq_target_name local_name target_name_var) 2 file(RELATIVE_PATH rel_path ${LIBC_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) 3 string(REPLACE "/" "." fq_name "libc.${rel_path}.${local_name}") 4 set(${target_name_var} ${fq_name} PARENT_SCOPE) 5endfunction(get_fq_target_name) 6 7function(is_relative_target_name target_name output_var) 8 string(FIND ${target_name} "." dot_loc) 9 string(COMPARE EQUAL "0" ${dot_loc} is_relative) 10 set(${output_var} ${is_relative} PARENT_SCOPE) 11endfunction(is_relative_target_name) 12 13function(get_fq_dep_name fq_name name) 14 is_relative_target_name(${name} "is_relative") 15 if(is_relative) 16 # Skip over the first '.' character. 17 string(SUBSTRING ${name} 1 -1 local_name) 18 get_fq_target_name(${local_name} fully_qualified_name) 19 set(${fq_name} ${fully_qualified_name} PARENT_SCOPE) 20 else() 21 set(${fq_name} ${name} PARENT_SCOPE) 22 endif() 23endfunction(get_fq_dep_name) 24 25function(get_fq_deps_list output_list) 26 set(fq_dep_name_list "") 27 foreach(dep IN LISTS ARGN) 28 get_fq_dep_name(fq_dep_name ${dep}) 29 list(APPEND fq_dep_name_list ${fq_dep_name}) 30 endforeach(dep) 31 set(${output_list} ${fq_dep_name_list} PARENT_SCOPE) 32endfunction(get_fq_deps_list) 33