This commit updates ExternalSource_Download to accept URL keyword as an
argument of the following form:
ExternalSource_Download(SAMPLE DIRNAME "SAMPLE" URL "...")
This change will make it easy to understand CMake build script.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
#
# ExternalSource_Download(VAR ...)
#
-function(ExternalSource_Download PREFIX URL)
+function(ExternalSource_Download PREFIX)
include(CMakeParseArguments)
- cmake_parse_arguments(ARG "" "DIRNAME" "" ${ARGN})
+ cmake_parse_arguments(ARG "" "DIRNAME;URL" "" ${ARGN})
+
+ # Configure URL
+ if(ARG_URL)
+ set(URL ${ARG_URL})
+ else()
+ # Use the first unparsed argument as URL (for backward compatibility)
+ list(GET ARG_UNPARSED_ARGUMENTS 0 URL)
+ endif(ARG_URL)
# Configure DIRNAME
if(NOT ARG_DIRNAME)