2009-04-10 05:16:28 +08:00
|
|
|
# File containing various utilities
|
|
|
|
|
2017-02-21 08:33:53 +08:00
|
|
|
# Returns a list of arguments that evaluate to true
|
2018-07-05 18:21:57 +08:00
|
|
|
function(count_true output_count_var)
|
2020-02-24 20:34:54 +08:00
|
|
|
set(lst_len 0)
|
2017-02-21 08:33:53 +08:00
|
|
|
foreach(option_var IN LISTS ARGN)
|
|
|
|
if(${option_var})
|
2020-02-24 20:34:54 +08:00
|
|
|
math(EXPR lst_len "${lst_len} + 1")
|
2017-02-21 08:33:53 +08:00
|
|
|
endif()
|
|
|
|
endforeach()
|
2018-07-05 18:21:57 +08:00
|
|
|
set(${output_count_var} ${lst_len} PARENT_SCOPE)
|
2017-02-21 08:33:53 +08:00
|
|
|
endfunction()
|