2020-06-27 06:06:30 +08:00
|
|
|
function(vcpkg_from_sourceforge)
|
2021-07-15 03:45:18 +08:00
|
|
|
cmake_parse_arguments(PARSE_ARGV 0 "arg"
|
|
|
|
"DISABLE_SSL;NO_REMOVE_ONE_LEVEL"
|
|
|
|
"OUT_SOURCE_PATH;REPO;REF;SHA512;FILENAME;WORKING_DIRECTORY"
|
|
|
|
"PATCHES")
|
2020-06-27 06:06:30 +08:00
|
|
|
|
2023-11-15 06:01:08 +08:00
|
|
|
foreach(arg_name IN ITEMS OUT_SOURCE_PATH SHA512 REPO FILENAME)
|
|
|
|
if(NOT DEFINED "arg_${arg_name}")
|
|
|
|
message(FATAL_ERROR "${arg_name} is required.")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2020-07-14 04:43:39 +08:00
|
|
|
|
2021-07-15 03:45:18 +08:00
|
|
|
if(arg_DISABLE_SSL)
|
|
|
|
message(WARNING "DISABLE_SSL has been deprecated and has no effect")
|
2020-06-27 06:06:30 +08:00
|
|
|
endif()
|
|
|
|
|
2023-11-15 06:01:08 +08:00
|
|
|
if(DEFINED arg_UNPARSED_ARGUMENTS)
|
|
|
|
message(FATAL_ERROR "Unrecognized arguments: ${arg_UNPARSED_ARGUMENTS}")
|
2021-07-15 03:45:18 +08:00
|
|
|
endif()
|
2021-06-05 07:48:26 +08:00
|
|
|
|
2023-11-15 06:01:08 +08:00
|
|
|
vcpkg_download_sourceforge(ARCHIVE
|
|
|
|
REPO "${arg_REPO}"
|
|
|
|
REF "${arg_REF}"
|
2021-07-15 03:45:18 +08:00
|
|
|
SHA512 "${arg_SHA512}"
|
|
|
|
FILENAME "${arg_FILENAME}"
|
2020-06-27 06:06:30 +08:00
|
|
|
)
|
|
|
|
|
2021-07-15 03:45:18 +08:00
|
|
|
set(no_remove_one_level_param "")
|
|
|
|
if(arg_NO_REMOVE_ONE_LEVEL)
|
|
|
|
set(no_remove_one_level_param "NO_REMOVE_ONE_LEVEL")
|
|
|
|
endif()
|
2023-11-15 06:01:08 +08:00
|
|
|
set(working_directory_param "")
|
2021-07-15 03:45:18 +08:00
|
|
|
if(DEFINED arg_WORKING_DIRECTORY)
|
|
|
|
set(working_directory_param "WORKING_DIRECTORY" "${arg_WORKING_DIRECTORY}")
|
|
|
|
endif()
|
2020-06-27 06:06:30 +08:00
|
|
|
vcpkg_extract_source_archive_ex(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
ARCHIVE "${ARCHIVE}"
|
2021-07-15 03:45:18 +08:00
|
|
|
REF "${sanitized_ref}"
|
|
|
|
${no_remove_one_level_param}
|
|
|
|
${working_directory_param}
|
|
|
|
PATCHES ${arg_PATCHES}
|
2020-06-27 06:06:30 +08:00
|
|
|
)
|
|
|
|
|
2021-07-15 03:45:18 +08:00
|
|
|
set("${arg_OUT_SOURCE_PATH}" "${SOURCE_PATH}" PARENT_SCOPE)
|
2020-06-27 06:06:30 +08:00
|
|
|
endfunction()
|