-
Notifications
You must be signed in to change notification settings - Fork 5
/
Summary.cmake
48 lines (45 loc) · 1.66 KB
/
Summary.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
set(summary_willbuild "")
set(summary_willbuild_d "")
set(summary_willnotbuild "")
set(summary_willnotbuild_d "")
set(max_name_length "0")
macro(summary_add name description test)
string(LENGTH ${name} namelength)
if (${namelength} GREATER ${max_name_length})
set (max_name_length ${namelength})
endif (${namelength} GREATER ${max_name_length})
if (${test} ${ARGN})
list(APPEND summary_willbuild "${name}")
list(APPEND summary_willbuild_d "${description}")
else (${test} ${ARGN})
list(APPEND summary_willnotbuild "${name}")
list(APPEND summary_willnotbuild_d "${description}")
endif (${test} ${ARGN})
endmacro(summary_add)
macro(summary_show_part variable descriptions title)
list(LENGTH ${variable} _len)
if (_len)
message("")
message(${title})
message("-----------------------------------------------")
math(EXPR _max_range "${_len} - 1")
foreach (_index RANGE 0 ${_max_range})
list(GET ${variable} ${_index} _item)
list(GET ${descriptions} ${_index} _description)
string(LENGTH ${_item} _item_len)
set(indent_str "")
math(EXPR indent_size "${max_name_length} - ${_item_len}")
foreach(loopy RANGE ${indent_size})
set(indent_str "${indent_str} ")
endforeach(loopy)
message(" ${_item} ${indent_str}- ${_description}.")
endforeach (_index)
endif (_len)
endmacro(summary_show_part)
macro(summary_show)
summary_show_part(summary_willbuild summary_willbuild_d
"The following components will be built:")
summary_show_part(summary_willnotbuild summary_willnotbuild_d
"The following components WILL NOT be built:")
message("")
endmacro(summary_show)