etlegacy-libs/curl/CMake/Utilities.cmake

13 lines
336 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)
2020-03-26 12:29:51 +00:00
set(lst_len 0)
2017-07-01 14:06:24 +00:00
foreach(option_var IN LISTS ARGN)
if(${option_var})
2020-03-26 12:29:51 +00:00
math(EXPR lst_len "${lst_len} + 1")
2017-07-01 14:06:24 +00:00
endif()
endforeach()
2018-07-15 15:57:46 +00:00
set(${output_count_var} ${lst_len} PARENT_SCOPE)
2017-07-01 14:06:24 +00:00
endfunction()