1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-10 03:53:23 +02:00

tooling: allow empty options for add_fetch_content

Change-Id: If460259ef799c53ddd94e3c058fb5b42e77fbdcb
This commit is contained in:
Andreas Traczyk 2024-01-29 11:27:43 -05:00
parent 50ce16e0ab
commit 3dfcae1c09

View file

@ -71,13 +71,15 @@ function(add_fetch_content)
# Apply options
list(LENGTH AFCWP_OPTIONS options_length)
math(EXPR max_idx "${options_length} - 1")
foreach(idx RANGE 0 ${max_idx} 2)
list(GET AFCWP_OPTIONS ${idx} key)
math(EXPR value_idx "${idx} + 1")
list(GET AFCWP_OPTIONS ${value_idx} value)
set(${key} ${value} CACHE STRING "${key}" FORCE)
endforeach()
if(NOT ${options_length} EQUAL 0)
math(EXPR max_idx "${options_length} - 1")
foreach(idx RANGE 0 ${max_idx} 2)
list(GET AFCWP_OPTIONS ${idx} key)
math(EXPR value_idx "${idx} + 1")
list(GET AFCWP_OPTIONS ${value_idx} value)
set(${key} ${value} CACHE STRING "${key}" FORCE)
endforeach()
endif()
# Make the content available
FetchContent_MakeAvailable(${AFCWP_TARGET})