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

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