Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ports/vcpkg-cmake-config/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"name": "vcpkg-cmake-config",
"version-date": "2021-08-11"
"version-date": "2021-05-22",
"port-version": 1
}
40 changes: 2 additions & 38 deletions ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -221,44 +221,6 @@ 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 @@ -271,3 +233,5 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]]
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
endif()
endfunction()


40 changes: 2 additions & 38 deletions scripts/cmake/vcpkg_fixup_cmake_targets.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -220,44 +220,6 @@ function(vcpkg_fixup_cmake_targets)
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(NOT REMAINING_FILES)
Expand All @@ -279,3 +241,5 @@ function(vcpkg_fixup_cmake_targets)
file(WRITE ${CMAKE_FILE} "${_contents}")
endforeach()
endfunction()


4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6617,8 +6617,8 @@
"port-version": 0
},
"vcpkg-cmake-config": {
"baseline": "2021-08-11",
"port-version": 0
"baseline": "2021-05-22",
"port-version": 1
Comment on lines +6620 to +6621
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@strega-nil-ms We couldn't do that because the version shoud only be added, not be reverted.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that it's fine, but would like confirmation from @ras0219-msft

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may look fine now, but with the next change, we will have two variants of port version 2...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cut the "port version 2", it is different "version-date". It is really easy to start confusion ;-)

},
"vcpkg-gfortran": {
"baseline": "3",
Expand Down
10 changes: 5 additions & 5 deletions versions/v-/vcpkg-cmake-config.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"versions": [
{
"git-tree": "b3abb12ba8ab43770aea4e5a8d4915319bd295ee",
"version-date": "2021-08-11",
"port-version": 0
},
{
"git-tree": "330cc51bc99c6b71ed5fb51901f6f838684015a5",
"version-date": "2021-05-22",
"port-version": 1
},
{
"git-tree": "b3abb12ba8ab43770aea4e5a8d4915319bd295ee",
"version-date": "2021-08-11",
"port-version": 0
},
{
"git-tree": "2d4f997a32b8e8bfe98d12beb2bfe6be713c7086",
"version-date": "2021-05-22",
Expand Down