etlegacy-libs/curl/CMake/Utilities.cmake

14 lines
352 B
CMake
Raw Normal View History

2012-06-01 15:23:17 +00:00
# File containing various utilities
2017-07-01 14:06:24 +00:00
# Returns a list of arguments that evaluate to true
2018-07-15 15:57:46 +00:00
function(count_true output_count_var)
set(lst)
2017-07-01 14:06:24 +00:00
foreach(option_var IN LISTS ARGN)
if(${option_var})
2018-07-15 15:57:46 +00:00
list(APPEND lst ${option_var})
2017-07-01 14:06:24 +00:00
endif()
endforeach()
2018-07-15 15:57:46 +00:00
list(LENGTH lst lst_len)
set(${output_count_var} ${lst_len} PARENT_SCOPE)
2017-07-01 14:06:24 +00:00
endfunction()