[rollup:2021-08-09] Rollup PR (#19469)

* [rollup:2021-08-09] PR #16706 (@JackBoosY)

[vcpkg_fixup_cmake_targets] Fix up OSX system development path

* [rollup:2021-08-09] PR #19238 (@strega-nil)

[scripts-audit] vcpkg_download_distfile

* [rollup:2021-08-09] PR #19239 (@strega-nil)

[scripts-audit] vcpkg_find_fortran

* [rollup:2021-08-09] PR #19338 (@strega-nil)

[tinyfiledialogs] Fix for good

* [rollup:2021-08-09] PR #19348 (@strega-nil)

[scripts-audit] vcpkg_fixup_pkgconfig

* fix ports.cmake with newer vcpkg_download_distfile

* fix vcpkg create

* move vcpkg_common_definitions down so that it's not incorrect

* fix vcpkg_internal_get_cmake_vars

Co-authored-by: nicole mazzuca <mazzucan@outlook.com>
Co-authored-by: Jack·Boos·Yu <47264268+JackBoosY@users.noreply.github.com>
Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
nicole mazzuca 2021-08-16 13:42:31 -07:00 committed by GitHub
parent 6bc4362fb4
commit 99e06a64ec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 599 additions and 428 deletions

View File

@ -8,7 +8,17 @@ Windows(x86/x64) Only: If not it will switch/enable MinGW gfortran
## Usage ## Usage
```cmake ```cmake
vcpkg_find_fortran(<additional_cmake_args_out>) vcpkg_find_fortran(<out_var>)
```
## Example
```cmake
vcpkg_find_fortran(fortran_args)
# ...
vcpkg_configure_cmake(...
OPTIONS
${fortran_args}
)
``` ```
## Source ## Source

View File

@ -27,6 +27,11 @@ The url of the git repository.
### REF ### REF
The git sha of the commit to download. The git sha of the commit to download.
### FETCH_REF
The git branch to fetch in non-HEAD mode. After this is fetched,
then `REF` is checked out. This is useful in cases where the git server
does not allow checking out non-advertised objects.
### HEAD_REF ### HEAD_REF
The git branch to use when the package is requested to be built from the latest sources. The git branch to use when the package is requested to be built from the latest sources.

View File

@ -2,11 +2,12 @@ vcpkg_fail_port_install(ON_TARGET "uwp")
vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
vcpkg_from_sourceforge( vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH OUT_SOURCE_PATH SOURCE_PATH
REPO tinyfiledialogs FETCH_REF master
SHA512 d63d6dd847d6bbd1f252c8fbd228086381af7189ac71afc97bd57e06badd1d3f4d90c6aab6207191ae7253d5a71fc44636cf8e33714089d5b478dd2714f59376 HEAD_REF master
FILENAME "tinyfiledialogs-current.zip" URL https://git.code.sf.net/p/tinyfiledialogs/code
REF e11f94cd7887b101d64f74892d769f0139b5e166
) )
file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}") file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
@ -26,6 +27,6 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(READ "${CURRENT_PACKAGES_DIR}/include/tinyfiledialogs/tinyfiledialogs.h" _contents) file(READ "${CURRENT_PACKAGES_DIR}/include/tinyfiledialogs/tinyfiledialogs.h" _contents)
# reads between the line "- License -" and a closing "*/" # reads between the line "- License -" and a closing "*/"
if (NOT _contents MATCHES [[- License -(([^*]|\*[^/])*)\*/]]) if (NOT _contents MATCHES [[- License -(([^*]|\*[^/])*)\*/]])
message(FATAL_ERROR "Failed to parse license from tinyfiledialogs.h") message(FATAL_ERROR "Failed to parse license from tinyfiledialogs.h")
endif() endif()
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "${CMAKE_MATCH_1}") file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "${CMAKE_MATCH_1}")

View File

@ -1,7 +1,7 @@
{ {
"name": "tinyfiledialogs", "name": "tinyfiledialogs",
"version-semver": "3.8.8", "version": "3.8.8",
"port-version": 1, "port-version": 2,
"description": "Highly portable and cross-platform dialogs for native inputbox, passwordbox, colorpicker and more", "description": "Highly portable and cross-platform dialogs for native inputbox, passwordbox, colorpicker and more",
"homepage": "https://sourceforge.net/projects/tinyfiledialogs/", "homepage": "https://sourceforge.net/projects/tinyfiledialogs/",
"supports": "!uwp", "supports": "!uwp",

View File

@ -1,5 +1,4 @@
{ {
"name": "vcpkg-cmake-config", "name": "vcpkg-cmake-config",
"version-date": "2021-05-22", "version-date": "2021-08-11"
"port-version": 1
} }

View File

@ -221,6 +221,44 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]]
file(WRITE "${main_cmake}" "${contents}") file(WRITE "${main_cmake}" "${contents}")
endforeach() endforeach()
if (VCPKG_TARGET_IS_OSX)
# see #16259 for details why this replacement is necessary.
file(GLOB targets_files "${release_share}/*[Tt]argets.cmake")
if (targets_files STREQUAL "")
file(GLOB targets_files "${release_share}/*[Cc]onfig.cmake")
endif()
foreach(targets_file IN LISTS targets_files)
file(READ "${targets_file}" targets_content)
string(REGEX MATCHALL "INTERFACE_LINK_LIBRARIES[^\n]*\n" library_contents "${targets_content}")
foreach(line IN LISTS library_contents)
set(fixed_line "${line}")
string(REGEX MATCHALL [[/[^ ;"]+/[^ ;"/]+\.framework]] frameworks "${line}")
foreach(framework IN LISTS frameworks)
if(NOT framework MATCHES [[^(.+)/(.+)\.framework$]])
continue()
endif()
set(path "${CMAKE_MATCH_1}")
set(name "${CMAKE_MATCH_2}")
if(NOT DEFINED VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES)
set(_saved_buildtrees_dir "${CURRENT_BUILDTREES_DIR}")
set(CURRENT_BUILDTREES_DIR "${CURRENT_BUILDTREES_DIR}/get-cmake-vars")
z_vcpkg_get_cmake_vars(cmake_vars_file)
debug_message("Including cmake vars from: ${cmake_vars_file}")
include("${cmake_vars_file}")
set(VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}" PARENT_SCOPE)
set(CURRENT_BUILDTREES_DIR "${_saved_buildtrees_dir}")
endif()
list(FIND VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${path}" index)
if(NOT index EQUAL -1)
string(REPLACE "${framework}" "-framework ${name}" fixed_line "${fixed_line}")
endif()
endforeach()
string(REPLACE "${line}" "${fixed_line}" targets_content "${targets_content}")
endforeach()
file(WRITE "${targets_file}" "${targets_content}")
endforeach()
endif()
# Remove /debug/<target_path>/ if it's empty. # Remove /debug/<target_path>/ if it's empty.
file(GLOB_RECURSE remaining_files "${debug_share}/*") file(GLOB_RECURSE remaining_files "${debug_share}/*")
if(remaining_files STREQUAL "") if(remaining_files STREQUAL "")
@ -233,5 +271,3 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]]
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
endif() endif()
endfunction() endfunction()

View File

@ -58,221 +58,222 @@ The helper [`vcpkg_from_github`](vcpkg_from_github.md) should be used for downlo
* [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake) * [freetype](https://github.com/Microsoft/vcpkg/blob/master/ports/freetype/portfile.cmake)
#]===] #]===]
include(vcpkg_execute_in_download_mode) function(z_vcpkg_download_distfile_test_hash path kind error_advice sha512 skip_sha512)
if(_VCPKG_INTERNAL_NO_HASH_CHECK)
# When using the internal hash skip, do not output an explicit message.
return()
endif()
if(skip_sha512)
message(STATUS "Skipping hash check for ${file_path}.")
return()
endif()
function(vcpkg_download_distfile VAR) file(SHA512 "${path}" file_hash)
set(options SKIP_SHA512 SILENT_EXIT QUIET ALWAYS_REDOWNLOAD) if(NOT "${file_hash}" STREQUAL "${sha512}")
set(oneValueArgs FILENAME SHA512) message(FATAL_ERROR
set(multipleValuesArgs URLS HEADERS) "\nFile does not have expected hash:\n"
# parse parameters such that semicolons in options arguments to COMMAND don't get erased " File path: [ ${file_path} ]\n"
cmake_parse_arguments(PARSE_ARGV 1 vcpkg_download_distfile "${options}" "${oneValueArgs}" "${multipleValuesArgs}") " Expected hash: [ ${sha512} ]\n"
" Actual hash: [ ${file_hash} ]\n"
"${CUSTOM_ERROR_ADVICE}\n")
endif()
endfunction()
if(NOT DEFINED vcpkg_download_distfile_URLS) function(z_vcpkg_download_distfile_show_proxy_and_fail error_code)
message(FATAL_ERROR
" \n"
" Failed to download file with error: ${error_code}\n"
" If you use a proxy, please check your proxy setting. Possible causes are:\n"
" \n"
" 1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable\n"
" to `https://address:port`. This is not correct, because `https://` prefix\n"
" claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr\n"
" , etc..) is an HTTP proxy. Try setting `http://address:port` to both\n"
" HTTP_PROXY and HTTPS_PROXY instead.\n"
" \n"
" 2. You are using Fiddler. Currently a bug (https://github.com/microsoft/vcpkg/issues/17752)\n"
" will set HTTPS_PROXY to `https://fiddler_address:port` which lead to problem 1 above.\n"
" Workaround is open Windows 10 Settings App, and search for Proxy Configuration page,\n"
" Change `http=address:port;https=address:port` to `address`, and fill the port number.\n"
" \n"
" 3. You proxy's remote server is out of service.\n"
" \n"
" In future vcpkg releases, if you are using Windows, you no longer need to set\n"
" HTTP(S)_PROXY environment variables. Vcpkg will simply apply Windows IE Proxy\n"
" Settings set by your proxy software. See (https://github.com/microsoft/vcpkg-tool/pull/49)\n"
" and (https://github.com/microsoft/vcpkg-tool/pull/77)\n"
" \n"
" Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues\n")
endfunction()
function(z_vcpkg_download_distfile_via_aria filename urls headers sha512 skip_sha512)
vcpkg_find_acquire_program(ARIA2)
message(STATUS "Downloading ${filename}...")
vcpkg_list(SET headers_param)
foreach(header IN LISTS headers)
vcpkg_list(APPEND headers_param "--header=${header}")
endforeach()
vcpkg_execute_in_download_mode(
COMMAND ${ARIA2} ${urls}
-o temp/${filename}
-l download-${filename}-detailed.log
${headers_param}
OUTPUT_FILE download-${filename}-out.log
ERROR_FILE download-${filename}-err.log
RESULT_VARIABLE error_code
WORKING_DIRECTORY "${DOWNLOADS}"
)
if (NOT "${error_code}" STREQUAL "0")
message(STATUS
"Downloading ${filename}... Failed.\n"
" Exit Code: ${error_code}\n"
" See logs for more information:\n"
" ${DOWNLOADS}/download-${filename}-out.log\n"
" ${DOWNLOADS}/download-${filename}-err.log\n"
" ${DOWNLOADS}/download-${filename}-detailed.log\n"
)
z_vcpkg_download_distfile_show_proxy_and_fail()
else()
z_vcpkg_download_distfile_test_hash(
"${DOWNLOADS}/temp/${filename}"
"downloaded file"
"The file may have been corrupted in transit."
)
file(REMOVE
${DOWNLOADS}/download-${filename}-out.log
${DOWNLOADS}/download-${filename}-err.log
${DOWNLOADS}/download-${filename}-detailed.log
)
get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY)
file(MAKE_DIRECTORY "${downloaded_file_dir}")
file(RENAME "${DOWNLOADS}/temp/${filename}" "${downloaded_file_path}")
endif()
endfunction()
function(vcpkg_download_distfile out_var)
cmake_parse_arguments(PARSE_ARGV 1 arg
"SKIP_SHA512;SILENT_EXIT;QUIET;ALWAYS_REDOWNLOAD"
"FILENAME;SHA512"
"URLS;HEADERS"
)
if(NOT DEFINED arg_URLS)
message(FATAL_ERROR "vcpkg_download_distfile requires a URLS argument.") message(FATAL_ERROR "vcpkg_download_distfile requires a URLS argument.")
endif() endif()
if(NOT DEFINED vcpkg_download_distfile_FILENAME) if(NOT DEFINED arg_FILENAME)
message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.") message(FATAL_ERROR "vcpkg_download_distfile requires a FILENAME argument.")
endif() endif()
if(vcpkg_download_distfile_SILENT_EXIT) if(arg_SILENT_EXIT)
message(WARNING "SILENT_EXIT has been deprecated as an argument to vcpkg_download_distfile -- remove the argument to resolve this warning") message(WARNING "SILENT_EXIT has been deprecated as an argument to vcpkg_download_distfile -- remove the argument to resolve this warning")
endif() endif()
if(vcpkg_download_distfile_ALWAYS_REDOWNLOAD AND NOT vcpkg_download_distfile_SKIP_SHA512) if(arg_ALWAYS_REDOWNLOAD AND NOT arg_SKIP_SHA512)
message(FATAL_ERROR "ALWAYS_REDOWNLOAD option requires SKIP_SHA512 as well") message(FATAL_ERROR "ALWAYS_REDOWNLOAD option requires SKIP_SHA512 as well")
endif() endif()
if(_VCPKG_INTERNAL_NO_HASH_CHECK)
set(vcpkg_download_distfile_SKIP_SHA512 1) if(NOT arg_SKIP_SHA512 AND NOT DEFINED arg_SHA512)
else() message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument.
if(NOT vcpkg_download_distfile_SKIP_SHA512 AND NOT DEFINED vcpkg_download_distfile_SHA512) If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.")
message(FATAL_ERROR "vcpkg_download_distfile requires a SHA512 argument. If you do not know the SHA512, add it as 'SHA512 0' and re-run this command.") elseif(arg_SKIP_SHA512 AND DEFINED arg_SHA512)
endif() message(FATAL_ERROR "vcpkg_download_distfile must not be passed both SHA512 and SKIP_SHA512.")
if(vcpkg_download_distfile_SKIP_SHA512 AND DEFINED vcpkg_download_distfile_SHA512)
message(FATAL_ERROR "vcpkg_download_distfile must not be passed both SHA512 and SKIP_SHA512.")
endif()
endif() endif()
if(NOT vcpkg_download_distfile_SKIP_SHA512)
if(vcpkg_download_distfile_SHA512 STREQUAL "0") if(_VCPKG_INTERNAL_NO_HASH_CHECK)
string(REPEAT "0" 128 vcpkg_download_distfile_SHA512) set(arg_SKIP_SHA512 1)
endif() endif()
string(LENGTH "${vcpkg_download_distfile_SHA512}" vcpkg_download_distfile_SHA512_length)
if(NOT vcpkg_download_distfile_SHA512_length EQUAL "128") if(NOT arg_SKIP_SHA512)
message(FATAL_ERROR "Invalid SHA512: ${vcpkg_download_distfile_SHA512}. If you do not know the file's SHA512, set this to \"0\".") if("${arg_SHA512}" STREQUAL "0")
string(REPEAT 0 128 arg_SHA512)
else()
string(LENGTH "${arg_SHA512}" arg_SHA512_length)
if(NOT "${arg_SHA512_length}" EQUAL "128" OR NOT "${arg_SHA512}" MATCHES "^[a-zA-Z0-9]*$")
message(FATAL_ERROR "Invalid SHA512: ${arg_SHA512}.
If you do not know the file's SHA512, set this to \"0\".")
endif()
endif() endif()
endif() endif()
set(downloaded_file_path ${DOWNLOADS}/${vcpkg_download_distfile_FILENAME}) set(downloaded_file_path "${DOWNLOADS}/${arg_FILENAME}")
set(download_file_path_part "${DOWNLOADS}/temp/${vcpkg_download_distfile_FILENAME}") set(download_file_path_part "${DOWNLOADS}/temp/${arg_FILENAME}")
# Works around issue #3399 # Works around issue #3399
if(IS_DIRECTORY "${DOWNLOADS}/temp") # Delete "temp0" directory created by the old version of vcpkg
# Delete "temp0" directory created by the old version of vcpkg file(REMOVE_RECURSE "${DOWNLOADS}/temp0")
file(REMOVE_RECURSE "${DOWNLOADS}/temp0") file(REMOVE_RECURSE "${DOWNLOADS}/temp")
file(MAKE_DIRECTORY "${DOWNLOADS}/temp")
file(GLOB temp_files "${DOWNLOADS}/temp")
file(REMOVE_RECURSE ${temp_files})
else()
file(MAKE_DIRECTORY "${DOWNLOADS}/temp")
endif()
function(test_hash FILE_PATH FILE_KIND CUSTOM_ERROR_ADVICE)
if(_VCPKG_INTERNAL_NO_HASH_CHECK)
# When using the internal hash skip, do not output an explicit message.
return()
endif()
if(vcpkg_download_distfile_SKIP_SHA512)
message(STATUS "Skipping hash check for ${FILE_PATH}.")
return()
endif()
file(SHA512 ${FILE_PATH} FILE_HASH)
if(NOT FILE_HASH STREQUAL vcpkg_download_distfile_SHA512)
message(FATAL_ERROR
"\nFile does not have expected hash:\n"
" File path: [ ${FILE_PATH} ]\n"
" Expected hash: [ ${vcpkg_download_distfile_SHA512} ]\n"
" Actual hash: [ ${FILE_HASH} ]\n"
"${CUSTOM_ERROR_ADVICE}\n")
endif()
endfunction()
# vcpkg_download_distfile_ALWAYS_REDOWNLOAD only triggers when NOT _VCPKG_NO_DOWNLOADS # vcpkg_download_distfile_ALWAYS_REDOWNLOAD only triggers when NOT _VCPKG_NO_DOWNLOADS
# this could be de-morgan'd out but it's more clear this way # this could be de-morgan'd out but it's more clear this way
if(EXISTS "${downloaded_file_path}" AND NOT (vcpkg_download_distfile_ALWAYS_REDOWNLOAD AND NOT _VCPKG_NO_DOWNLOADS)) if(_VCPKG_NO_DOWNLOADS)
if(NOT vcpkg_download_distfile_QUIET) if(NOT EXISTS "${downloaded_file_path}")
message(STATUS "Using ${downloaded_file_path}")
endif()
test_hash("${downloaded_file_path}" "cached file" "Please delete the file and retry if this file should be downloaded again.")
else()
if(_VCPKG_NO_DOWNLOADS)
message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.") message(FATAL_ERROR "Downloads are disabled, but '${downloaded_file_path}' does not exist.")
endif() endif()
if(NOT arg_QUIET)
# Tries to download the file. message(STATUS "Using ${downloaded_file_path}")
list(GET vcpkg_download_distfile_URLS 0 SAMPLE_URL)
if(_VCPKG_DOWNLOAD_TOOL STREQUAL "ARIA2" AND NOT SAMPLE_URL MATCHES "aria2")
vcpkg_find_acquire_program("ARIA2")
message(STATUS "Downloading ${vcpkg_download_distfile_FILENAME}...")
if(vcpkg_download_distfile_HEADERS)
foreach(header IN LISTS vcpkg_download_distfile_HEADERS)
list(APPEND request_headers "--header=${header}")
endforeach()
endif()
vcpkg_execute_in_download_mode(
COMMAND ${ARIA2} ${vcpkg_download_distfile_URLS}
-o temp/${vcpkg_download_distfile_FILENAME}
-l download-${vcpkg_download_distfile_FILENAME}-detailed.log
${request_headers}
OUTPUT_FILE download-${vcpkg_download_distfile_FILENAME}-out.log
ERROR_FILE download-${vcpkg_download_distfile_FILENAME}-err.log
RESULT_VARIABLE error_code
WORKING_DIRECTORY "${DOWNLOADS}"
)
if (NOT "${error_code}" STREQUAL "0")
message(STATUS
"Downloading ${vcpkg_download_distfile_FILENAME}... Failed.\n"
" Exit Code: ${error_code}\n"
" See logs for more information:\n"
" ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log\n"
" ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log\n"
" ${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log\n"
)
set(download_success 0)
else()
test_hash("${DOWNLOADS}/temp/${vcpkg_download_distfile_FILENAME}" "downloaded file" "The file may have been corrupted in transit.")
file(REMOVE
${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-out.log
${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-err.log
${DOWNLOADS}/download-${vcpkg_download_distfile_FILENAME}-detailed.log
)
get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY)
file(MAKE_DIRECTORY "${downloaded_file_dir}")
file(RENAME "${DOWNLOADS}/temp/${vcpkg_download_distfile_FILENAME}" "${downloaded_file_path}")
set(download_success 1)
endif()
elseif(vcpkg_download_distfile_SKIP_SHA512 OR vcpkg_download_distfile_HEADERS)
# This is a workaround until the vcpkg tool supports downloading files without SHA512 and with headers
set(download_success 0)
set(request_headers)
if(vcpkg_download_distfile_HEADERS)
foreach(header IN LISTS vcpkg_download_distfile_HEADERS)
list(APPEND request_headers HTTPHEADER ${header})
endforeach()
endif()
foreach(url IN LISTS vcpkg_download_distfile_URLS)
message(STATUS "Downloading ${url} -> ${vcpkg_download_distfile_FILENAME}...")
file(DOWNLOAD "${url}" "${download_file_path_part}" STATUS download_status ${request_headers})
list(GET download_status 0 status_code)
if (NOT "${status_code}" STREQUAL "0")
message(STATUS "Downloading ${url}... Failed. Status: ${download_status}")
else()
test_hash("${download_file_path_part}" "downloaded file" "The file may have been corrupted in transit. This can be caused by proxies. If you use a proxy, please set the HTTPS_PROXY and HTTP_PROXY environment variables to \"https://user:password@your-proxy-ip-address:port/\".\n")
get_filename_component(downloaded_file_dir "${downloaded_file_path}" DIRECTORY)
file(MAKE_DIRECTORY "${downloaded_file_dir}")
file(RENAME ${download_file_path_part} ${downloaded_file_path})
set(download_success 1)
break()
endif()
endforeach(url)
else()
set(urls)
foreach(url IN LISTS vcpkg_download_distfile_URLS)
list(APPEND urls "--url=${url}")
endforeach()
if(NOT vcpkg_download_distfile_QUIET)
message(STATUS "Downloading ${vcpkg_download_distfile_URLS} -> ${vcpkg_download_distfile_FILENAME}...")
endif()
set(request_headers)
if(vcpkg_download_distfile_HEADERS)
foreach(header IN LISTS vcpkg_download_distfile_HEADERS)
list(APPEND request_headers "--header=${header}")
endforeach()
endif()
vcpkg_execute_in_download_mode(
COMMAND "$ENV{VCPKG_COMMAND}" x-download
"${downloaded_file_path}"
"${vcpkg_download_distfile_SHA512}"
${urls}
${request_headers}
--debug
--feature-flags=-manifests # there's a bug in vcpkg x-download when it finds a manifest-root
OUTPUT_VARIABLE output
ERROR_VARIABLE output
RESULT_VARIABLE failure
WORKING_DIRECTORY "${DOWNLOADS}"
)
if(failure)
message("${output}")
set(download_success 0)
else()
set(download_success 1)
endif()
endif() endif()
if(NOT download_success) z_vcpkg_download_distfile_test_hash(
message(FATAL_ERROR "${downloaded_file_path}"
" \n" "cached file"
" Failed to download file.\n" "Please delete the file and retry if this file should be downloaded again."
" If you use a proxy, please check your proxy setting. Possible causes are:\n" )
" \n" set("${out_var}" "${downloaded_file_path}" PARENT_SCOPE)
" 1. You are actually using an HTTP proxy, but setting HTTPS_PROXY variable\n" return()
" to `https://address:port`. This is not correct, because `https://` prefix\n" endif()
" claims the proxy is an HTTPS proxy, while your proxy (v2ray, shadowsocksr\n"
" , etc..) is an HTTP proxy. Try setting `http://address:port` to both\n" if(_VCPKG_DOWNLOAD_TOOL STREQUAL "ARIA2" AND NOT EXISTS "${downloaded_file_path}")
" HTTP_PROXY and HTTPS_PROXY instead.\n" z_vcpkg_download_distfile_via_aria(
" \n" "${arg_FILENAME}"
" 2. You are using Fiddler. Currently a bug (https://github.com/microsoft/vcpkg/issues/17752)\n" "${arg_URLS}"
" will set HTTPS_PROXY to `https://fiddler_address:port` which lead to problem 1 above.\n" "${arg_HEADERS}"
" Workaround is open Windows 10 Settings App, and search for Proxy Configuration page,\n" "${arg_SHA512}"
" Change `http=address:port;https=address:port` to `address`, and fill the port number.\n" "${arg_skip_sha512}"
" \n" )
" 3. You proxy's remote server is out of service.\n" set("${out_var}" "${downloaded_file_path}" PARENT_SCOPE)
" \n" return()
" In future vcpkg releases, if you are using Windows, you no longer need to set\n" endif()
" HTTP(S)_PROXY environment variables. Vcpkg will simply apply Windows IE Proxy\n"
" Settings set by your proxy software. See (https://github.com/microsoft/vcpkg-tool/pull/49)\n" vcpkg_list(SET urls_param)
" and (https://github.com/microsoft/vcpkg-tool/pull/77)\n" foreach(url IN LISTS arg_URLS)
" \n" vcpkg_list(APPEND urls_param "--url=${url}")
" Otherwise, please submit an issue at https://github.com/Microsoft/vcpkg/issues\n") endforeach()
if(NOT vcpkg_download_distfile_QUIET)
message(STATUS "Downloading ${arg_URLS} -> ${arg_FILENAME}...")
endif()
vcpkg_list(SET headers_param)
foreach(header IN LISTS arg_HEADERS)
list(APPEND headers_param "--header=${header}")
endforeach()
if(arg_SKIP_SHA512)
vcpkg_list(SET sha512_param "--skip-sha512")
else()
vcpkg_list(SET sha512_param "--sha512=${arg_SHA512}")
endif()
if(NOT EXISTS "${downloaded_file_path}" OR arg_ALWAYS_REDOWNLOAD)
vcpkg_execute_in_download_mode(
COMMAND "$ENV{VCPKG_COMMAND}" x-download
"${downloaded_file_path}"
${sha512_param}
${urls_param}
${headers_param}
--debug
--feature-flags=-manifests # there's a bug in vcpkg x-download when it finds a manifest-root
OUTPUT_VARIABLE output
ERROR_VARIABLE output
RESULT_VARIABLE error_code
WORKING_DIRECTORY "${DOWNLOADS}"
)
if(NOT "${error_code}" EQUAL "0")
message("${output}")
z_vcpkg_download_distfile_show_proxy_and_fail("${error_code}")
endif() endif()
endif() endif()
set(${VAR} ${downloaded_file_path} PARENT_SCOPE)
set("${out_var}" "${downloaded_file_path}" PARENT_SCOPE)
endfunction() endfunction()

View File

@ -7,27 +7,41 @@ Windows(x86/x64) Only: If not it will switch/enable MinGW gfortran
## Usage ## Usage
```cmake ```cmake
vcpkg_find_fortran(<additional_cmake_args_out>) vcpkg_find_fortran(<out_var>)
```
## Example
```cmake
vcpkg_find_fortran(fortran_args)
# ...
vcpkg_configure_cmake(...
OPTIONS
${fortran_args}
)
``` ```
#]===] #]===]
function(vcpkg_find_fortran additional_cmake_args_out) function(vcpkg_find_fortran out_var)
set(ARGS_OUT) if("${ARGC}" GREATER "1")
message(WARNING "${CMAKE_CURRENT_FUNCTION} was passed extra args: ${ARGN}")
endif()
vcpkg_list(SET additional_cmake_args)
set(CMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}") set(CMAKE_BINARY_DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_BINARY_DIR}") set(CMAKE_CURRENT_BINARY_DIR "${CMAKE_BINARY_DIR}")
set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_BINARY_DIR}/Platform") set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_BINARY_DIR}/Platform")
include(CMakeDetermineFortranCompiler) include(CMakeDetermineFortranCompiler)
if(NOT CMAKE_Fortran_COMPILER AND NOT VCPKG_CHAINLOAD_TOOLCHAIN_FILE)
# This intentionally breaks users with a custom toolchain which do not have a Fortran compiler setup if(NOT CMAKE_Fortran_COMPILER AND "${VCPKG_CHAINLOAD_TOOLCHAIN_FILE}" STREQUAL "")
# because they either need to use a port-overlay (for e.g. lapack), remove the toolchain for the port using fortran # If a user uses their own VCPKG_CHAINLOAD_TOOLCHAIN_FILE, they _must_ figure out fortran on their own.
# or setup fortran in their VCPKG_CHAINLOAD_TOOLCHAIN_FILE themselfs!
if(WIN32) if(WIN32)
message(STATUS "No Fortran compiler found on the PATH. Using MinGW gfortran!") message(STATUS "No Fortran compiler found on the PATH. Using MinGW gfortran!")
# If no Fortran compiler is on the path we switch to use gfortan from MinGW within vcpkg # If no Fortran compiler is on the path we switch to use gfortan from MinGW within vcpkg
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86") if("${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "x86")
set(MINGW_PATH mingw32) set(mingw_path mingw32)
set(MACHINE_FLAG -m32) set(machine_flag -m32)
vcpkg_acquire_msys(MSYS_ROOT vcpkg_acquire_msys(msys_root
DIRECT_PACKAGES DIRECT_PACKAGES
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-fortran-10.2.0-1-any.pkg.tar.zst" "https://repo.msys2.org/mingw/i686/mingw-w64-i686-gcc-fortran-10.2.0-1-any.pkg.tar.zst"
ddbdaf9ea865181e16a0931b2ec88c2dcef8add34628e479c7b9de4fa2ccb22e09c7239442e58702e0acd3adabc920565e976984f2bcd90a3668bf7f48a245f1 ddbdaf9ea865181e16a0931b2ec88c2dcef8add34628e479c7b9de4fa2ccb22e09c7239442e58702e0acd3adabc920565e976984f2bcd90a3668bf7f48a245f1
@ -62,10 +76,10 @@ function(vcpkg_find_fortran additional_cmake_args_out)
"https://repo.msys2.org/mingw/i686/mingw-w64-i686-zstd-1.4.5-1-any.pkg.tar.zst" "https://repo.msys2.org/mingw/i686/mingw-w64-i686-zstd-1.4.5-1-any.pkg.tar.zst"
68f431073717b59549ab0fd26be8df8afcb43f3dd85be2ffcbc7d1a629999eed924656a7fc3f50937b2e6605a5067542d016181106b7bc3408b89b268ced5d23 68f431073717b59549ab0fd26be8df8afcb43f3dd85be2ffcbc7d1a629999eed924656a7fc3f50937b2e6605a5067542d016181106b7bc3408b89b268ced5d23
) )
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64") elseif("${VCPKG_TARGET_ARCHITECTURE}" STREQUAL "x64")
set(MINGW_PATH mingw64) set(mingw_path mingw64)
set(MACHINE_FLAG -m64) set(machine_flag -m64)
vcpkg_acquire_msys(MSYS_ROOT vcpkg_acquire_msys(msys_root
DIRECT_PACKAGES DIRECT_PACKAGES
"https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-fortran-10.2.0-1-any.pkg.tar.zst" "https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-fortran-10.2.0-1-any.pkg.tar.zst"
0de02db791e978ae21577e675ee9676f741336c9a5ceb5614dbdfc793e2c1c4749b394f41362af7b069e970302fddf8c6772ebd8445fe1c360861606b1784b4d 0de02db791e978ae21577e675ee9676f741336c9a5ceb5614dbdfc793e2c1c4749b394f41362af7b069e970302fddf8c6772ebd8445fe1c360861606b1784b4d
@ -104,14 +118,16 @@ function(vcpkg_find_fortran additional_cmake_args_out)
message(FATAL_ERROR "Unknown architecture '${VCPKG_TARGET_ARCHITECTURE}' for MinGW Fortran build!") message(FATAL_ERROR "Unknown architecture '${VCPKG_TARGET_ARCHITECTURE}' for MinGW Fortran build!")
endif() endif()
set(MINGW_BIN "${MSYS_ROOT}/${MINGW_PATH}/bin") set(mingw_bin "${msys_root}/${mingw_path}/bin")
vcpkg_add_to_path(PREPEND "${MINGW_BIN}") vcpkg_add_to_path(PREPEND "${mingw_bin}")
list(APPEND ARGS_OUT -DCMAKE_GNUtoMS=ON vcpkg_list(APPEND additional_cmake_args
"-DCMAKE_Fortran_COMPILER=${MINGW_BIN}/gfortran.exe" -DCMAKE_GNUtoMS=ON
"-DCMAKE_C_COMPILER=${MINGW_BIN}/gcc.exe" "-DCMAKE_Fortran_COMPILER=${mingw_bin}/gfortran.exe"
"-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms ${MACHINE_FLAG} ${VCPKG_Fortran_FLAGS}") "-DCMAKE_C_COMPILER=${mingw_bin}/gcc.exe"
"-DCMAKE_Fortran_FLAGS_INIT:STRING= -mabi=ms ${machine_flag} ${VCPKG_Fortran_FLAGS}")
# This is for private use by vcpkg-gfortran # This is for private use by vcpkg-gfortran
set(vcpkg_find_fortran_MSYS_ROOT "${MSYS_ROOT}" PARENT_SCOPE) set(vcpkg_find_fortran_MSYS_ROOT "${msys_root}" PARENT_SCOPE)
set(VCPKG_USE_INTERNAL_Fortran TRUE PARENT_SCOPE) set(VCPKG_USE_INTERNAL_Fortran TRUE PARENT_SCOPE)
set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled PARENT_SCOPE) set(VCPKG_POLICY_SKIP_DUMPBIN_CHECKS enabled PARENT_SCOPE)
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake" PARENT_SCOPE) # Switching to MinGW toolchain for Fortran set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE "${SCRIPTS}/toolchains/mingw.cmake" PARENT_SCOPE) # Switching to MinGW toolchain for Fortran
@ -127,5 +143,5 @@ function(vcpkg_find_fortran additional_cmake_args_out)
message(FATAL_ERROR "Unable to find a Fortran compiler using 'CMakeDetermineFortranCompiler'. Please install one (e.g. gfortran) and make it available on the PATH!") message(FATAL_ERROR "Unable to find a Fortran compiler using 'CMakeDetermineFortranCompiler'. Please install one (e.g. gfortran) and make it available on the PATH!")
endif() endif()
endif() endif()
set(${additional_cmake_args_out} ${ARGS_OUT} PARENT_SCOPE) set("${out_var}" "${additional_cmake_args}" PARENT_SCOPE)
endfunction() endfunction()

View File

@ -220,6 +220,44 @@ function(vcpkg_fixup_cmake_targets)
file(WRITE ${MAIN_CMAKE} "${_contents}") file(WRITE ${MAIN_CMAKE} "${_contents}")
endforeach() endforeach()
if (VCPKG_TARGET_IS_OSX)
# see #16259 for details why this replacement is necessary.
file(GLOB targets_files "${RELEASE_SHARE}/*[Tt]argets.cmake")
if (targets_files STREQUAL "")
file(GLOB targets_files "${RELEASE_SHARE}/*[Cc]onfig.cmake")
endif()
foreach(targets_file IN LISTS targets_files)
file(READ "${targets_file}" targets_content)
string(REGEX MATCHALL "INTERFACE_LINK_LIBRARIES[^\n]*\n" library_contents "${targets_content}")
foreach(line IN LISTS library_contents)
set(fixed_line "${line}")
string(REGEX MATCHALL [[/[^ ;"]+/[^ ;"/]+\.framework]] frameworks "${line}")
foreach(framework IN LISTS frameworks)
if(NOT framework MATCHES [[^(.+)/(.+)\.framework$]])
continue()
endif()
set(path "${CMAKE_MATCH_1}")
set(name "${CMAKE_MATCH_2}")
if(NOT DEFINED VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES)
set(_saved_buildtrees_dir "${CURRENT_BUILDTREES_DIR}")
set(CURRENT_BUILDTREES_DIR "${CURRENT_BUILDTREES_DIR}/get-cmake-vars")
z_vcpkg_get_cmake_vars(cmake_vars_file)
debug_message("Including cmake vars from: ${cmake_vars_file}")
include("${cmake_vars_file}")
set(VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}" PARENT_SCOPE)
set(CURRENT_BUILDTREES_DIR "${_saved_buildtrees_dir}")
endif()
list(FIND VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${path}" index)
if(NOT index EQUAL -1)
string(REPLACE "${framework}" "-framework ${name}" fixed_line "${fixed_line}")
endif()
endforeach()
string(REPLACE "${line}" "${fixed_line}" targets_content "${targets_content}")
endforeach()
file(WRITE "${targets_file}" "${targets_content}")
endforeach()
endif()
# Remove /debug/<target_path>/ if it's empty. # Remove /debug/<target_path>/ if it's empty.
file(GLOB_RECURSE REMAINING_FILES "${DEBUG_SHARE}/*") file(GLOB_RECURSE REMAINING_FILES "${DEBUG_SHARE}/*")
if(NOT REMAINING_FILES) if(NOT REMAINING_FILES)
@ -241,5 +279,3 @@ function(vcpkg_fixup_cmake_targets)
file(WRITE ${CMAKE_FILE} "${_contents}") file(WRITE ${CMAKE_FILE} "${_contents}")
endforeach() endforeach()
endfunction() endfunction()

View File

@ -45,115 +45,122 @@ Still work in progress. If there are more cases which can be handled here feel f
* [brotli](https://github.com/Microsoft/vcpkg/blob/master/ports/brotli/portfile.cmake) * [brotli](https://github.com/Microsoft/vcpkg/blob/master/ports/brotli/portfile.cmake)
#]===] #]===]
function(vcpkg_fixup_pkgconfig_check_files pkg_cfg_cmd _file _config) function(z_vcpkg_fixup_pkgconfig_check_files file config)
set(PATH_SUFFIX_DEBUG /debug) set(path_suffix_debug /debug)
set(PATH_SUFFIX_RELEASE) set(path_suffix_release "")
set(PKGCONFIG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib/pkgconfig")
set(PKGCONFIG_INSTALLED_SHARE_DIR "${CURRENT_INSTALLED_DIR}/share/pkgconfig")
set(PKGCONFIG_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}${PATH_SUFFIX_${_config}}/lib/pkgconfig")
set(PKGCONFIG_PACKAGES_SHARE_DIR "${CURRENT_PACKAGES_DIR}/share/pkgconfig")
if(DEFINED ENV{PKG_CONFIG_PATH}) if(DEFINED ENV{PKG_CONFIG_PATH})
set(BACKUP_ENV_PKG_CONFIG_PATH "$ENV{PKG_CONFIG_PATH}") set(backup_env_pkg_config_path "$ENV{PKG_CONFIG_PATH}")
else() else()
unset(BACKUP_ENV_PKG_CONFIG_PATH) unset(backup_env_pkg_config_path)
endif()
if(DEFINED ENV{PKG_CONFIG_PATH} AND NOT ENV{PKG_CONFIG_PATH} STREQUAL "")
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}$ENV{PKG_CONFIG_PATH}")
else()
set(ENV{PKG_CONFIG_PATH} "${PKGCONFIG_INSTALLED_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_INSTALLED_SHARE_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_DIR}${VCPKG_HOST_PATH_SEPARATOR}${PKGCONFIG_PACKAGES_SHARE_DIR}")
endif() endif()
# First make sure everything is ok with the package and its deps vcpkg_list(SET pkg_config_path
get_filename_component(_package_name "${_file}" NAME_WLE) "${CURRENT_INSTALLED_DIR}${PATH_SUFFIX_${_config}}/lib/pkgconfig"
debug_message("Checking package (${_config}): ${_package_name}") "${CURRENT_INSTALLED_DIR}/share/pkgconfig"
execute_process(COMMAND "${pkg_cfg_cmd}" --print-errors --exists ${_package_name} "${CURRENT_PACKAGES_DIR}${PATH_SUFFIX_${_config}}/lib/pkgconfig"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}" "${CURRENT_PACKAGES_DIR}/share/pkgconfig"
RESULT_VARIABLE _pkg_error_var )
OUTPUT_VARIABLE _pkg_output if(DEFINED ENV{PKG_CONFIG_PATH} AND NOT ENV{PKG_CONFIG_PATH} STREQUAL "")
ERROR_VARIABLE _pkg_error_out vcpkg_list(APPEND pkg_config_path "$ENV{PKG_CONFIG_PATH}")
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT _pkg_error_var EQUAL 0)
message(STATUS "pkg_cfg_cmd call with:${pkg_cfg_cmd} --exists ${_package_name} failed")
message(STATUS "ENV{PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH}")
message(STATUS "pkg-config call failed with error code:${_pkg_error_var}")
message(STATUS "pkg-config output:${_pkg_output}")
message(FATAL_ERROR "pkg-config error output:${_pkg_error_out}")
else()
debug_message("pkg-config returned:${_pkg_error_var}")
debug_message("pkg-config output:${_pkg_output}")
debug_message("pkg-config error output:${_pkg_error_out}")
endif() endif()
if(DEFINED BACKUP_ENV_PKG_CONFIG_PATH) vcpkg_list(JOIN pkg_config_path "${VCPKG_PATH_SEPARATOR}" pkg_config_path)
set(ENV{PKG_CONFIG_PATH} "${BACKUP_ENV_PKG_CONFIG_PATH}") set(ENV{PKG_CONFIG_PATH} "${pkg_config_path}")
# First make sure everything is ok with the package and its deps
cmake_path(GET file STEM package_name)
debug_message("Checking package (${config}): ${package_name}")
execute_process(
COMMAND "${PKGCONFIG}" --print-errors --exists "${package_name}"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
RESULT_VARIABLE error_var
OUTPUT_VARIABLE output
ERROR_VARIABLE output
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT "${error_var}" EQUAL "0")
message(FATAL_ERROR "${PKGCONFIG} --exists ${package_name} failed with error code: ${error_var}
ENV{PKG_CONFIG_PATH}: \"$ENV{PKG_CONFIG_PATH}\"
output: ${output}"
)
else()
debug_message("pkg-config --exists ${package_name} output: ${output}")
endif()
if(DEFINED backup_env_pkg_config_path)
set(ENV{PKG_CONFIG_PATH} "${backup_env_pkg_config_path}")
else() else()
unset(ENV{PKG_CONFIG_PATH}) unset(ENV{PKG_CONFIG_PATH})
endif() endif()
endfunction() endfunction()
function(vcpkg_fixup_pkgconfig) function(vcpkg_fixup_pkgconfig)
# parse parameters such that semicolons in options arguments to COMMAND don't get erased cmake_parse_arguments(PARSE_ARGV 0 arg
cmake_parse_arguments(PARSE_ARGV 0 _vfpkg "SKIP_CHECK" "" "RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS") "SKIP_CHECK"
""
"RELEASE_FILES;DEBUG_FILES;SYSTEM_LIBRARIES;SYSTEM_PACKAGES;IGNORE_FLAGS"
)
if(_vfpkg_UNPARSED_ARGUMENTS) if(DEFINED arg_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "vcpkg_fixup_pkgconfig() was passed extra arguments: ${_vfct_UNPARSED_ARGUMENTS}") message(FATAL_ERROR "${CMAKE_CURRENT_FUNCTION} was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}")
endif() endif()
if((DEFINED _vfpkg_RELEASE_FILES AND NOT DEFINED _vfpkg_DEBUG_FILES) OR (NOT DEFINED _vfpkg_RELEASE_FILES AND DEFINED _vfpkg_DEBUG_FILES)) if(DEFINED arg_RELEASE_FILES AND NOT DEFINED arg_DEBUG_FILES)
message(FATAL_ERROR "vcpkg_fixup_pkgconfig() requires both or neither of DEBUG_FILES and RELEASE_FILES") message(FATAL_ERROR "DEBUG_FILES must be specified if RELEASE_FILES was specified.")
endif()
if(NOT DEFINED arg_RELEASE_FILES AND DEFINED arg_DEBUG_FILES)
message(FATAL_ERROR "RELEASE_FILES must be specified if DEBUG_FILES was specified.")
endif() endif()
if(NOT DEFINED _vfpkg_RELEASE_FILES) if(NOT DEFINED arg_RELEASE_FILES)
file(GLOB_RECURSE _vfpkg_RELEASE_FILES "${CURRENT_PACKAGES_DIR}/**/*.pc") file(GLOB_RECURSE arg_RELEASE_FILES "${CURRENT_PACKAGES_DIR}/**/*.pc")
file(GLOB_RECURSE _vfpkg_DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/**/*.pc") file(GLOB_RECURSE arg_DEBUG_FILES "${CURRENT_PACKAGES_DIR}/debug/**/*.pc")
if(_vfpkg_DEBUG_FILES) foreach(debug_file IN LISTS arg_DEBUG_FILES)
list(REMOVE_ITEM _vfpkg_RELEASE_FILES ${_vfpkg_DEBUG_FILES}) vcpkg_list(REMOVE_ITEM arg_RELEASE_FILES "${debug_file}")
endif() endforeach()
endif() endif()
vcpkg_find_acquire_program(PKGCONFIG) vcpkg_find_acquire_program(PKGCONFIG)
debug_message("Using pkg-config from: ${PKGCONFIG}") debug_message("Using pkg-config from: ${PKGCONFIG}")
#Absolute Unix like paths string(REGEX REPLACE "^([a-zA-Z]):/" [[/\1/]] unix_packages_dir "${CURRENT_PACKAGES_DIR}")
string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_PACKAGES_DIR "${CURRENT_PACKAGES_DIR}") string(REGEX REPLACE "^([a-zA-Z]):/" [[/\1/]] unix_installed_dir "${CURRENT_INSTALLED_DIR}")
string(REGEX REPLACE "([a-zA-Z]):/" "/\\1/" _VCPKG_INSTALLED_DIR "${CURRENT_INSTALLED_DIR}")
foreach(CONFIG RELEASE DEBUG) foreach(config IN ITEMS RELEASE DEBUG)
debug_message("${CONFIG} Files: ${_vfpkg_${CONFIG}_FILES}") debug_message("${config} Files: ${arg_${config}_FILES}")
if(VCPKG_BUILD_TYPE STREQUAL "debug" AND CONFIG STREQUAL "RELEASE") if("${VCPKG_BUILD_TYPE}" STREQUAL "debug" AND "${config}" STREQUAL "RELEASE")
continue() continue()
endif() endif()
if(VCPKG_BUILD_TYPE STREQUAL "release" AND CONFIG STREQUAL "DEBUG") if("${VCPKG_BUILD_TYPE}" STREQUAL "release" AND "${config}" STREQUAL "DEBUG")
continue() continue()
endif() endif()
foreach(_file ${_vfpkg_${CONFIG}_FILES}) foreach(file IN LISTS "arg_${config}_FILES")
message(STATUS "Fixing pkgconfig file: ${_file}") message(STATUS "Fixing pkgconfig file: ${file}")
get_filename_component(PKG_LIB_SEARCH_PATH "${_file}" DIRECTORY) cmake_path(GET file PARENT_PATH pkg_lib_search_path)
if(CONFIG STREQUAL "DEBUG") if("${config}" STREQUAL "DEBUG")
file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}/debug/") set(relative_pc_path "${CURRENT_PACKAGES_DIR}/debug")
cmake_path(RELATIVE_PATH relative_pc_path BASE_DIRECTORY "${pkg_lib_search_path}")
else() else()
file(RELATIVE_PATH RELATIVE_PC_PATH "${PKG_LIB_SEARCH_PATH}" "${CURRENT_PACKAGES_DIR}") set(relative_pc_path "${CURRENT_PACKAGES_DIR}")
cmake_path(RELATIVE_PATH relative_pc_path BASE_DIRECTORY "${pkg_lib_search_path}")
endif() endif()
# strip trailing slash
string(REGEX REPLACE "/$" "" RELATIVE_PC_PATH "${RELATIVE_PC_PATH}")
#Correct *.pc file #Correct *.pc file
file(READ "${_file}" _contents) file(READ "${file}" contents)
string(REPLACE "${CURRENT_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}")
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_PACKAGES_DIR}" [[${prefix}]] contents "${contents}")
string(REPLACE "${_VCPKG_PACKAGES_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${prefix}]] contents "${contents}")
string(REPLACE "${_VCPKG_INSTALLED_DIR}" "\${prefix}" _contents "${_contents}") string(REPLACE "${unix_packages_dir}" [[${prefix}]] contents "${contents}")
string(REGEX REPLACE "(^|\n)prefix[\t ]*=[^\n]*" "" _contents "${_contents}") string(REPLACE "${unix_installed_dir}" [[${prefix}]] contents "${contents}")
if(CONFIG STREQUAL "DEBUG")
string(REPLACE "}/debug" "}" _contents "${_contents}") string(REGEX REPLACE "(^|\n)prefix[\t ]*=[^\n]*" "" contents "${contents}")
# Prefix points at the debug subfolder if("${config}" STREQUAL "DEBUG")
string(REPLACE "\${prefix}/include" "\${prefix}/../include" _contents "${_contents}") # prefix points at the debug subfolder
string(REPLACE "\${prefix}/share" "\${prefix}/../share" _contents "${_contents}") string(REPLACE [[${prefix}/debug]] [[${prefix}]] contents "${contents}")
string(REPLACE [[${prefix}/include]] [[${prefix}/../include]] contents "${contents}")
string(REPLACE [[${prefix}/share]] [[${prefix}/../share]] contents "${contents}")
endif() endif()
string(REGEX REPLACE " -L(\\\${[^}]*}[^ \n\t]*)" " -L\"\\1\"" _contents "${_contents}") # quote -L, -I, and -l paths starting with `${blah}`
string(REGEX REPLACE " -I(\\\${[^}]*}[^ \n\t]*)" " -I\"\\1\"" _contents "${_contents}") string(REGEX REPLACE " -([LIl])(\\\${[^}]*}[^ \n\t]*)" [[ -\1"\2"]] contents "${contents}")
string(REGEX REPLACE " -l(\\\${[^}]*}[^ \n\t]*)" " -l\"\\1\"" _contents "${_contents}")
# This section fuses XYZ.private and XYZ according to VCPKG_LIBRARY_LINKAGE # This section fuses XYZ.private and XYZ according to VCPKG_LIBRARY_LINKAGE
# #
# Pkgconfig searches Requires.private transitively for Cflags in the dynamic case, # Pkgconfig searches Requires.private transitively for Cflags in the dynamic case,
@ -161,33 +168,51 @@ function(vcpkg_fixup_pkgconfig)
# #
# Once this transformation is complete, users of vcpkg should never need to pass # Once this transformation is complete, users of vcpkg should never need to pass
# --static. # --static.
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") if("${VCPKG_LIBRARY_LINKAGE}" STREQUAL "static")
# Libs comes before Libs.private # how this works:
string(REGEX REPLACE "(^|\n)(Libs: *[^\n]*)(.*)\nLibs.private:( *[^\n]*)" "\\1\\2\\4\\3" _contents "${_contents}") # we want to transform:
# Libs.private comes before Libs # Libs: $1
string(REGEX REPLACE "(^|\n)Libs.private:( *[^\n]*)(.*\nLibs: *[^\n]*)" "\\3\\2" _contents "${_contents}") # Libs.private: $2
# Only Libs.private # into
string(REGEX REPLACE "(^|\n)Libs.private: *" "\\1Libs: " _contents "${_contents}") # Libs: $1 $2
# Requires comes before Requires.private # and the same thing for Requires and Requires.private
string(REGEX REPLACE "(^|\n)(Requires: *[^\n]*)(.*)\nRequires.private:( *[^\n]*)" "\\1\\2\\4\\3" _contents "${_contents}")
# Requires.private comes before Requires set(libs_line "")
string(REGEX REPLACE "(^|\n)Requires.private:( *[^\n]*)(.*\nRequires: *[^\n]*)" "\\3\\2" _contents "${_contents}") set(requires_line "")
# Only Requires.private if("${contents}" MATCHES "Libs: *([^\n]*)")
string(REGEX REPLACE "(^|\n)Requires.private: *" "\\1Requires: " _contents "${_contents}") string(APPEND libs_line " ${CMAKE_MATCH_1}")
endif()
if("${contents}" MATCHES "Libs.private: *([^\n]*)")
string(APPEND libs_line " ${CMAKE_MATCH_1}")
endif()
if("${contents}" MATCHES "Requires: *([^\n]*)")
string(APPEND requires_line " ${CMAKE_MATCH_1}")
endif()
if("${contents}" MATCHES "Requires.private: *([^\n]*)")
string(APPEND requires_line " ${CMAKE_MATCH_1}")
endif()
string(REGEX REPLACE "(^|\n)(Requires|Libs)(\\.private)?:[^\n]*\n" [[\1]] contents "${contents}")
if(NOT "${libs_line}" STREQUAL "")
string(APPEND contents "Libs:${libs_line}\n")
endif()
if(NOT "${requires_line}" STREQUAL "")
string(APPEND contents "Requires:${requires_line}\n")
endif()
endif() endif()
file(WRITE "${_file}" "prefix=\${pcfiledir}/${RELATIVE_PC_PATH}\n${_contents}") file(WRITE "${file}" "prefix=\${pcfiledir}/${relative_pc_path}\n${contents}")
unset(PKG_LIB_SEARCH_PATH)
endforeach() endforeach()
if(NOT _vfpkg_SKIP_CHECK) # The check can only run after all files have been corrected! if(NOT arg_SKIP_CHECK) # The check can only run after all files have been corrected!
foreach(_file ${_vfpkg_${CONFIG}_FILES}) foreach(file IN LISTS "arg_${config}_FILES")
vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${_file}" "${CONFIG}") z_vcpkg_fixup_pkgconfig_check_files("${PKGCONFIG}" "${file}" "${config}")
endforeach() endforeach()
endif() endif()
endforeach() endforeach()
debug_message("Fixing pkgconfig --- finished") debug_message("Fixing pkgconfig --- finished")
set(VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE) set(Z_VCPKG_FIXUP_PKGCONFIG_CALLED TRUE CACHE INTERNAL "See below" FORCE)
# Variable to check if this function has been called! # Variable to check if this function has been called!
# Theoreotically vcpkg could look for *.pc files and automatically call this function # Theoreotically vcpkg could look for *.pc files and automatically call this function
# or check if this function has been called if *.pc files are detected. # or check if this function has been called if *.pc files are detected.

View File

@ -26,6 +26,11 @@ The url of the git repository.
### REF ### REF
The git sha of the commit to download. The git sha of the commit to download.
### FETCH_REF
The git branch to fetch in non-HEAD mode. After this is fetched,
then `REF` is checked out. This is useful in cases where the git server
does not allow checking out non-advertised objects.
### HEAD_REF ### HEAD_REF
The git branch to use when the package is requested to be built from the latest sources. The git branch to use when the package is requested to be built from the latest sources.
@ -44,12 +49,10 @@ Relative paths are based on the port directory.
* [fdlibm](https://github.com/Microsoft/vcpkg/blob/master/ports/fdlibm/portfile.cmake) * [fdlibm](https://github.com/Microsoft/vcpkg/blob/master/ports/fdlibm/portfile.cmake)
#]===] #]===]
include(vcpkg_execute_in_download_mode)
function(vcpkg_from_git) function(vcpkg_from_git)
cmake_parse_arguments(PARSE_ARGV 0 "arg" cmake_parse_arguments(PARSE_ARGV 0 "arg"
"" ""
"OUT_SOURCE_PATH;URL;REF;HEAD_REF;TAG" "OUT_SOURCE_PATH;URL;REF;FETCH_REF;HEAD_REF;TAG"
"PATCHES" "PATCHES"
) )
@ -62,26 +65,41 @@ function(vcpkg_from_git)
if(NOT DEFINED arg_OUT_SOURCE_PATH) if(NOT DEFINED arg_OUT_SOURCE_PATH)
message(FATAL_ERROR "OUT_SOURCE_PATH must be specified.") message(FATAL_ERROR "OUT_SOURCE_PATH must be specified")
endif() endif()
if(NOT DEFINED arg_URL) if(NOT DEFINED arg_URL)
message(FATAL_ERROR "The git url must be specified") message(FATAL_ERROR "URL must be specified")
endif() endif()
if(NOT DEFINED arg_REF AND NOT DEFINED arg_HEAD_REF) if(NOT DEFINED arg_REF AND NOT DEFINED arg_HEAD_REF)
message(FATAL_ERROR "At least one of REF or HEAD_REF must be specified.") message(FATAL_ERROR "At least one of REF or HEAD_REF must be specified")
endif()
if(DEFINED arg_FETCH_REF AND NOT DEFINED arg_REF)
message(FATAL_ERROR "REF must be specified if FETCH_REF is specified")
endif() endif()
set(working_directory_param "") vcpkg_list(SET git_fetch_shallow_param --depth 1)
set(ref_to_use "${arg_REF}") vcpkg_list(SET extract_working_directory_param)
set(git_working_directory "${DOWNLOADS}/git-tmp")
if(VCPKG_USE_HEAD_VERSION) if(VCPKG_USE_HEAD_VERSION)
if(DEFINED arg_HEAD_REF) if(DEFINED arg_HEAD_REF)
set(working_directory_param "WORKING_DIRECTORY" "${CURRENT_BUILDTREES_DIR}/src/head") vcpkg_list(SET working_directory_param "WORKING_DIRECTORY" "${CURRENT_BUILDTREES_DIR}/src/head")
vcpkg_list(SET git_fetch_shallow_param --depth 1)
set(ref_to_use "${arg_HEAD_REF}") set(ref_to_use "${arg_HEAD_REF}")
set(git_working_directory "${CURRENT_BUILDTREES_DIR}/src/git-tmp")
else() else()
message(STATUS "Package does not specify HEAD_REF. Falling back to non-HEAD version.") message(STATUS "Package does not specify HEAD_REF. Falling back to non-HEAD version.")
endif() endif()
elseif(NOT DEFINED arg_REF) else()
message(FATAL_ERROR "Package does not specify REF. It must be built using --head.") if(NOT DEFINED arg_REF)
message(FATAL_ERROR "Package does not specify REF. It must be built using --head.")
endif()
if(DEFINED arg_FETCH_REF)
set(ref_to_use "${arg_FETCH_REF}")
vcpkg_list(SET git_fetch_shallow_param)
else()
set(ref_to_use "${arg_REF}")
endif()
endif() endif()
string(REPLACE "/" "_-" sanitized_ref "${ref_to_use}") string(REPLACE "/" "_-" sanitized_ref "${ref_to_use}")
@ -98,40 +116,54 @@ function(vcpkg_from_git)
# Note: git init is safe to run multiple times # Note: git init is safe to run multiple times
vcpkg_execute_required_process( vcpkg_execute_required_process(
ALLOW_IN_DOWNLOAD_MODE ALLOW_IN_DOWNLOAD_MODE
COMMAND "${GIT}" init git-tmp COMMAND "${GIT}" init "${git_working_directory}"
WORKING_DIRECTORY "${DOWNLOADS}" WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}"
LOGNAME "git-init-${TARGET_TRIPLET}" LOGNAME "git-init-${TARGET_TRIPLET}"
) )
vcpkg_execute_required_process( vcpkg_execute_required_process(
ALLOW_IN_DOWNLOAD_MODE ALLOW_IN_DOWNLOAD_MODE
COMMAND "${GIT}" fetch "${arg_URL}" "${ref_to_use}" --depth 1 -n COMMAND "${GIT}" fetch "${arg_URL}" "${ref_to_use}" ${git_fetch_shallow_param} -n
WORKING_DIRECTORY "${DOWNLOADS}/git-tmp" WORKING_DIRECTORY "${git_working_directory}"
LOGNAME "git-fetch-${TARGET_TRIPLET}" LOGNAME "git-fetch-${TARGET_TRIPLET}"
) )
vcpkg_execute_in_download_mode(
COMMAND "${GIT}" rev-parse FETCH_HEAD
OUTPUT_VARIABLE rev_parse_head
ERROR_VARIABLE rev_parse_head
RESULT_VARIABLE error_code
WORKING_DIRECTORY "${DOWNLOADS}/git-tmp"
)
if(error_code)
message(FATAL_ERROR "unable to determine FETCH_HEAD after fetching git repository")
endif()
string(STRIP "${rev_parse_head}" rev_parse_head)
if(VCPKG_USE_HEAD_VERSION) if(VCPKG_USE_HEAD_VERSION)
set(VCPKG_HEAD_VERSION "${rev_parse_head}" PARENT_SCOPE) vcpkg_execute_in_download_mode(
elseif(NOT rev_parse_head STREQUAL arg_REF) COMMAND "${GIT}" rev-parse FETCH_HEAD
message(FATAL_ERROR "REF (${arg_REF}) does not match FETCH_HEAD (${rev_parse_head}) OUTPUT_VARIABLE rev_parse_ref
[Expected : ( ${arg_REF} )]) ERROR_VARIABLE rev_parse_ref
[ Actual : ( ${rev_parse_head} )]" RESULT_VARIABLE error_code
WORKING_DIRECTORY "${git_working_directory}"
) )
if(error_code)
message(FATAL_ERROR "unable to determine FETCH_HEAD after fetching git repository")
endif()
string(STRIP "${rev_parse_ref}" rev_parse_ref)
set(VCPKG_HEAD_VERSION "${rev_parse_ref}" PARENT_SCOPE)
else()
vcpkg_execute_in_download_mode(
COMMAND "${GIT}" rev-parse "${arg_REF}"
OUTPUT_VARIABLE rev_parse_ref
ERROR_VARIABLE rev_parse_ref
RESULT_VARIABLE error_code
WORKING_DIRECTORY "${git_working_directory}"
)
if(error_code)
message(FATAL_ERROR "unable to rev-parse ${arg_REF} after fetching git repository")
endif()
string(STRIP "${rev_parse_ref}" rev_parse_ref)
if(NOT "${rev_parse_ref}" STREQUAL "${arg_REF}")
message(FATAL_ERROR "REF (${arg_REF}) does not match rev-parse'd reference (${rev_parse_ref})
[Expected : ( ${arg_REF} )])
[ Actual : ( ${rev_parse_ref} )]"
)
endif()
endif() endif()
file(MAKE_DIRECTORY "${DOWNLOADS}/temp") file(MAKE_DIRECTORY "${DOWNLOADS}/temp")
vcpkg_execute_required_process( vcpkg_execute_required_process(
ALLOW_IN_DOWNLOAD_MODE ALLOW_IN_DOWNLOAD_MODE
COMMAND "${GIT}" archive "${rev_parse_head}" -o "${temp_archive}" COMMAND "${GIT}" archive "${rev_parse_ref}" -o "${temp_archive}"
WORKING_DIRECTORY "${DOWNLOADS}/git-tmp" WORKING_DIRECTORY "${DOWNLOADS}/git-tmp"
LOGNAME git-archive LOGNAME git-archive
) )
@ -146,7 +178,7 @@ function(vcpkg_from_git)
REF "${sanitized_ref}" REF "${sanitized_ref}"
PATCHES ${arg_PATCHES} PATCHES ${arg_PATCHES}
NO_REMOVE_ONE_LEVEL NO_REMOVE_ONE_LEVEL
${working_directory_param} ${extract_working_directory_param}
) )
set("${arg_OUT_SOURCE_PATH}" "${SOURCE_PATH}" PARENT_SCOPE) set("${arg_OUT_SOURCE_PATH}" "${SOURCE_PATH}" PARENT_SCOPE)

View File

@ -29,6 +29,8 @@ foreach(_lang IN LISTS VCPKG_LANGUAGES)
list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_STANDARD) list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_STANDARD)
list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_COMPILE_FEATURES) list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_COMPILE_FEATURES)
list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_EXTENSION) list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_EXTENSION)
list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES)
# Probably never required since implicit. # Probably never required since implicit.
#list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES) #list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES)
#list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_INCLUDE_DIRECTORIES) #list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_INCLUDE_DIRECTORIES)

View File

@ -1,8 +1,64 @@
# rebuild: 1
cmake_minimum_required(VERSION 3.21) cmake_minimum_required(VERSION 3.21)
set(SCRIPTS "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Location to stored scripts") set(SCRIPTS "${CMAKE_CURRENT_LIST_DIR}" CACHE PATH "Location to stored scripts")
list(APPEND CMAKE_MODULE_PATH "${SCRIPTS}/cmake")
include("${SCRIPTS}/cmake/execute_process.cmake")
include("${SCRIPTS}/cmake/vcpkg_acquire_msys.cmake")
include("${SCRIPTS}/cmake/vcpkg_add_to_path.cmake")
include("${SCRIPTS}/cmake/vcpkg_apply_patches.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_cmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_make.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_msbuild.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_ninja.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_nmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_qmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_buildpath_length_warning.cmake")
include("${SCRIPTS}/cmake/vcpkg_check_features.cmake")
include("${SCRIPTS}/cmake/vcpkg_check_linkage.cmake")
include("${SCRIPTS}/cmake/vcpkg_clean_executables_in_bin.cmake")
include("${SCRIPTS}/cmake/vcpkg_clean_msbuild.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_cmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_gn.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_make.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_meson.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_qmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_copy_pdbs.cmake")
include("${SCRIPTS}/cmake/vcpkg_copy_tool_dependencies.cmake")
include("${SCRIPTS}/cmake/vcpkg_copy_tools.cmake")
include("${SCRIPTS}/cmake/vcpkg_download_distfile.cmake")
include("${SCRIPTS}/cmake/vcpkg_execute_build_process.cmake")
include("${SCRIPTS}/cmake/vcpkg_execute_required_process.cmake")
include("${SCRIPTS}/cmake/vcpkg_execute_required_process_repeat.cmake")
include("${SCRIPTS}/cmake/vcpkg_extract_source_archive.cmake")
include("${SCRIPTS}/cmake/vcpkg_extract_source_archive_ex.cmake")
include("${SCRIPTS}/cmake/vcpkg_fail_port_install.cmake")
include("${SCRIPTS}/cmake/vcpkg_find_acquire_program.cmake")
include("${SCRIPTS}/cmake/vcpkg_fixup_cmake_targets.cmake")
include("${SCRIPTS}/cmake/vcpkg_fixup_pkgconfig.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_bitbucket.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_git.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_github.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_gitlab.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_sourceforge.cmake")
include("${SCRIPTS}/cmake/vcpkg_get_program_files_platform_bitness.cmake")
include("${SCRIPTS}/cmake/vcpkg_get_windows_sdk.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_cmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_gn.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_make.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_meson.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_msbuild.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_nmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_qmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_list.cmake")
include("${SCRIPTS}/cmake/vcpkg_minimum_required.cmake")
include("${SCRIPTS}/cmake/vcpkg_replace_string.cmake")
include("${SCRIPTS}/cmake/vcpkg_test_cmake.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_apply_patches.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_forward_output_variable.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_function_arguments.cmake") include("${SCRIPTS}/cmake/z_vcpkg_function_arguments.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_get_cmake_vars.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_prettify_command_line.cmake")
function(debug_message) function(debug_message)
if(PORT_DEBUG) if(PORT_DEBUG)
@ -24,9 +80,7 @@ else()
set(Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL "WARNING") set(Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL "WARNING")
endif() endif()
list(APPEND CMAKE_MODULE_PATH "${SCRIPTS}/cmake") vcpkg_minimum_required(VERSION 2021-08-03)
include("${SCRIPTS}/cmake/vcpkg_minimum_required.cmake")
vcpkg_minimum_required(VERSION 2021-07-16)
file(TO_CMAKE_PATH "${BUILDTREES_DIR}" BUILDTREES_DIR) file(TO_CMAKE_PATH "${BUILDTREES_DIR}" BUILDTREES_DIR)
file(TO_CMAKE_PATH "${PACKAGES_DIR}" PACKAGES_DIR) file(TO_CMAKE_PATH "${PACKAGES_DIR}" PACKAGES_DIR)
@ -82,61 +136,6 @@ if(CMD MATCHES "^BUILD$")
set(TRIPLET_SYSTEM_ARCH "${VCPKG_TARGET_ARCHITECTURE}") set(TRIPLET_SYSTEM_ARCH "${VCPKG_TARGET_ARCHITECTURE}")
include("${SCRIPTS}/cmake/vcpkg_common_definitions.cmake") include("${SCRIPTS}/cmake/vcpkg_common_definitions.cmake")
include("${SCRIPTS}/cmake/execute_process.cmake")
include("${SCRIPTS}/cmake/vcpkg_acquire_msys.cmake")
include("${SCRIPTS}/cmake/vcpkg_add_to_path.cmake")
include("${SCRIPTS}/cmake/vcpkg_apply_patches.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_cmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_make.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_msbuild.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_ninja.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_nmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_build_qmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_buildpath_length_warning.cmake")
include("${SCRIPTS}/cmake/vcpkg_check_features.cmake")
include("${SCRIPTS}/cmake/vcpkg_check_linkage.cmake")
include("${SCRIPTS}/cmake/vcpkg_clean_executables_in_bin.cmake")
include("${SCRIPTS}/cmake/vcpkg_clean_msbuild.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_cmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_gn.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_make.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_meson.cmake")
include("${SCRIPTS}/cmake/vcpkg_configure_qmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_copy_pdbs.cmake")
include("${SCRIPTS}/cmake/vcpkg_copy_tool_dependencies.cmake")
include("${SCRIPTS}/cmake/vcpkg_copy_tools.cmake")
include("${SCRIPTS}/cmake/vcpkg_download_distfile.cmake")
include("${SCRIPTS}/cmake/vcpkg_execute_build_process.cmake")
include("${SCRIPTS}/cmake/vcpkg_execute_required_process.cmake")
include("${SCRIPTS}/cmake/vcpkg_execute_required_process_repeat.cmake")
include("${SCRIPTS}/cmake/vcpkg_extract_source_archive.cmake")
include("${SCRIPTS}/cmake/vcpkg_extract_source_archive_ex.cmake")
include("${SCRIPTS}/cmake/vcpkg_fail_port_install.cmake")
include("${SCRIPTS}/cmake/vcpkg_find_acquire_program.cmake")
include("${SCRIPTS}/cmake/vcpkg_fixup_cmake_targets.cmake")
include("${SCRIPTS}/cmake/vcpkg_fixup_pkgconfig.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_bitbucket.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_git.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_github.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_gitlab.cmake")
include("${SCRIPTS}/cmake/vcpkg_from_sourceforge.cmake")
include("${SCRIPTS}/cmake/vcpkg_get_program_files_platform_bitness.cmake")
include("${SCRIPTS}/cmake/vcpkg_get_windows_sdk.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_cmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_gn.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_make.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_meson.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_msbuild.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_nmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_install_qmake.cmake")
include("${SCRIPTS}/cmake/vcpkg_list.cmake")
include("${SCRIPTS}/cmake/vcpkg_replace_string.cmake")
include("${SCRIPTS}/cmake/vcpkg_test_cmake.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_apply_patches.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_forward_output_variable.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_get_cmake_vars.cmake")
include("${SCRIPTS}/cmake/z_vcpkg_prettify_command_line.cmake")
include("${CURRENT_PORT_DIR}/portfile.cmake") include("${CURRENT_PORT_DIR}/portfile.cmake")
if(DEFINED PORT) if(DEFINED PORT)
@ -169,13 +168,12 @@ elseif(CMD MATCHES "^CREATE$")
message(STATUS "Using pre-downloaded: ${NATIVE_DOWNLOAD_PATH}") message(STATUS "Using pre-downloaded: ${NATIVE_DOWNLOAD_PATH}")
message(STATUS "If this is not desired, delete the file and ${NATIVE_PORT_PATH}") message(STATUS "If this is not desired, delete the file and ${NATIVE_PORT_PATH}")
else() else()
include(vcpkg_download_distfile) message(STATUS "Downloading ${URL} -> ${FILENAME}...")
set(_VCPKG_INTERNAL_NO_HASH_CHECK ON) file(DOWNLOAD "${URL}" "${DOWNLOAD_PATH}" STATUS download_status)
vcpkg_download_distfile(ARCHIVE list(GET download_status 0 status_code)
URLS "${URL}" if(NOT "${download_status}" EQUAL "0")
FILENAME "${FILENAME}" message(FATAL_ERROR "Downloading ${URL}... Failed. Status: ${download_status}")
) endif()
set(_VCPKG_INTERNAL_NO_HASH_CHECK OFF)
endif() endif()
file(SHA512 "${DOWNLOAD_PATH}" SHA512) file(SHA512 "${DOWNLOAD_PATH}" SHA512)

View File

@ -6334,7 +6334,7 @@
}, },
"tinyfiledialogs": { "tinyfiledialogs": {
"baseline": "3.8.8", "baseline": "3.8.8",
"port-version": 1 "port-version": 2
}, },
"tinygltf": { "tinygltf": {
"baseline": "2020-07-28", "baseline": "2020-07-28",
@ -6617,8 +6617,8 @@
"port-version": 0 "port-version": 0
}, },
"vcpkg-cmake-config": { "vcpkg-cmake-config": {
"baseline": "2021-05-22", "baseline": "2021-08-11",
"port-version": 1 "port-version": 0
}, },
"vcpkg-gfortran": { "vcpkg-gfortran": {
"baseline": "3", "baseline": "3",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "abb5795ae7f012d210a4d98e4f072dea1b94c97a",
"version": "3.8.8",
"port-version": 2
},
{ {
"git-tree": "3959a47c7d93ca7db6e2022553b1d3427970cecf", "git-tree": "3959a47c7d93ca7db6e2022553b1d3427970cecf",
"version-semver": "3.8.8", "version-semver": "3.8.8",

View File

@ -1,5 +1,10 @@
{ {
"versions": [ "versions": [
{
"git-tree": "b3abb12ba8ab43770aea4e5a8d4915319bd295ee",
"version-date": "2021-08-11",
"port-version": 0
},
{ {
"git-tree": "330cc51bc99c6b71ed5fb51901f6f838684015a5", "git-tree": "330cc51bc99c6b71ed5fb51901f6f838684015a5",
"version-date": "2021-05-22", "version-date": "2021-05-22",