Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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-08-11",
"port-version": 1
Comment thread
JackBoosY marked this conversation as resolved.
Outdated
}
38 changes: 0 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 Down
38 changes: 0 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 Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6618,7 +6618,7 @@
},
"vcpkg-cmake-config": {
"baseline": "2021-08-11",
"port-version": 0
"port-version": 1
Comment thread
JackBoosY marked this conversation as resolved.
Comment on lines +6620 to +6621

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
5 changes: 5 additions & 0 deletions versions/v-/vcpkg-cmake-config.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d8d456b1bcb549dd05dbc3265e28b54b2d5e851a",
"version-date": "2021-08-11",
"port-version": 1
},
{
"git-tree": "b3abb12ba8ab43770aea4e5a8d4915319bd295ee",
"version-date": "2021-08-11",
Expand Down