diff options
Diffstat (limited to 'Utilities/cmcurl/CMake/Utilities.cmake')
-rw-r--r-- | Utilities/cmcurl/CMake/Utilities.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Utilities/cmcurl/CMake/Utilities.cmake b/Utilities/cmcurl/CMake/Utilities.cmake index 37cdfe3..8b6276d 100644 --- a/Utilities/cmcurl/CMake/Utilities.cmake +++ b/Utilities/cmcurl/CMake/Utilities.cmake @@ -29,3 +29,16 @@ function(IN_STR_LIST LIST_NAME ITEM_SEARCHED RETVAL) set(${RETVAL} TRUE PARENT_SCOPE) endif() endfunction() + +# 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() |