]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - processor-sdk/open-amp.git/blob - cmake/collect.cmake
Update CMake files to compile OpenAMP for Linux
[processor-sdk/open-amp.git] / cmake / collect.cmake
1 function (collector_create name base)
2   set_property (GLOBAL PROPERTY "COLLECT_${name}_LIST")
3   set_property (GLOBAL PROPERTY "COLLECT_${name}_BASE" "${base}")
4 endfunction (collector_create)
6 function (collector_list var name)
7   get_property (_list GLOBAL PROPERTY "COLLECT_${name}_LIST")
8   set (${var} "${_list}" PARENT_SCOPE)
9 endfunction (collector_list)
11 function (collector_base var name)
12   get_property (_base GLOBAL PROPERTY "COLLECT_${name}_BASE")
13   set (${var} "${_base}" PARENT_SCOPE)
14 endfunction (collector_base)
16 function (collect name)
17   collector_base (_base ${name})
18   string(COMPARE NOTEQUAL "${_base}" "" _is_rel)
19   set (_list)
20   foreach (s IN LISTS ARGN)
21     if (_is_rel)
22       get_filename_component (s "${s}" ABSOLUTE)
23       file (RELATIVE_PATH s "${_base}" "${s}")
24     else (_is_rel)
25        get_filename_component (ts "${s}" ABSOLUTE)
26        if (EXISTS "${ts}")
27          set (s "${ts}")
28        endif (EXISTS "${ts}")
29     endif (_is_rel)
30     list (APPEND _list "${s}")
31   endforeach ()
32   set_property (GLOBAL APPEND PROPERTY "COLLECT_${name}_LIST" "${_list}")
33 endfunction (collect)
35 # Create global collectors
36 collector_create (PROJECT_INC_DIRS    "")
37 collector_create (PROJECT_LIB_DIRS    "")
38 collector_create (PROJECT_LIB_DEPS    "")
40 # vim: expandtab:ts=2:sw=2:smartindent