I am using CMake to configure a flutter plugin I am creating.
I have this macro to download a zip file from github repo:
# Download the zipped folder of dart-sdk-api from the dependencies repo
set(dart_sdk_api_zip_url "https://github.com/Haidar0096/image_magick_ffi_deps/raw/master/dart_sdk_api.zip")
message(STATUS "Downloading dart-sdk-api from ${dart_sdk_api_zip_url}")
FetchContent_Declare(
dart_sdk_api
URL ${dart_sdk_api_zip_url}
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)
FetchContent_MakeAvailable(dart_sdk_api)
# Include the include folder of dart_sdk_api from the downloaded zip
include_directories(${dart_sdk_api_SOURCE_DIR}/include)
# Create a target from the sources of the downloaded zip and link it to the executable
file(GLOB_RECURSE DART_SDK_API_SOURCES "${dart_sdk_api_SOURCE_DIR}/src/*.c")
add_library(dart_sdk_api STATIC ${DART_SDK_API_SOURCES})
target_link_libraries(image_magick_ffi dart_sdk_api)
It works well if I build for windows, and downloads normally.
However if I build for android, I get this error and build fails:
[ ] Successfully started process 'command 'C:\Users\haidar\AppData\Local\Android\Sdk\cmake\3.18.1\bin\cmake.exe''
[ ] C/C++: debug|arm64-v8a :CMake Error at C:/Users/haidar/AppData/Local/Android/Sdk/cmake/3.18.1/share/cmake-3.18/Modules/ExternalProject.cmake:2480 (message):
[ ] C/C++: debug|arm64-v8a : At least one entry of URL is a path (invalid in a list)
[ ] C/C++: debug|arm64-v8a :Call Stack (most recent call first):
[ ] C/C++: debug|arm64-v8a : C:/Users/haidar/AppData/Local/Android/Sdk/cmake/3.18.1/share/cmake-3.18/Modules/ExternalProject.cmake:3228 (_ep_add_download_command)
[ ] C/C++: debug|arm64-v8a : CMakeLists.txt:13 (ExternalProject_Add)
[ ] C/C++: debug|arm64-v8a :-- Configuring incomplete, errors occurred!
[ ] C/C++: debug|arm64-v8a :See also "D:/dev_haidar/flutter/image_magick_ffi/android/.cxx/Debug/42552b6e/arm64-v8a/_deps/dart_sdk_api-subbuild/CMakeFiles/CMakeOutput.log".
I don't understand what does this error mean and how should I solve it?
(The whole CMakeLists.txt is here but didn't include it because it is quite large)