summaryrefslogtreecommitdiff
path: root/CMake/Utilities.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'CMake/Utilities.cmake')
-rw-r--r--CMake/Utilities.cmake11
1 files changed, 5 insertions, 6 deletions
diff --git a/CMake/Utilities.cmake b/CMake/Utilities.cmake
index 8425bbd78..5cb1d4497 100644
--- a/CMake/Utilities.cmake
+++ b/CMake/Utilities.cmake
@@ -1,14 +1,13 @@
# File containing various utilities
# Returns a list of arguments that evaluate to true
-function(collect_true output_var output_count_var)
- set(${output_var})
+function(count_true output_count_var)
+ set(lst)
foreach(option_var IN LISTS ARGN)
if(${option_var})
- list(APPEND ${output_var} ${option_var})
+ list(APPEND lst ${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)
+ list(LENGTH lst lst_len)
+ set(${output_count_var} ${lst_len} PARENT_SCOPE)
endfunction()