2021-11-10 22:13:22 -08:00
function ( z_vcpkg_find_acquire_program_version_check out_var )
cmake_parse_arguments ( PARSE_ARGV 1 arg
2021-11-12 20:52:32 +01:00
" E X A C T _ V E R S I O N _ M A T C H "
2021-11-10 22:13:22 -08:00
" M I N _ V E R S I O N ; P R O G R A M _ N A M E "
" C O M M A N D "
2020-06-19 00:42:20 +02:00
)
2021-11-10 22:13:22 -08:00
vcpkg_execute_in_download_mode (
C O M M A N D $ { a r g _ C O M M A N D }
W O R K I N G _ D I R E C T O R Y " $ { V C P K G _ R O O T _ D I R } "
O U T P U T _ V A R I A B L E p r o g r a m _ v e r s i o n _ o u t p u t
2019-07-10 07:17:17 +01:00
)
2021-11-10 22:13:22 -08:00
string ( STRIP "${program_version_output}" program_version_output )
#TODO: REGEX MATCH case for more complex cases!
2021-11-12 20:52:32 +01:00
set ( version_compare VERSION_GREATER_EQUAL )
set ( version_compare_msg "at least" )
if ( arg_EXACT_VERSION_MATCH )
set ( version_compare VERSION_EQUAL )
set ( version_compare_msg "exact" )
endif ( )
if ( NOT "${program_version_output}" ${ version_compare } "${arg_MIN_VERSION}" )
message ( STATUS "Found ${arg_PROGRAM_NAME}('${program_version_output}') but ${version_compare_msg} version ${arg_MIN_VERSION} is required! Trying to use internal version if possible!" )
2021-11-10 22:13:22 -08:00
set ( "${out_var}" OFF PARENT_SCOPE )
2019-05-02 22:57:43 -07:00
else ( )
2021-11-10 22:13:22 -08:00
message ( STATUS "Found external ${arg_PROGRAM_NAME}('${program_version_output}')." )
set ( "${out_var}" ON PARENT_SCOPE )
2019-05-02 22:57:43 -07:00
endif ( )
2021-11-10 22:13:22 -08:00
endfunction ( )
function ( z_vcpkg_find_acquire_program_find_external program )
cmake_parse_arguments ( PARSE_ARGV 1 arg
2021-11-12 20:52:32 +01:00
" E X A C T _ V E R S I O N _ M A T C H "
2021-11-10 22:13:22 -08:00
" I N T E R P R E T E R ; M I N _ V E R S I O N ; P R O G R A M _ N A M E "
" N A M E S ; V E R S I O N _ C O M M A N D "
2020-01-27 17:44:33 -05:00
)
2021-11-12 20:52:32 +01:00
if ( arg_EXACT_VERSION_MATCH )
set ( arg_EXACT_VERSION_MATCH EXACT_VERSION_MATCH )
endif ( )
2021-11-10 22:13:22 -08:00
if ( "${arg_INTERPRETER}" STREQUAL "" )
find_program ( "${program}" NAMES ${ arg_NAMES } )
2018-03-30 16:59:59 -07:00
else ( )
2021-12-03 00:48:34 +01:00
find_file ( SCRIPT_ ${ arg_PROGRAM_NAME } NAMES ${ arg_NAMES } )
if ( SCRIPT_ ${ arg_PROGRAM_NAME } )
vcpkg_list ( SET program_tmp ${ ${interpreter } } ${ SCRIPT_${arg_PROGRAM_NAME } } )
2021-11-10 22:13:22 -08:00
set ( "${program}" "${program_tmp}" CACHE INTERNAL "" )
2021-12-03 00:48:34 +01:00
else ( )
set ( "${program}" "" CACHE INTERNAL "" )
2021-11-10 22:13:22 -08:00
endif ( )
2021-12-03 00:48:34 +01:00
unset ( SCRIPT_ ${ arg_PROGRAM_NAME } CACHE )
2018-03-30 16:59:59 -07:00
endif ( )
2021-11-10 22:13:22 -08:00
if ( "${version_command}" STREQUAL "" )
set ( version_is_good ON ) # can't check for the version being good, so assume it is
2021-12-03 00:48:34 +01:00
elseif ( ${ program } ) # only do a version check if ${program} has a value
2021-11-10 22:13:22 -08:00
z_vcpkg_find_acquire_program_version_check ( version_is_good
2021-11-12 20:52:32 +01:00
$ { a r g _ E X A C T _ V E R S I O N _ M A T C H }
2021-11-10 22:13:22 -08:00
C O M M A N D $ { $ { p r o g r a m } } $ { a r g _ V E R S I O N _ C O M M A N D }
M I N _ V E R S I O N " $ { a r g _ M I N _ V E R S I O N } "
P R O G R A M _ N A M E " $ { a r g _ P R O G R A M _ N A M E } "
)
2018-08-22 23:04:20 +02:00
endif ( )
2021-01-13 04:49:40 +01:00
2021-11-10 22:13:22 -08:00
if ( NOT version_is_good )
unset ( "${program}" PARENT_SCOPE )
2021-11-12 20:52:32 +01:00
unset ( "${program}" CACHE )
2020-10-23 03:29:35 -04:00
endif ( )
2021-11-10 22:13:22 -08:00
endfunction ( )
2020-10-23 03:29:35 -04:00
2021-11-10 22:13:22 -08:00
function ( z_vcpkg_find_acquire_program_find_internal program )
cmake_parse_arguments ( PARSE_ARGV 1 arg
" "
" I N T E R P R E T E R "
" N A M E S ; P A T H S "
)
if ( "${arg_INTERPRETER}" STREQUAL "" )
find_program ( ${ program }
N A M E S $ { a r g _ N A M E S }
P A T H S $ { a r g _ P A T H S }
N O _ D E F A U L T _ P A T H )
2019-08-20 12:13:26 -07:00
else ( )
2021-11-10 22:13:22 -08:00
vcpkg_find_acquire_program ( "${arg_INTERPRETER}" )
find_file ( SCRIPT_ ${ program }
N A M E S $ { a r g _ N A M E S }
P A T H S $ { a r g _ P A T H S }
N O _ D E F A U L T _ P A T H )
if ( SCRIPT_ ${ program } )
set ( "${program}" ${ ${arg_INTERPRETER } } ${ SCRIPT_${program } } CACHE INTERNAL "" )
endif ( )
2021-11-12 20:52:32 +01:00
unset ( SCRIPT_ ${ program } CACHE )
2019-08-20 12:13:26 -07:00
endif ( )
2021-11-10 22:13:22 -08:00
endfunction ( )
function ( vcpkg_find_acquire_program program )
if ( ${ program } )
return ( )
2020-08-18 12:16:39 -07:00
endif ( )
2016-09-18 20:50:08 -07:00
2021-11-10 22:13:22 -08:00
set ( raw_executable "OFF" )
set ( program_name "" )
set ( program_version "" )
set ( search_names "" )
set ( download_urls "" )
set ( download_filename "" )
set ( download_sha512 "" )
set ( rename_binary_to "" )
set ( tool_subdirectory "" )
set ( interpreter "" )
set ( supported_on_unix "" )
set ( post_install_command "" )
set ( paths_to_search "" )
set ( version_command "" )
vcpkg_list ( SET sourceforge_args )
set ( brew_package_name "" )
set ( apt_package_name "" )
if ( program STREQUAL "PERL" )
set ( program_name perl )
set ( program_version 5.32.1.1 )
set ( tool_subdirectory ${ program_version } )
set ( paths_to_search ${ DOWNLOADS } /tools/perl/ ${ tool_subdirectory } /perl/bin )
set ( brew_package_name "perl" )
set ( apt_package_name "perl" )
set ( download_urls
" h t t p s : / / s t r a w b e r r y p e r l . c o m / d o w n l o a d / $ { p r o g r a m _ v e r s i o n } / s t r a w b e r r y - p e r l - $ { p r o g r a m _ v e r s i o n } - 3 2 b i t . z i p "
)
set ( download_filename "strawberry-perl-${program_version}-32bit.zip" )
set ( download_sha512 936381254fea2e596db6a16c23b08ced25c4081fda484e1b8c4356755016e4b956bd00f3d2ee651d5f41a7695e9998f6c1ac3f4a237212b9c55aca8c5fea14e9 )
elseif ( program STREQUAL "NASM" )
set ( program_name nasm )
2023-01-20 13:43:57 +11:00
set ( program_version 2.16.01 )
2021-11-10 22:13:22 -08:00
set ( paths_to_search "${DOWNLOADS}/tools/nasm/nasm-${program_version}" )
set ( brew_package_name "nasm" )
set ( apt_package_name "nasm" )
2023-01-20 13:43:57 +11:00
set ( download_urls "https://www.nasm.us/pub/nasm/releasebuilds/${program_version}/win64/nasm-${program_version}-win64.zip" )
set ( download_filename "nasm-${program_version}-win64.zip" )
set ( download_sha512 ce4d02f530dc3376b4513f219bbcec128ee5bebd8a5c332599b48d8071f803d1538d7258fec7c2e9b4d725b8d7314cea2696289d0493017eb13bfe70e5cb5062 )
2021-11-10 22:13:22 -08:00
elseif ( program STREQUAL "YASM" )
set ( program_name yasm )
set ( program_version 1.3.0.6.g1962 )
set ( tool_subdirectory 1.3.0.6 )
set ( brew_package_name "yasm" )
set ( apt_package_name "yasm" )
set ( download_urls "https://www.tortall.net/projects/yasm/snapshots/v${program_version}/yasm-${program_version}.exe" )
set ( download_filename "yasm-${program_version}.exe" )
set ( rename_binary_to "yasm.exe" )
set ( raw_executable ON )
set ( download_sha512 c1945669d983b632a10c5ff31e86d6ecbff143c3d8b2c433c0d3d18f84356d2b351f71ac05fd44e5403651b00c31db0d14615d7f9a6ecce5750438d37105c55b )
elseif ( program STREQUAL "GIT" )
set ( program_name git )
if ( CMAKE_HOST_WIN32 )
set ( base_version 2.32.0 )
set ( program_version 2.32.0.2 )
set ( tool_subdirectory "git-${program_version}-2-windows" )
set ( download_urls "https://github.com/git-for-windows/git/releases/download/v${base_version}.windows.2/PortableGit-${program_version}-32-bit.7z.exe" )
set ( download_filename "PortableGit-${program_version}-32-bit.7z.exe" )
set ( download_sha512 867d8534972cbaf7a4224e25a14d484f8d17ef186f8d79e9a758afb90cf69541375cb7615a39702311f4809cb8371ef85c2b1a15bfffe9e48f0e597ac011b348 )
set ( paths_to_search
" $ { D O W N L O A D S } / t o o l s / $ { t o o l _ s u b d i r e c t o r y } / m i n g w 3 2 / b i n "
" $ { D O W N L O A D S } / t o o l s / g i t / $ { t o o l _ s u b d i r e c t o r y } / m i n g w 3 2 / b i n " )
2020-08-16 21:07:17 +02:00
else ( )
2021-11-10 22:13:22 -08:00
set ( brew_package_name "git" )
set ( apt_package_name "git" )
2020-08-16 21:07:17 +02:00
endif ( )
2021-11-10 22:13:22 -08:00
elseif ( program STREQUAL "GN" )
set ( program_name gn )
set ( rename_binary_to "gn" )
2022-04-25 15:39:10 -07:00
if ( EXISTS "${CURRENT_HOST_INSTALLED_DIR}/share/gn/version.txt" )
file ( READ "${CURRENT_HOST_INSTALLED_DIR}/share/gn/version.txt" program_version )
set ( paths_to_search "${CURRENT_HOST_INSTALLED_DIR}/tools/gn" )
else ( ) # Old behavior
message ( "Consider adding vcpkg-tool-gn as a host dependency of this port or create an issue at https://github.com/microsoft/vcpkg/issues" )
set ( cipd_download_gn "https://chrome-infra-packages.appspot.com/dl/gn/gn" )
if ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" )
set ( supported_on_unix ON )
2023-01-20 02:39:39 +00:00
EXEC_PROGRAM ( uname ARGS -m OUTPUT_VARIABLE HOST_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE )
2022-04-25 15:39:10 -07:00
if ( HOST_ARCH STREQUAL "aarch64" )
set ( program_version "GkfFAfAUyE-qfeWkdUMaeM1Ov64Fk3SjSj9pwKqZX7gC" )
set ( gn_platform "linux-arm64" )
set ( download_sha512 "E88201309A12C00CE60137261B8E1A759780C81D1925B819583B16D2095A16A7D32EFB2AF36C1E1D6EAA142BF6A6A811847D3140E4E94967EE28F4ADF6373E4B" )
else ( )
set ( program_version "Fv1ENXodhXmEXy_xpZr2gQkVJh57w_IsbsrEJOU0_EoC" )
set ( gn_platform "linux-amd64" )
set ( download_sha512 "A7A5CD5633C5547EC1B1A95958486DDAAC91F1A65881EDC0AD8F74DF44E82F08BA74358E9A72DFCDDE6F534A6B9C9A430D3E16ACE2E4346C4D2E9113F7654B3F" )
endif ( )
elseif ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" )
set ( supported_on_unix ON )
2023-01-20 02:39:39 +00:00
EXEC_PROGRAM ( uname ARGS -m OUTPUT_VARIABLE HOST_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE )
2022-04-25 15:39:10 -07:00
if ( HOST_ARCH STREQUAL "arm64" )
set ( program_version "qMPtGq7xZlpb-lHjP-SK27ftT4X71WIvguuyx6X14DEC" )
set ( gn_platform "mac-arm64" )
set ( download_sha512 "D096FB958D017807427911089AB5A7655AED117F6851C0491AC8063CEDB544423122EF64DF4264ECA86C20A2BDE9E64D7B72DA7ED8C95C2BA79A68B8247D36B8" )
else ( )
set ( program_version "0x2juPLNfP9603GIyZrUfflxK6LiMcppLAoxEpYuIYoC" )
set ( gn_platform "mac-amd64" )
set ( download_sha512 "2696ECE7B2C8008CABDDF10024017E2ECF875F8679424E77052252BDDC83A2096DF3C61D89CD25120EF27E0458C8914BEEED9D418593BDBC4F6ED33A8D4C3DC5" )
endif ( )
else ( )
if ( $ENV{ PROCESSOR_ARCHITECTURE } STREQUAL "ARM64" )
set ( program_version "q5ExVHmXyD34Q_Tzb-aRxsPipO-e37-csVRhVM7IJh0C" )
set ( gn_platform "windows-amd64" )
set ( download_sha512 "FA764AA44EB6F48ED50E855B4DC1DD1ABE35E45FD4AAC7F059A35293A14894C1B591215E34FB0CE9362E646EA9463BA3B489EFB7EBBAA2693D14238B50E4E686" )
else ( ) # AMD64
set ( program_version "q5ExVHmXyD34Q_Tzb-aRxsPipO-e37-csVRhVM7IJh0C" )
set ( gn_platform "windows-amd64" )
set ( download_sha512 "FA764AA44EB6F48ED50E855B4DC1DD1ABE35E45FD4AAC7F059A35293A14894C1B591215E34FB0CE9362E646EA9463BA3B489EFB7EBBAA2693D14238B50E4E686" )
endif ( )
endif ( )
2021-11-10 22:13:22 -08:00
endif ( )
set ( tool_subdirectory "${program_version}" )
set ( download_urls "${cipd_download_gn}/${gn_platform}/+/${program_version}" )
set ( download_filename "gn-${gn_platform}.zip" )
elseif ( program STREQUAL "GO" )
set ( program_name go )
set ( tool_subdirectory 1.16.6.windows-386 )
set ( paths_to_search ${ DOWNLOADS } /tools/go/ ${ tool_subdirectory } /go/bin )
set ( brew_package_name "go" )
set ( apt_package_name "golang-go" )
set ( download_urls "https://dl.google.com/go/go${tool_subdirectory}.zip" )
set ( download_filename "go${tool_subdirectory}.zip" )
set ( download_sha512 2a1e539ed628c0cca5935d24d22cf3a7165f5c80e12a4003ac184deae6a6d0aa31f582f3e8257b0730adfc09aeec3a0e62f4732e658c312d5382170bcd8c94d8 )
elseif ( program STREQUAL "PYTHON3" )
if ( CMAKE_HOST_WIN32 )
set ( program_name python )
2022-11-18 14:53:08 -05:00
set ( program_version 3.10.7 )
2021-11-10 22:13:22 -08:00
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" )
set ( tool_subdirectory "python-${program_version}-x86" )
set ( download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-win32.zip" )
set ( download_filename "python-${program_version}-embed-win32.zip" )
2022-11-18 14:53:08 -05:00
set ( download_sha512 a69445906a909ce5f2554c544fe4251a8ab9c5028b531975b8c78fa8e98295b2bf06e1840f346a3c0edf485a7792c40c9d318bffd36b9c7829ac72b7cf8697bc )
2021-11-10 22:13:22 -08:00
else ( )
set ( tool_subdirectory "python-${program_version}-x64" )
set ( download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}-embed-amd64.zip" )
set ( download_filename "python-${program_version}-embed-amd64.zip" )
2022-11-18 14:53:08 -05:00
set ( download_sha512 29b47f8073b54c092a2c8b39b09ab392f757a8c09149e8d2de043907fffb250b5f6801175e16fedb4fae7b6555822acdc57d81d13c2fea95ef0f6ed717f86cb9 )
2021-11-10 22:13:22 -08:00
endif ( )
set ( paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}" )
vcpkg_list ( SET post_install_command "${CMAKE_COMMAND}" -E rm python310._pth )
else ( )
set ( program_name python3 )
set ( brew_package_name "python" )
set ( apt_package_name "python3" )
endif ( )
elseif ( program STREQUAL "PYTHON2" )
if ( CMAKE_HOST_WIN32 )
set ( program_name python )
set ( program_version 2.7.18 )
2022-03-14 18:25:04 +01:00
if ( EXISTS "${CURRENT_HOST_INSTALLED_DIR}/share/vcpkg-tool-python2/details.cmake" )
include ( "${CURRENT_HOST_INSTALLED_DIR}/share/vcpkg-tool-python2/details.cmake" )
else ( ) # Old behavior
if ( VCPKG_TARGET_ARCHITECTURE STREQUAL x86 )
set ( tool_subdirectory "python-${program_version}-x86" )
set ( download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}.msi" )
set ( download_filename "python-${program_version}.msi" )
set ( download_sha512 2c112733c777ddbf189b0a54047a9d5851ebce0564cc38b9687d79ce6c7a09006109dbad8627fb1a60c3ad55e261db850d9dfa454af0533b460b2afc316fe115 )
else ( )
set ( tool_subdirectory "python-${program_version}-x64" )
set ( download_urls "https://www.python.org/ftp/python/${program_version}/python-${program_version}.amd64.msi" )
set ( download_filename "python-${program_version}.amd64.msi" )
set ( download_sha512 6a81a413b80fd39893e7444fd47efa455d240cbb77a456c9d12f7cf64962b38c08cfa244cd9c50a65947c40f936c6c8c5782f7236d7b92445ab3dd01e82af23e )
endif ( )
set ( paths_to_search "${DOWNLOADS}/tools/python/${tool_subdirectory}" )
2021-11-10 22:13:22 -08:00
endif ( )
elseif ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" )
# macOS includes Python 2.7 built-in as `python`
set ( program_name python )
set ( brew_package_name "python2" )
else ( )
set ( program_name python2 )
set ( apt_package_name "python" )
endif ( )
elseif ( program STREQUAL "RUBY" )
set ( program_name "ruby" )
set ( program_version 2.7.4-1 )
set ( paths_to_search "${DOWNLOADS}/tools/ruby/rubyinstaller-${program_version}-x86/bin" )
set ( download_urls "https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-${program_version}/rubyinstaller-${program_version}-x86.7z" )
set ( download_filename "rubyinstaller-${program_version}-x86.7z" )
set ( download_sha512 4bf459c987b407bdda328c52d95060bf6ad48fc3e5ed5f64d4b205c5b4153c7a00cb6f9da6c0bcd5f2e001e9dc3dda0b72269ec4afdeffd658b93c085cd1d859 )
elseif ( program STREQUAL "JOM" )
set ( program_name jom )
set ( tool_subdirectory "jom-1.1.3" )
set ( paths_to_search "${DOWNLOADS}/tools/jom/${tool_subdirectory}" )
set ( download_urls
" h t t p s : / / d o w n l o a d . q t . i o / o f f i c i a l _ r e l e a s e s / j o m / j o m _ 1 _ 1 _ 3 . z i p "
" h t t p s : / / m i r r o r s . o c f . b e r k e l e y . e d u / q t / o f f i c i a l _ r e l e a s e s / j o m / j o m _ 1 _ 1 _ 3 . z i p "
)
set ( download_filename "jom_1_1_3.zip" )
set ( download_sha512 5b158ead86be4eb3a6780928d9163f8562372f30bde051d8c281d81027b766119a6e9241166b91de0aa6146836cea77e5121290e62e31b7a959407840fc57b33 )
elseif ( program STREQUAL "7Z" )
set ( program_name 7z )
set ( paths_to_search "${DOWNLOADS}/tools/7z/Files/7-Zip" )
set ( download_urls "https://7-zip.org/a/7z1900.msi" )
set ( download_filename "7z1900.msi" )
set ( download_sha512 f73b04e2d9f29d4393fde572dcf3c3f0f6fa27e747e5df292294ab7536ae24c239bf917689d71eb10cc49f6b9a4ace26d7c122ee887d93cc935f268c404e9067 )
elseif ( program STREQUAL "NINJA" )
set ( program_name ninja )
set ( program_version 1.10.2 )
set ( supported_on_unix ON )
2022-10-01 03:22:06 +03:00
set ( version_command --version )
2021-11-10 22:13:22 -08:00
if ( CMAKE_HOST_WIN32 )
set ( download_filename "ninja-win-${program_version}.zip" )
set ( tool_subdirectory "${program_version}-windows" )
set ( download_urls "https://github.com/ninja-build/ninja/releases/download/v${program_version}/ninja-win.zip" )
set ( download_sha512 6004140d92e86afbb17b49c49037ccd0786ce238f340f7d0e62b4b0c29ed0d6ad0bab11feda2094ae849c387d70d63504393714ed0a1f4d3a1f155af7a4f1ba3 )
elseif ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" )
set ( download_filename "ninja-mac-${program_version}.zip" )
set ( download_urls "https://github.com/ninja-build/ninja/releases/download/v${program_version}/ninja-mac.zip" )
set ( tool_subdirectory "${program_version}-osx" )
set ( paths_to_search "${DOWNLOADS}/tools/ninja-${program_version}-osx" )
set ( download_sha512 bcd12f6a3337591306d1b99a7a25a6933779ba68db79f17c1d3087d7b6308d245daac08df99087ff6be8dc7dd0dcdbb3a50839a144745fa719502b3a7a07260b )
elseif ( CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD" )
set ( paths_to_search "${DOWNLOADS}/tools/${tool_subdirectory}-freebsd" )
set ( supported_on_unix OFF )
else ( )
2023-01-20 02:39:39 +00:00
execute_process ( COMMAND "uname" "-m" OUTPUT_VARIABLE HOST_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE )
2022-10-01 03:22:06 +03:00
if ( HOST_ARCH MATCHES "x86_64|amd64|AMD64" )
set ( download_filename "ninja-linux-${program_version}.zip" )
set ( download_urls "https://github.com/ninja-build/ninja/releases/download/v${program_version}/ninja-linux.zip" )
set ( tool_subdirectory "${program_version}-linux" )
set ( paths_to_search "${DOWNLOADS}/tools/ninja-${program_version}-linux" )
set ( download_sha512 93e802e9c17fb59636cddde4bad1ddaadad624f4ecfee00d5c78790330a4e9d433180e795718cda27da57215ce643c3929cf72c85337ee019d868c56f2deeef3 )
else ( )
set ( version_command "" ) # somewhat hacky way to skip version check and use system binary
endif ( )
2021-11-10 22:13:22 -08:00
endif ( )
elseif ( program STREQUAL "NUGET" )
set ( program_name nuget )
set ( tool_subdirectory "5.11.0" )
set ( paths_to_search "${DOWNLOADS}/tools/nuget-${tool_subdirectory}-windows" )
set ( brew_package_name "nuget" )
set ( download_urls "https://dist.nuget.org/win-x86-commandline/v5.11.0/nuget.exe" )
set ( rename_binary_to "nuget.exe" )
set ( download_filename "nuget.5.11.0.exe" )
set ( raw_executable ON )
set ( download_sha512 06a337c9404dec392709834ef2cdbdce611e104b510ef40201849595d46d242151749aef65bc2d7ce5ade9ebfda83b64c03ce14c8f35ca9957a17a8c02b8c4b7 )
2021-12-10 13:58:11 -08:00
elseif ( program STREQUAL "MESON" ) # Should always be found!
2021-11-10 22:13:22 -08:00
set ( program_name meson )
set ( search_names meson meson.py )
set ( interpreter PYTHON3 )
set ( apt_package_name "meson" )
set ( brew_package_name "meson" )
set ( version_command --version )
2021-11-12 20:52:32 +01:00
set ( extra_search_args EXACT_VERSION_MATCH )
2021-12-03 00:48:34 +01:00
if ( EXISTS "${CURRENT_HOST_INSTALLED_DIR}/share/meson/version.txt" )
file ( READ "${CURRENT_HOST_INSTALLED_DIR}/share/meson/version.txt" program_version )
set ( paths_to_search "${CURRENT_HOST_INSTALLED_DIR}/tools/meson" )
2021-12-10 13:58:11 -08:00
else ( ) # Old behavior
2021-12-03 00:48:34 +01:00
set ( program_version 0.58.1 )
set ( ref aeda7f249c4a5dbbecc52e44f382246a2377b5b0 )
set ( paths_to_search "${DOWNLOADS}/tools/meson/meson-${ref}" )
set ( download_urls "https://github.com/mesonbuild/meson/archive/${ref}.tar.gz" )
set ( download_filename "meson-${ref}.tar.gz" )
set ( download_sha512 18a012a45274dbb4582e99fd69d920f38831e788d9860f9553c64847bedb1c2010ae0b5c0ef4a4350c03f5e0f95aaa0395378e1208109b59640c1a70b1e202d2 )
set ( supported_on_unix ON )
endif ( )
2021-11-10 22:13:22 -08:00
elseif ( program STREQUAL "FLEX" OR program STREQUAL "BISON" )
if ( CMAKE_HOST_WIN32 )
2022-02-16 12:32:16 +08:00
set ( program_version 2.5.25 )
set ( download_urls "https://github.com/lexxmark/winflexbison/releases/download/v${program_version}/win_flex_bison-${program_version}.zip" )
set ( download_filename "win_flex_bison-${program_version}.zip" )
set ( download_sha512 2a829eb05003178c89f891dd0a67add360c112e74821ff28e38feb61dac5b66e9d3d5636ff9eef055616aaf282ee8d6be9f14c6ae4577f60bdcec96cec9f364e )
set ( tool_subdirectory "${program_version}" )
2021-11-10 22:13:22 -08:00
if ( program STREQUAL "FLEX" )
set ( program_name win_flex )
else ( )
set ( program_name win_bison )
endif ( )
2022-02-16 12:32:16 +08:00
set ( paths_to_search ${ DOWNLOADS } /tools/win_flex/ ${ program_version } )
2021-11-10 22:13:22 -08:00
if ( NOT EXISTS "${paths_to_search}/data/m4sugar/m4sugar.m4" )
file ( REMOVE_RECURSE "${paths_to_search}" )
endif ( )
elseif ( program STREQUAL "FLEX" )
set ( program_name flex )
set ( apt_package_name flex )
set ( brew_package_name flex )
else ( )
set ( program_name bison )
set ( apt_package_name bison )
set ( brew_package_name bison )
if ( APPLE )
set ( paths_to_search /usr/local/opt/bison/bin )
endif ( )
endif ( )
elseif ( program STREQUAL "CLANG" )
set ( program_name clang )
2023-01-12 15:24:44 +08:00
set ( tool_subdirectory "clang-15.0.6" )
set ( program_version 15.0.6 )
2021-11-10 22:13:22 -08:00
if ( CMAKE_HOST_WIN32 )
set ( paths_to_search
# Support LLVM in Visual Studio 2019
" $ E N V { L L V M I n s t a l l D i r } / x 6 4 / b i n "
" $ E N V { L L V M I n s t a l l D i r } / b i n "
" $ E N V { V C I N S T A L L D I R } / T o o l s / L l v m / x 6 4 / b i n "
" $ E N V { V C I N S T A L L D I R } / T o o l s / L l v m / b i n "
" $ { D O W N L O A D S } / t o o l s / $ { t o o l _ s u b d i r e c t o r y } - w i n d o w s / b i n "
" $ { D O W N L O A D S } / t o o l s / c l a n g / $ { t o o l _ s u b d i r e c t o r y } / b i n " )
if ( DEFINED ENV{PROCESSOR_ARCHITEW6432} )
set ( host_arch "$ENV{PROCESSOR_ARCHITEW6432}" )
else ( )
set ( host_arch "$ENV{PROCESSOR_ARCHITECTURE}" )
endif ( )
2021-01-13 04:49:40 +01:00
2021-11-10 22:13:22 -08:00
if ( host_arch MATCHES "64" )
set ( download_urls "https://github.com/llvm/llvm-project/releases/download/llvmorg-${program_version}/LLVM-${program_version}-win64.exe" )
set ( download_filename "LLVM-${program_version}-win64.7z.exe" )
2023-01-12 15:24:44 +08:00
set ( download_sha512 2dd6f3eea106f2b905e6658ea5ea12856d17285adbfba055edc2d6b6389c4c2f7aa001df5cb0d8fb84fa7fa47d5035a7fddf276523b472dd55f150ae25938768 )
2021-11-10 22:13:22 -08:00
else ( )
set ( download_urls "https://github.com/llvm/llvm-project/releases/download/llvmorg-${program_version}/LLVM-${program_version}-win32.exe" )
set ( download_filename "LLVM-${program_version}-win32.7z.exe" )
2023-01-12 15:24:44 +08:00
set ( download_sha512 90225D650EADB0E590A9912B479B46A575D41A19EB5F2DA03C4DC8B032DC0790222F0E3706DFE2A35C0E7747941972AC26CB47D3EB13730DB76168931F37E5F1 )
2021-11-10 22:13:22 -08:00
endif ( )
2020-08-16 21:07:17 +02:00
endif ( )
2021-11-10 22:13:22 -08:00
set ( brew_package_name "llvm" )
set ( apt_package_name "clang" )
elseif ( program STREQUAL "GPERF" )
set ( program_name gperf )
set ( program_version 3.0.1 )
set ( paths_to_search "${DOWNLOADS}/tools/gperf/bin" )
set ( download_urls "https://sourceforge.net/projects/gnuwin32/files/gperf/${program_version}/gperf-${program_version}-bin.zip/download" )
set ( download_filename "gperf-${program_version}-bin.zip" )
set ( download_sha512 3f2d3418304390ecd729b85f65240a9e4d204b218345f82ea466ca3d7467789f43d0d2129fcffc18eaad3513f49963e79775b10cc223979540fa2e502fe7d4d9 )
elseif ( program STREQUAL "GASPREPROCESSOR" )
set ( raw_executable true )
set ( program_name gas-preprocessor )
set ( interpreter PERL )
set ( search_names "gas-preprocessor.pl" )
set ( paths_to_search "${DOWNLOADS}/tools/gas-preprocessor/${tool_subdirectory}" )
set ( rename_binary_to "gas-preprocessor.pl" )
2023-01-12 15:24:44 +08:00
set ( commit_id 9309c67acb535ca6248f092e96131d8eb07eefc1 )
set ( download_urls "https://raw.githubusercontent.com/FFmpeg/gas-preprocessor/${commit_id}/gas-preprocessor.pl" )
string ( SUBSTRING ${ commit_id } 0 8 tool_subdirectory )
2021-11-10 22:13:22 -08:00
set ( download_filename "gas-preprocessor-${tool_subdirectory}.pl" )
2023-01-12 15:24:44 +08:00
set ( download_sha512 b4749cf8aa758e3f28d4b21803422a5c2588f5fc48cfd317564606b374f8d739c636067cf7a4956d7365d63b055bc6e7626c304857e6c9013d6b4a0db9d8ad4f )
2021-11-10 22:13:22 -08:00
elseif ( program STREQUAL "DARK" )
set ( program_name dark )
set ( tool_subdirectory "wix311-binaries" )
set ( paths_to_search "${DOWNLOADS}/tools/dark/${tool_subdirectory}" )
set ( download_urls "https://github.com/wixtoolset/wix3/releases/download/wix311rtm/wix311-binaries.zip" )
set ( download_filename "wix311-binaries.zip" )
set ( download_sha512 74f0fa29b5991ca655e34a9d1000d47d4272e071113fada86727ee943d913177ae96dc3d435eaf494d2158f37560cd4c2c5274176946ebdb17bf2354ced1c516 )
elseif ( program STREQUAL "SCONS" )
set ( program_name scons )
set ( program_version 4.1.0 )
set ( tool_subdirectory "${program_version}" )
set ( interpreter PYTHON2 )
set ( search_names "scons.py" )
set ( download_urls "https://sourceforge.net/projects/scons/files/scons-local-${program_version}.zip/download" )
set ( download_filename "scons-local-${program_version}.zip" )
set ( download_sha512 b173176ce8aca25039c64fcc68ec1b9ad31e03a926fd545e7631b3f9b374d914adffc593f505e3e7e2867b0ffe85e8deb0b39afe314edf05d02974ce5db1badb )
elseif ( program STREQUAL "SWIG" )
set ( program_version 4.0.2 )
set ( program_name swig )
if ( CMAKE_HOST_WIN32 )
vcpkg_list ( SET sourceforge_args
R E P O s w i g / s w i g w i n
R E F " s w i g w i n - $ { p r o g r a m _ v e r s i o n } "
F I L E N A M E " s w i g w i n - $ { p r o g r a m _ v e r s i o n } . z i p "
S H A 5 1 2 b 8 f 1 0 5 f 9 b 9 d b 6 a c c 1 f 6 e 3 7 4 1 9 9 0 9 1 5 b 5 3 3 c d 1 b c 2 0 6 e b 9 6 4 5 f d 6 8 3 6 4 5 7 f d 3 0 7 8 9 b 7 2 2 9 d 2 e 3 2 1 9 d 8 e 3 5 f 2 3 9 0 6 0 5 a d e 0 f b c a 4 9 3 a e 1 6 2 e c 3 b 4 b c 4 e 4 2 8 b 5 7 1 5 5 d b 0 3 d
N O _ R E M O V E _ O N E _ L E V E L
W O R K I N G _ D I R E C T O R Y " $ { D O W N L O A D S } / t o o l s / s w i g "
)
set ( tool_subdirectory "b8f105f9b9-f0518bc3b7/swigwin-${program_version}" )
else ( )
set ( apt_package_name "swig" )
set ( brew_package_name "swig" )
endif ( )
elseif ( program STREQUAL "DOXYGEN" )
set ( program_name doxygen )
set ( program_version 1.9.1 )
vcpkg_list ( SET sourceforge_args
R E P O d o x y g e n
R E F " r e l - $ { p r o g r a m _ v e r s i o n } "
F I L E N A M E " d o x y g e n - $ { p r o g r a m _ v e r s i o n } . w i n d o w s . b i n . z i p "
S H A 5 1 2 c 3 e e b 6 b 9 f a 4 e a b 7 0 f b 6 b 0 8 6 4 f b b f 9 4 f b 8 0 5 0 f 3 f e e 3 8 d 1 1 7 c f 4 7 0 9 2 1 a 8 0 e 3 5 6 9 c c 1 c 8 b 0 2 7 2 6 0 4 d 6 7 3 1 e 0 5 f 0 1 7 9 0 c f a a 7 0 e 1 5 9 b e c 5 d 0 8 8 2 f c 4 f 2 d 8 a e 4 a 5 d 5 2 a 2 1 b
N O _ R E M O V E _ O N E _ L E V E L
W O R K I N G _ D I R E C T O R Y " $ { D O W N L O A D S } / t o o l s / d o x y g e n "
)
set ( tool_subdirectory c3eeb6b9fa-76d69c6db5 )
elseif ( program STREQUAL "BAZEL" )
set ( program_name bazel )
2021-12-15 19:09:54 +01:00
set ( program_version 4.2.2 )
2021-11-10 22:13:22 -08:00
set ( rename_binary_to "bazel" )
if ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" )
set ( supported_on_unix ON )
set ( tool_subdirectory "${program_version}-linux" )
set ( download_urls "https://github.com/bazelbuild/bazel/releases/download/${program_version}/bazel-${tool_subdirectory}-x86_64" )
set ( download_filename "bazel-${tool_subdirectory}-x86_64" )
set ( raw_executable ON )
2021-12-15 19:09:54 +01:00
set ( download_sha512 f38619e054df78cab38278a5901b2798f2e25b5cec53358d98278002e713d225fd3df96a209b7f22a2357835a279cee8ef1768e10561b3e9fe6361f324563bb9 )
2021-11-10 22:13:22 -08:00
elseif ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" )
set ( supported_on_unix ON )
set ( tool_subdirectory "${program_version}-darwin" )
set ( download_urls "https://github.com/bazelbuild/bazel/releases/download/${program_version}/bazel-${tool_subdirectory}-x86_64" )
set ( download_filename "bazel-${tool_subdirectory}-x86_64" )
set ( raw_executable ON )
2021-12-15 19:09:54 +01:00
set ( download_sha512 a3fd8f9d71b0669d742439200f27ee0a3891c1f248df62c841ebb2b416a47534562f429f8a08793b074e9b74f2ede3d97a7e13ac9921c7ee2dc6a2dca8b7f275 )
2021-11-10 22:13:22 -08:00
else ( )
set ( tool_subdirectory "${program_version}-windows" )
set ( download_urls "https://github.com/bazelbuild/bazel/releases/download/${program_version}/bazel-${tool_subdirectory}-x86_64.zip" )
set ( download_filename "bazel-${tool_subdirectory}-x86_64.zip" )
2021-12-15 19:09:54 +01:00
set ( download_sha512 8a8196e242964114316232818cb81bfa19ebfd3a029ebf550a241e33b22a6e9ed636dade06411a8706c05c4e73def0bc8d7f45ff0ec5478bcc5de21b5638204d )
2021-11-10 22:13:22 -08:00
endif ( )
elseif ( program STREQUAL "ARIA2" )
set ( program_name aria2c )
set ( program_version 1.35.0 )
set ( paths_to_search "${DOWNLOADS}/tools/aria2c/aria2-${program_version}-win-32bit-build1" )
set ( download_urls "https://github.com/aria2/aria2/releases/download/release-${program_version}/aria2-${program_version}-win-32bit-build1.zip" )
set ( download_filename "aria2-${program_version}-win-32bit-build1.zip" )
set ( download_sha512 933537cad820b1cecf43a9eeca7e1b241dd7b1c902ee942441a166f2c38845f16046321efbdfa2f83c7e9fc50c7ecc5da6fd00e0c6e2124c07d3b783aa5092a4 )
elseif ( program STREQUAL "PKGCONFIG" )
set ( program_name pkg-config )
if ( DEFINED ENV{PKG_CONFIG} )
debug_message ( STATUS "PKG_CONFIG found in ENV! Using $ENV{PKG_CONFIG}" )
set ( PKGCONFIG "$ENV{PKG_CONFIG}" CACHE INTERNAL "" )
set ( PKGCONFIG "${PKGCONFIG}" PARENT_SCOPE )
return ( )
elseif ( CMAKE_HOST_SYSTEM_NAME STREQUAL "OpenBSD" )
# As of 6.8, the OpenBSD specific pkg-config doesn't support {pcfiledir}
set ( supported_on_unix ON )
set ( rename_binary_to "pkg-config" )
set ( program_version 0.29.2.1 )
set ( raw_executable ON )
set ( download_filename "pkg-config.openbsd" )
set ( tool_subdirectory "openbsd" )
set ( download_urls "https://raw.githubusercontent.com/jgilje/pkg-config-openbsd/master/pkg-config" )
set ( download_sha512 b7ec9017b445e00ae1377e36e774cf3f5194ab262595840b449832707d11e443a102675f66d8b7e8b2e2f28cebd6e256835507b1e0c69644cc9febab8285080b )
set ( version_command --version )
elseif ( CMAKE_HOST_WIN32 )
if ( NOT EXISTS "${PKGCONFIG}" )
2022-01-27 15:02:21 +08:00
set ( VERSION 0.29.2-3 )
set ( program_version git-9.0.0.6373.5be8fcd83-1 )
2021-11-10 22:13:22 -08:00
vcpkg_acquire_msys (
P K G C O N F I G _ R O O T
N O _ D E F A U L T _ P A C K A G E S
D I R E C T _ P A C K A G E S
" h t t p s : / / r e p o . m s y s 2 . o r g / m i n g w / i 6 8 6 / m i n g w - w 6 4 - i 6 8 6 - p k g - c o n f i g - $ { V E R S I O N } - a n y . p k g . t a r . z s t "
2022-01-27 15:02:21 +08:00
0 c 0 8 6 b f 3 0 6 b 6 a 1 8 9 8 8 c c 9 8 2 b 3 c 3 8 2 8 c 4 d 9 2 2 a 1 b 6 0 f d 2 4 e 1 7 c 3 b e a d 4 e 2 9 6 e e 6 d e 4 8 c e 1 4 8 b c 6 f 9 2 1 4 a f 9 8 b e 6 a 8 6 c b 3 9 c 3 7 0 0 3 d 2 d c b 6 5 6 1 8 0 0 f d f 7 d 0 d 1 0 2 8 c f 7 3 a 4
2021-11-10 22:13:22 -08:00
" h t t p s : / / r e p o . m s y s 2 . o r g / m i n g w / i 6 8 6 / m i n g w - w 6 4 - i 6 8 6 - l i b w i n p t h r e a d - $ { p r o g r a m _ v e r s i o n } - a n y . p k g . t a r . z s t "
2022-01-27 15:02:21 +08:00
c 8 9 c 2 7 b 5 a f e 4 c f 5 f d a a a 3 5 4 5 4 4 f 0 7 0 c 4 5 a c e 5 e 9 d 2 f 2 e b b 4 b 9 5 6 a 1 4 8 f 6 1 6 8 1 f 0 5 0 e 6 7 9 7 6 8 9 4 e 6 f 5 2 e 4 2 e 7 0 8 d a d b f 7 3 0 f e e 1 7 6 a c 9 a d d 3 c 9 8 6 4 c 2 1 2 4 9 0 3 4 c 3 4 2 8 1 0
2021-11-10 22:13:22 -08:00
)
2020-08-17 16:25:05 +02:00
endif ( )
2021-11-10 22:13:22 -08:00
set ( "${program}" "${PKGCONFIG_ROOT}/mingw32/bin/pkg-config.exe" CACHE INTERNAL "" )
set ( "${program}" "${${program}}" PARENT_SCOPE )
return ( )
else ( )
set ( brew_package_name pkg-config )
set ( apt_package_name pkg-config )
set ( paths_to_search "/bin" "/usr/bin" "/usr/local/bin" )
2020-08-17 16:25:05 +02:00
endif ( )
2022-07-18 22:44:34 +03:00
elseif ( program STREQUAL "PATCHELF" )
set ( program_name patchelf )
set ( program_version 0.14.5 )
set ( supported_on_unix ON )
if ( CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" )
2023-01-20 02:39:39 +00:00
execute_process ( COMMAND "uname" "-m" OUTPUT_VARIABLE HOST_ARCH OUTPUT_STRIP_TRAILING_WHITESPACE )
2022-07-18 22:44:34 +03:00
if ( HOST_ARCH STREQUAL "aarch64" )
set ( patchelf_platform "aarch64" )
set ( download_sha512 "3B5EB4405FAB1D5202728AA390DD9F059CD7AFD582BAD9C50383CAD605127BC77DFCE3F2F26E9714F6BD5CCFFD49D3973BA2F061D2E2931B6E1BD0C263B99E75" )
2022-10-01 03:22:06 +03:00
elseif ( HOST_ARCH STREQUAL "armv7l" )
set ( patchelf_platform "armv7l" )
set ( download_sha512 "30160d750784f5e8805bffe96ca80b40ed10441549e10f47b61e0d21b32979e01865cd770f1de9162988d4daabc6984dcdb7438f67bcd5eee76ad5f01b00276d" )
2022-07-18 22:44:34 +03:00
else ( )
set ( patchelf_platform "x86_64" )
set ( download_sha512 "5E983A25B3F3F3B8582D1DE6C7DE30812E8D6E58E96F711F33A2634D3FB1F2370531DA179927AA401328319F92465E6F76274A6F994D1DC54C74B98E704D0D29" )
endif ( )
set ( download_filename "${program_name}-${program_version}-${patchelf_platform}.tar.gz" )
set ( download_urls "https://github.com/NixOS/patchelf/releases/download/${program_version}/${download_filename}" )
set ( tool_subdirectory "${program_version}-${patchelf_platform}-linux" )
set ( paths_to_search "${DOWNLOADS}/tools/patchelf/${program_version}-${patchelf_platform}-linux/bin" )
endif ( )
set ( version_command --version )
2021-11-10 22:13:22 -08:00
else ( )
2022-08-19 01:38:09 +08:00
message ( FATAL_ERROR "unknown tool ${program} -- unable to acquire." )
2017-02-09 18:13:52 +01:00
endif ( )
2021-11-10 22:13:22 -08:00
if ( "${program_name}" STREQUAL "" )
message ( FATAL_ERROR "Internal error: failed to initialize program_name for program ${program}" )
endif ( )
2020-08-25 18:41:56 -07:00
2021-11-10 22:13:22 -08:00
set ( full_subdirectory "${DOWNLOADS}/tools/${program_name}/${tool_subdirectory}" )
if ( NOT "${tool_subdirectory}" STREQUAL "" )
list ( APPEND paths_to_search ${ full_subdirectory } )
endif ( )
if ( "${full_subdirectory}" MATCHES [[^(.* ) [ / \ \ ] + $ ] ] )
# remove trailing slashes, which may turn into a trailing `\` which CMake _does not like_
set ( full_subdirectory "${CMAKE_MATCH_1}" )
2018-03-06 10:07:39 -08:00
endif ( )
2021-11-10 22:13:22 -08:00
if ( "${search_names}" STREQUAL "" )
set ( search_names "${program_name}" )
endif ( )
2020-07-13 13:43:39 -07:00
2021-11-10 22:13:22 -08:00
z_vcpkg_find_acquire_program_find_internal ( "${program}"
I N T E R P R E T E R " $ { i n t e r p r e t e r } "
P A T H S $ { p a t h s _ t o _ s e a r c h }
N A M E S $ { s e a r c h _ n a m e s }
)
if ( NOT ${ program } )
z_vcpkg_find_acquire_program_find_external ( "${program}"
2021-11-12 20:52:32 +01:00
$ { e x t r a _ s e a r c h _ a r g s }
2021-11-10 22:13:22 -08:00
P R O G R A M _ N A M E " $ { p r o g r a m _ n a m e } "
M I N _ V E R S I O N " $ { p r o g r a m _ v e r s i o n } "
I N T E R P R E T E R " $ { i n t e r p r e t e r } "
N A M E S $ { s e a r c h _ n a m e s }
V E R S I O N _ C O M M A N D $ { v e r s i o n _ c o m m a n d }
)
endif ( )
if ( NOT ${ program } )
if ( NOT VCPKG_HOST_IS_WINDOWS AND NOT supported_on_unix )
set ( example "." )
if ( NOT "${brew_package_name}" STREQUAL "" AND VCPKG_HOST_IS_OSX )
set ( example ":\n brew install ${brew_package_name}" )
elseif ( NOT "${apt_package_name}" STREQUAL "" AND VCPKG_HOST_IS_LINUX )
set ( example ":\n sudo apt-get install ${apt_package_name}" )
endif ( )
message ( FATAL_ERROR "Could not find ${program_name}. Please install it via your package manager${example}" )
2020-07-13 13:43:39 -07:00
endif ( )
2021-11-10 22:13:22 -08:00
if ( NOT "${sourceforge_args}" STREQUAL "" )
# Locally change editable to suppress re-extraction each time
set ( _VCPKG_EDITABLE 1 )
vcpkg_from_sourceforge ( OUT_SOURCE_PATH SFPATH ${ sourceforge_args } )
unset ( _VCPKG_EDITABLE )
2020-07-13 13:43:39 -07:00
else ( )
2021-11-10 22:13:22 -08:00
vcpkg_download_distfile ( archive_path
U R L S $ { d o w n l o a d _ u r l s }
S H A 5 1 2 " $ { d o w n l o a d _ s h a 5 1 2 } "
F I L E N A M E " $ { d o w n l o a d _ f i l e n a m e } "
)
file ( MAKE_DIRECTORY "${full_subdirectory}" )
if ( raw_executable )
if ( NOT "${rename_binary_to}" STREQUAL "" )
file ( INSTALL "${archive_path}"
D E S T I N A T I O N " $ { f u l l _ s u b d i r e c t o r y } "
R E N A M E " $ { r e n a m e _ b i n a r y _ t o } "
F I L E _ P E R M I S S I O N S
O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E
G R O U P _ R E A D G R O U P _ E X E C U T E
W O R L D _ R E A D W O R L D _ E X E C U T E
)
else ( )
file ( COPY "${archive_path}"
D E S T I N A T I O N " $ { f u l l _ s u b d i r e c t o r y } "
F I L E _ P E R M I S S I O N S
O W N E R _ R E A D O W N E R _ W R I T E O W N E R _ E X E C U T E
G R O U P _ R E A D G R O U P _ E X E C U T E
W O R L D _ R E A D W O R L D _ E X E C U T E
)
endif ( )
else ( )
cmake_path ( GET download_filename EXTENSION archive_extension )
string ( TOLOWER "${archive_extension}" archive_extension )
if ( "${archive_extension}" MATCHES [[\.msi $ ]] )
cmake_path ( NATIVE_PATH archive_path archive_native_path )
cmake_path ( NATIVE_PATH full_subdirectory destination_native_path )
vcpkg_execute_in_download_mode (
C O M M A N D m s i e x e c
/ a " $ { a r c h i v e _ n a t i v e _ p a t h } "
/ q n " T A R G E T D I R = $ { d e s t i n a t i o n _ n a t i v e _ p a t h } "
W O R K I N G _ D I R E C T O R Y " $ { D O W N L O A D S } "
)
elseif ( "${archive_extension}" MATCHES [[\.7z\.exe $ ]] )
vcpkg_find_acquire_program ( 7Z )
vcpkg_execute_in_download_mode (
C O M M A N D $ { 7 Z } x
" $ { a r c h i v e _ p a t h } "
" - o $ { f u l l _ s u b d i r e c t o r y } "
- y - b s o 0 - b s p 0
W O R K I N G _ D I R E C T O R Y " $ { f u l l _ s u b d i r e c t o r y } "
)
else ( )
vcpkg_execute_in_download_mode (
C O M M A N D " $ { C M A K E _ C O M M A N D } " - E t a r x z f " $ { a r c h i v e _ p a t h } "
W O R K I N G _ D I R E C T O R Y " $ { f u l l _ s u b d i r e c t o r y } "
)
endif ( )
endif ( )
2020-07-13 13:43:39 -07:00
endif ( )
2016-09-18 20:50:08 -07:00
2021-11-10 22:13:22 -08:00
if ( NOT "${post_install_command}" STREQUAL "" )
vcpkg_execute_required_process (
A L L O W _ I N _ D O W N L O A D _ M O D E
C O M M A N D $ { p o s t _ i n s t a l l _ c o m m a n d }
W O R K I N G _ D I R E C T O R Y " $ { f u l l _ s u b d i r e c t o r y } "
L O G N A M E " $ { p r o g r a m } - t o o l - p o s t - i n s t a l l "
)
endif ( )
2021-11-12 20:52:32 +01:00
unset ( "${program}" )
2021-11-10 22:13:22 -08:00
unset ( "${program}" CACHE )
z_vcpkg_find_acquire_program_find_internal ( "${program}"
I N T E R P R E T E R " $ { i n t e r p r e t e r } "
P A T H S $ { p a t h s _ t o _ s e a r c h }
N A M E S $ { s e a r c h _ n a m e s }
)
if ( NOT ${ program } )
message ( FATAL_ERROR "Unable to find ${program}" )
endif ( )
2020-08-16 21:07:17 +02:00
endif ( )
2016-09-18 20:50:08 -07:00
2021-11-10 22:13:22 -08:00
set ( "${program}" "${${program}}" PARENT_SCOPE )
2016-09-18 20:50:08 -07:00
endfunction ( )