Skip to content

Commit

Permalink
[rollup:2021-08-09] Rollup PR (#19469)
Browse files Browse the repository at this point in the history
* [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>
  • Loading branch information
4 people committed Aug 16, 2021
1 parent 6bc4362 commit 99e06a6
Show file tree
Hide file tree
Showing 16 changed files with 594 additions and 423 deletions.
12 changes: 11 additions & 1 deletion docs/maintainers/vcpkg_find_fortran.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@ Windows(x86/x64) Only: If not it will switch/enable MinGW gfortran

## Usage
```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
Expand Down
5 changes: 5 additions & 0 deletions docs/maintainers/vcpkg_from_git.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ The url of the git repository.
### REF
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
The git branch to use when the package is requested to be built from the latest sources.

Expand Down
11 changes: 6 additions & 5 deletions ports/tinyfiledialogs/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ vcpkg_fail_port_install(ON_TARGET "uwp")

vcpkg_check_linkage(ONLY_STATIC_LIBRARY)

vcpkg_from_sourceforge(
vcpkg_from_git(
OUT_SOURCE_PATH SOURCE_PATH
REPO tinyfiledialogs
SHA512 d63d6dd847d6bbd1f252c8fbd228086381af7189ac71afc97bd57e06badd1d3f4d90c6aab6207191ae7253d5a71fc44636cf8e33714089d5b478dd2714f59376
FILENAME "tinyfiledialogs-current.zip"
FETCH_REF master
HEAD_REF master
URL https://git.code.sf.net/p/tinyfiledialogs/code
REF e11f94cd7887b101d64f74892d769f0139b5e166
)

file(COPY "${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt" DESTINATION "${SOURCE_PATH}")
Expand All @@ -26,6 +27,6 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(READ "${CURRENT_PACKAGES_DIR}/include/tinyfiledialogs/tinyfiledialogs.h" _contents)
# reads between the line "- License -" and a closing "*/"
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()
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "${CMAKE_MATCH_1}")
4 changes: 2 additions & 2 deletions ports/tinyfiledialogs/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tinyfiledialogs",
"version-semver": "3.8.8",
"port-version": 1,
"version": "3.8.8",
"port-version": 2,
"description": "Highly portable and cross-platform dialogs for native inputbox, passwordbox, colorpicker and more",
"homepage": "https://sourceforge.net/projects/tinyfiledialogs/",
"supports": "!uwp",
Expand Down
3 changes: 1 addition & 2 deletions ports/vcpkg-cmake-config/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"name": "vcpkg-cmake-config",
"version-date": "2021-05-22",
"port-version": 1
"version-date": "2021-08-11"
}
40 changes: 38 additions & 2 deletions ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,44 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]]
file(WRITE "${main_cmake}" "${contents}")
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.
file(GLOB_RECURSE remaining_files "${debug_share}/*")
if(remaining_files STREQUAL "")
Expand All @@ -233,5 +271,3 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]]
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
endif()
endfunction()


0 comments on commit 99e06a6

Please sign in to comment.