From: 박종현/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Tue, 8 Jan 2019 08:38:46 +0000 (+0900) Subject: ExternalSource_Download with URL keyword (#2784) X-Git-Tag: nncc_backup~1013 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=159cd62ca5ca67168c897afe96edff22b999f22e;p=platform%2Fcore%2Fml%2Fnnfw.git ExternalSource_Download with URL keyword (#2784) 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 --- diff --git a/cmake/modules/ExternalSourceTools.cmake b/cmake/modules/ExternalSourceTools.cmake index d75ce2e..3169d6f 100644 --- a/cmake/modules/ExternalSourceTools.cmake +++ b/cmake/modules/ExternalSourceTools.cmake @@ -1,10 +1,18 @@ # # 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)