deps/curl/CMake/Utilities.cmake
raw| 1 | # File containing various utilities |
| 2 | |
| 3 | # Returns a list of arguments that evaluate to true |
| 4 | function(count_true output_count_var) |
| 5 | set(lst_len 0) |
| 6 | foreach(option_var IN LISTS ARGN) |
| 7 | if(${option_var}) |
| 8 | math(EXPR lst_len "${lst_len} + 1") |
| 9 | endif() |
| 10 | endforeach() |
| 11 | set(${output_count_var} ${lst_len} PARENT_SCOPE) |
| 12 | endfunction() |