Skip to content
Snippets Groups Projects
Commit 3dfcae1c authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

tooling: allow empty options for add_fetch_content

Change-Id: If460259ef799c53ddd94e3c058fb5b42e77fbdcb
parent 50ce16e0
No related branches found
No related tags found
No related merge requests found
......@@ -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})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment