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