From 73714eb010f599edd756e3b45ce4d00345a7fd44 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 16 May 2021 11:54:00 +0200 Subject: [PATCH 1/9] Fix exported osx framework config --- .../vcpkg_cmake_config_fixup.cmake | 41 +++++++++---------- scripts/get_cmake_vars/CMakeLists.txt | 2 +- 2 files changed, 20 insertions(+), 23 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index 457fd8b09f57d1..82c5d1afe9a5c8 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -229,29 +229,26 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] endif() foreach(targets_file IN LISTS targets_files) file(READ "${targets_file}" targets_content) - string(REGEX MATCHALL "INTERFACE_LINK_LIBRARIES[^\n]*" library_contents "${targets_content}") - string(REGEX REPLACE - [[/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/[^/]+/System/Library/Frameworks/([_a-zA-Z]+)\.framework]] - [[-framework \1]] - fixed_contents - "${library_contents}" - ) - string(REGEX REPLACE - [[/Library/Developer/CommandLineTools/SDKs/[^/]+/System/Library/Frameworks/([_a-zA-Z]+)\.framework]] - [[-framework \1]] - fixed_contents - "${fixed_contents}" - ) - if (fixed_contents AND NOT fixed_contents STREQUAL library_contents) - string(REGEX REPLACE - "${library_contents}" - "${fixed_contents}" - targets_content - "${targets_content}" - ) - endif() - + foreach(line IN LISTS library_contents) + set(fixed_line "${line}") + string(REGEX MATCHALL [[/[^ ]+/[^ ;/]+\.framework]] frameworks "${line}") + foreach(framework IN LISTS frameworks) + if(NOT DEFINED VCKPG_DETECTED_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES) + set(framework_info_file "${CURRENT_BUILDTREES_DIR}/framework-info-${TARGET_TRIPLET_FILE}.cmake") + vcpkg_internal_get_cmake_vars(OUTPUT_FILE "${framework_info_file}") + include("${framework_info_file}") + endif() + string(REGEX MATCH [[^([^ ]+)/([^;/]+)\.framework$]] "${framework}") + set(path "${CMAKE_MATCH_1}") + set(name "${CMAKE_MATCH_2}") + list(find VCKPG_DETECTED_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() diff --git a/scripts/get_cmake_vars/CMakeLists.txt b/scripts/get_cmake_vars/CMakeLists.txt index 6be594787392e4..c7191c5eb5bede 100644 --- a/scripts/get_cmake_vars/CMakeLists.txt +++ b/scripts/get_cmake_vars/CMakeLists.txt @@ -30,7 +30,7 @@ foreach(_lang IN LISTS VCPKG_LANGUAGES) list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_COMPILE_FEATURES) list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_EXTENSION) # 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_LINK_DIRECTORIES) #list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_LINK_LIBRARIES) From 3ffe3d1d6481a7d0c33873b084d8dd2c586faab9 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 16 May 2021 14:06:16 +0200 Subject: [PATCH 2/9] Revise patterns --- ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index 82c5d1afe9a5c8..935e094848e057 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -232,14 +232,14 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] string(REGEX MATCHALL "INTERFACE_LINK_LIBRARIES[^\n]*" library_contents "${targets_content}") foreach(line IN LISTS library_contents) set(fixed_line "${line}") - string(REGEX MATCHALL [[/[^ ]+/[^ ;/]+\.framework]] frameworks "${line}") + string(REGEX MATCHALL [[/[^ ;"]+/[^ ;"/]+\.framework]] frameworks "${line}") foreach(framework IN LISTS frameworks) if(NOT DEFINED VCKPG_DETECTED_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES) set(framework_info_file "${CURRENT_BUILDTREES_DIR}/framework-info-${TARGET_TRIPLET_FILE}.cmake") vcpkg_internal_get_cmake_vars(OUTPUT_FILE "${framework_info_file}") include("${framework_info_file}") endif() - string(REGEX MATCH [[^([^ ]+)/([^;/]+)\.framework$]] "${framework}") + string(REGEX MATCH [[^(.+)/(.+)\.framework$]] "${framework}") set(path "${CMAKE_MATCH_1}") set(name "${CMAKE_MATCH_2}") list(find VCKPG_DETECTED_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${path}" index) From 1d85d58bd76a7e222a6193f31b90e74fd9b8bb07 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sun, 16 May 2021 14:09:48 +0200 Subject: [PATCH 3/9] Match line from keyword to newline --- ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index 935e094848e057..b808d336f3626a 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -229,7 +229,7 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] endif() foreach(targets_file IN LISTS targets_files) file(READ "${targets_file}" targets_content) - string(REGEX MATCHALL "INTERFACE_LINK_LIBRARIES[^\n]*" library_contents "${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}") From da963a435e5050b26bd508af6ef1d0aeb73c03d0 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 19 May 2021 09:35:44 +0200 Subject: [PATCH 4/9] Fix usage of vcpkg_internal_get_cmake_vars --- .../vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index b808d336f3626a..eac628a522f11e 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -234,15 +234,16 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] set(fixed_line "${line}") string(REGEX MATCHALL [[/[^ ;"]+/[^ ;"/]+\.framework]] frameworks "${line}") foreach(framework IN LISTS frameworks) - if(NOT DEFINED VCKPG_DETECTED_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES) - set(framework_info_file "${CURRENT_BUILDTREES_DIR}/framework-info-${TARGET_TRIPLET_FILE}.cmake") - vcpkg_internal_get_cmake_vars(OUTPUT_FILE "${framework_info_file}") - include("${framework_info_file}") + if(NOT DEFINED VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES) + vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) + debug_message("Including cmake vars from: ${_VCPKG_CMAKE_VARS_FILE}") + include("${_VCPKG_CMAKE_VARS_FILE}") + set(VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}" PARENT_SCOPE) endif() string(REGEX MATCH [[^(.+)/(.+)\.framework$]] "${framework}") set(path "${CMAKE_MATCH_1}") set(name "${CMAKE_MATCH_2}") - list(find VCKPG_DETECTED_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${path}" index) + 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() From 6f629add3c2bfb5a248e55ceaa6bcaaa6888a0ee Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 19 May 2021 10:04:37 +0200 Subject: [PATCH 5/9] Fix pattern matching --- .../vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index eac628a522f11e..4c512353c1d3e5 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -234,16 +234,18 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] 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) vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) debug_message("Including cmake vars from: ${_VCPKG_CMAKE_VARS_FILE}") include("${_VCPKG_CMAKE_VARS_FILE}") set(VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}" PARENT_SCOPE) endif() - string(REGEX MATCH [[^(.+)/(.+)\.framework$]] "${framework}") - set(path "${CMAKE_MATCH_1}") - set(name "${CMAKE_MATCH_2}") - list(find VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${path}" index) + 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() From f112ecf1fe6c4b887add045ec253d01de9207d08 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 19 May 2021 10:08:13 +0200 Subject: [PATCH 6/9] Copy changes to vcpkg_fixup_cmake_targets.cmake --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 49d580ac4e4f5e..e451e6c05bd824 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -229,28 +229,29 @@ function(vcpkg_fixup_cmake_targets) endif() foreach(targets_file IN LISTS targets_files) file(READ "${targets_file}" targets_content) - - string(REGEX MATCHALL "INTERFACE_LINK_LIBRARIES[^\n]*" library_contents "${targets_content}") - string(REGEX REPLACE - [[/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/[^/]+/System/Library/Frameworks/([_a-zA-Z]+)\.framework]] - [[-framework \1]] - fixed_contents - "${library_contents}" - ) - string(REGEX REPLACE - [[/Library/Developer/CommandLineTools/SDKs/[^/]+/System/Library/Frameworks/([_a-zA-Z]+)\.framework]] - [[-framework \1]] - fixed_contents - "${fixed_contents}" - ) - if (fixed_contents AND NOT fixed_contents STREQUAL library_contents) - string(REGEX REPLACE - "${library_contents}" - "${fixed_contents}" - targets_content - "${targets_content}" - ) - endif() + 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) + vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) + debug_message("Including cmake vars from: ${_VCPKG_CMAKE_VARS_FILE}") + include("${_VCPKG_CMAKE_VARS_FILE}") + set(VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}" PARENT_SCOPE) + 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() From d77688e5401b816f1a81f9d5cf2c7eb0b050674e Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 19 May 2021 10:34:03 +0200 Subject: [PATCH 7/9] Use separate build dir for getting cmake vars --- ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 3 +++ scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index 4c512353c1d3e5..7a9b94daaf631c 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -240,10 +240,13 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] 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") vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) debug_message("Including cmake vars from: ${_VCPKG_CMAKE_VARS_FILE}") include("${_VCPKG_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) diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index e451e6c05bd824..50be02ca4f32d7 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -240,10 +240,13 @@ function(vcpkg_fixup_cmake_targets) 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") vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) debug_message("Including cmake vars from: ${_VCPKG_CMAKE_VARS_FILE}") include("${_VCPKG_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) From 17ab5e60f57d9e6a8bd503498941e91633dcd381 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 19 May 2021 18:49:41 +0200 Subject: [PATCH 8/9] Use pristine get_cmake_vars --- ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 9 ++++++++- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 9 ++++++++- scripts/get_cmake_vars/CMakeLists.txt | 2 +- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index 7a9b94daaf631c..052d21f8279e02 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -242,7 +242,14 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] 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") - vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) + vcpkg_internal_get_cmake_vars( + OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE + OPTIONS + -DVCPKG_LANGUAGES=CXX + -DVCPKG_VARS_TO_CHECK=CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + -DVCPKG_FLAGS_TO_CHECK= + -DVCPKG_ENV_VARS_TO_CHECK= + ) debug_message("Including cmake vars from: ${_VCPKG_CMAKE_VARS_FILE}") include("${_VCPKG_CMAKE_VARS_FILE}") set(VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}" PARENT_SCOPE) diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index 50be02ca4f32d7..de2397106514e4 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -242,7 +242,14 @@ function(vcpkg_fixup_cmake_targets) 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") - vcpkg_internal_get_cmake_vars(OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE) + vcpkg_internal_get_cmake_vars( + OUTPUT_FILE _VCPKG_CMAKE_VARS_FILE + OPTIONS + -DVCPKG_LANGUAGES=CXX + -DVCPKG_VARS_TO_CHECK=CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES + -DVCPKG_FLAGS_TO_CHECK= + -DVCPKG_ENV_VARS_TO_CHECK= + ) debug_message("Including cmake vars from: ${_VCPKG_CMAKE_VARS_FILE}") include("${_VCPKG_CMAKE_VARS_FILE}") set(VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${VCPKG_DETECTED_CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES}" PARENT_SCOPE) diff --git a/scripts/get_cmake_vars/CMakeLists.txt b/scripts/get_cmake_vars/CMakeLists.txt index c7191c5eb5bede..6be594787392e4 100644 --- a/scripts/get_cmake_vars/CMakeLists.txt +++ b/scripts/get_cmake_vars/CMakeLists.txt @@ -30,7 +30,7 @@ foreach(_lang IN LISTS VCPKG_LANGUAGES) list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_COMPILE_FEATURES) list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_EXTENSION) # 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_LINK_DIRECTORIES) #list(APPEND VCPKG_DEFAULT_VARS_TO_CHECK CMAKE_${_lang}_IMPLICIT_LINK_LIBRARIES) From d71129e1cd41abec0cb6b1d220e8a6485f4686ce Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Sat, 29 May 2021 16:48:02 +0200 Subject: [PATCH 9/9] Fix variable name --- scripts/cmake/vcpkg_fixup_cmake_targets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake index de2397106514e4..e0674b8e585f48 100644 --- a/scripts/cmake/vcpkg_fixup_cmake_targets.cmake +++ b/scripts/cmake/vcpkg_fixup_cmake_targets.cmake @@ -225,7 +225,7 @@ function(vcpkg_fixup_cmake_targets) # 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") + file(GLOB targets_files "${RELEASE_SHARE}/*[Cc]onfig.cmake") endif() foreach(targets_file IN LISTS targets_files) file(READ "${targets_file}" targets_content)