diff options
author | Michael Maltese <michaeljosephmaltese@gmail.com> | 2017-02-20 16:33:53 -0800 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2017-03-05 14:42:53 +0100 |
commit | 813263dc3a45a886d5bcb810555a4a32eb3a3f70 (patch) | |
tree | 1ef88921e732ce0329746dafcf83a3e6f998626b /CMake | |
parent | c6a97466b9c24000321ac0bcc96cceabb71b47e7 (diff) |
CMake: Set at most one SSL library
Ref: https://github.com/curl/curl/pull/1228
Diffstat (limited to 'CMake')
-rw-r--r-- | CMake/Utilities.cmake | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CMake/Utilities.cmake b/CMake/Utilities.cmake index 37cdfe3bf..8b6276df6 100644 --- a/CMake/Utilities.cmake +++ b/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() |