summaryrefslogtreecommitdiff
path: root/CMake/Utilities.cmake
blob: ffc411ae98b21ab972919e6eb3ec419f8c05d8b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# File containing various utilities

# Returns a list of arguments that evaluate to true
function(count_true output_count_var)
  set(lst_len 0)
  foreach(option_var IN LISTS ARGN)
    if(${option_var})
      math(EXPR lst_len "${lst_len} + 1")
    endif()
  endforeach()
  set(${output_count_var} ${lst_len} PARENT_SCOPE)
endfunction()