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

# Returns a list of arguments that evaluate to true
function(count_true output_count_var)
  set(lst)
  foreach(option_var IN LISTS ARGN)
    if(${option_var})
      list(APPEND lst ${option_var})
    endif()
  endforeach()
  list(LENGTH lst lst_len)
  set(${output_count_var} ${lst_len} PARENT_SCOPE)
endfunction()