| function(list_subtract lhs rhs result_var_name) |
| set(result) |
| foreach(item IN LISTS lhs) |
| list(FIND rhs "${item}" index) |
| if(${index} EQUAL -1) |
| list(APPEND result "${item}") |
| endif() |
| endforeach() |
| set("${result_var_name}" "${result}" PARENT_SCOPE) |
| endfunction() |
| |
| function(list_intersect lhs rhs result_var_name) |
| set(result) |
| foreach(item IN LISTS lhs) |
| list(FIND rhs "${item}" index) |
| if(NOT ${index} EQUAL -1) |
| list(APPEND result "${item}") |
| endif() |
| endforeach() |
| set("${result_var_name}" "${result}" PARENT_SCOPE) |
| endfunction() |
| |