1 function(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)
5 endfunction(get_fq_target_name)
7 function(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)
11 endfunction(is_relative_target_name)
13 function(get_fq_dep_name fq_name name)
14 is_relative_target_name(${name} "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)
21 set(${fq_name} ${name} PARENT_SCOPE)
23 endfunction(get_fq_dep_name)
25 function(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})
31 set(${output_list} ${fq_dep_name_list} PARENT_SCOPE)
32 endfunction(get_fq_deps_list)