From 1850fd3203f171dba93e7bbdeaf2853731c8f820 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Wed, 29 Sep 2021 19:51:04 -0700 Subject: [PATCH 01/11] [vcpkg-cmake-config] fix up cmake_current_packages_dir --- ports/vcpkg-cmake-config/vcpkg.json | 2 +- ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 2 +- versions/baseline.json | 2 +- versions/v-/vcpkg-cmake-config.json | 5 +++++ 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg.json b/ports/vcpkg-cmake-config/vcpkg.json index 749114aa4d2a2f..cec8835d9875a1 100644 --- a/ports/vcpkg-cmake-config/vcpkg.json +++ b/ports/vcpkg-cmake-config/vcpkg.json @@ -1,4 +1,4 @@ { "name": "vcpkg-cmake-config", - "version-date": "2021-09-27" + "version-date": "2021-09-29" } diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index 7a7a6c833b6829..854cf3054b5c93 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -216,7 +216,7 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] # Patch out any remaining absolute references file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" cmake_current_packages_dir) - string(REPLACE "${cmake_current_packages_dir}" [[${_IMPORT_PREFIX}]] contents "${contents}") + string(REPLACE "${cmake_current_packages_dir}" "\${CMAKE_CURRENT_LIST_DIR}/../.." contents "${contents}") file(WRITE "${main_cmake}" "${contents}") endforeach() diff --git a/versions/baseline.json b/versions/baseline.json index 8c4ebc40d12aa4..46dc0ebef6eebd 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6865,7 +6865,7 @@ "port-version": 0 }, "vcpkg-cmake-config": { - "baseline": "2021-09-27", + "baseline": "2021-09-29", "port-version": 0 }, "vcpkg-gfortran": { diff --git a/versions/v-/vcpkg-cmake-config.json b/versions/v-/vcpkg-cmake-config.json index cff03bb75dca0a..8ac57aff50246e 100644 --- a/versions/v-/vcpkg-cmake-config.json +++ b/versions/v-/vcpkg-cmake-config.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "6ef57ed7342c118f3be50c56a2233384c433591d", + "version-date": "2021-09-29", + "port-version": 0 + }, { "git-tree": "9ae99981abcd01b092344f85ef6e1de3c1f9856a", "version-date": "2021-09-27", From da9e981a8b14c1de960fff7cd84bb6c20febfa29 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Wed, 29 Sep 2021 20:35:32 -0700 Subject: [PATCH 02/11] Small changes --- ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 2 +- versions/v-/vcpkg-cmake-config.json | 2 +- 2 files 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 854cf3054b5c93..b3c3f4cb235be8 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -216,7 +216,7 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] # Patch out any remaining absolute references file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" cmake_current_packages_dir) - string(REPLACE "${cmake_current_packages_dir}" "\${CMAKE_CURRENT_LIST_DIR}/../.." contents "${contents}") + string(REPLACE "${cmake_current_packages_dir}" [[${CMAKE_CURRENT_LIST_DIR}/../..]] contents "${contents}") file(WRITE "${main_cmake}" "${contents}") endforeach() diff --git a/versions/v-/vcpkg-cmake-config.json b/versions/v-/vcpkg-cmake-config.json index 8ac57aff50246e..bd11173f5534e3 100644 --- a/versions/v-/vcpkg-cmake-config.json +++ b/versions/v-/vcpkg-cmake-config.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "6ef57ed7342c118f3be50c56a2233384c433591d", + "git-tree": "dbb5aa546f9d670f6fff6d063ccea8e958480f2c", "version-date": "2021-09-29", "port-version": 0 }, From 981066d770f9275bfe908556f70dbbe41f406b9a Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Mon, 18 Oct 2021 19:05:13 -0700 Subject: [PATCH 03/11] Address the review suggestion --- .../vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 10 +++++++++- versions/v-/vcpkg-cmake-config.json | 2 +- 2 files changed, 10 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 b3c3f4cb235be8..ce112beda0ee84 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -216,7 +216,15 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] # Patch out any remaining absolute references file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" cmake_current_packages_dir) - string(REPLACE "${cmake_current_packages_dir}" [[${CMAKE_CURRENT_LIST_DIR}/../..]] contents "${contents}") + if (contents MATCHES ".*${cmake_current_packages_dir}.*") + string(PREPEND contents +[[ +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +]] + ) + string(REPLACE "${cmake_current_packages_dir}" [[${_IMPORT_PREFIX}]] contents "${contents}") + endif() file(WRITE "${main_cmake}" "${contents}") endforeach() diff --git a/versions/v-/vcpkg-cmake-config.json b/versions/v-/vcpkg-cmake-config.json index bd11173f5534e3..6b5d6782ff3272 100644 --- a/versions/v-/vcpkg-cmake-config.json +++ b/versions/v-/vcpkg-cmake-config.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "dbb5aa546f9d670f6fff6d063ccea8e958480f2c", + "git-tree": "34d05637b537f2a7b665f767123c17823bc796aa", "version-date": "2021-09-29", "port-version": 0 }, From 32b14db542ee50fb581de96286ed4e186e45a913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jack=C2=B7Boos=C2=B7Yu?= <47264268+JackBoosY@users.noreply.github.com> Date: Tue, 19 Oct 2021 10:15:29 +0800 Subject: [PATCH 04/11] Update ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake --- 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 ce112beda0ee84..0fe2fe8fc3b2bc 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -223,7 +223,7 @@ get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}" PATH) get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) ]] ) - string(REPLACE "${cmake_current_packages_dir}" [[${_IMPORT_PREFIX}]] contents "${contents}") + string(REPLACE "${cmake_current_packages_dir}" [[${_IMPORT_PREFIX}]] contents "${contents}") endif() file(WRITE "${main_cmake}" "${contents}") From e8b7136d43e0e3340e6749737cf2c8a6af66eb0d Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Tue, 19 Oct 2021 19:11:57 -0700 Subject: [PATCH 05/11] Update the baseline version --- versions/v-/vcpkg-cmake-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake-config.json b/versions/v-/vcpkg-cmake-config.json index 6b5d6782ff3272..59248ccaa390eb 100644 --- a/versions/v-/vcpkg-cmake-config.json +++ b/versions/v-/vcpkg-cmake-config.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "34d05637b537f2a7b665f767123c17823bc796aa", + "git-tree": "8a029a9c4c967f29abe2f3dd13f8bc47a62b396f", "version-date": "2021-09-29", "port-version": 0 }, From dbac14188699c5f8c40eaceb8ae055bd6cf3ee6e Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Fri, 5 Nov 2021 02:38:19 -0700 Subject: [PATCH 06/11] Address the review suggestions --- ports/vcpkg-cmake-config/vcpkg.json | 2 +- ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 6 +++--- versions/baseline.json | 2 +- versions/v-/vcpkg-cmake-config.json | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg.json b/ports/vcpkg-cmake-config/vcpkg.json index cec8835d9875a1..f8cfd3a3178b3c 100644 --- a/ports/vcpkg-cmake-config/vcpkg.json +++ b/ports/vcpkg-cmake-config/vcpkg.json @@ -1,4 +1,4 @@ { "name": "vcpkg-cmake-config", - "version-date": "2021-09-29" + "version-date": "2021-11-05" } diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index 0fe2fe8fc3b2bc..12a329ac18b97c 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -219,11 +219,11 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] if (contents MATCHES ".*${cmake_current_packages_dir}.*") string(PREPEND contents [[ -get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}" PATH) -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PACKAGE_PREFIX "${CMAKE_CURRENT_LIST_DIR}" PATH) +get_filename_component(_IMPORT_PACKAGE_PREFIX "${_IMPORT_PACKAGE_PREFIX}" PATH) ]] ) - string(REPLACE "${cmake_current_packages_dir}" [[${_IMPORT_PREFIX}]] contents "${contents}") + string(REPLACE "${cmake_current_packages_dir}" [[${_IMPORT_PACKAGE_PREFIX}]] contents "${contents}") endif() file(WRITE "${main_cmake}" "${contents}") diff --git a/versions/baseline.json b/versions/baseline.json index 18bcb9bfb0cb04..fb50c61b485f72 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6993,7 +6993,7 @@ "port-version": 0 }, "vcpkg-cmake-config": { - "baseline": "2021-09-29", + "baseline": "2021-11-05", "port-version": 0 }, "vcpkg-gfortran": { diff --git a/versions/v-/vcpkg-cmake-config.json b/versions/v-/vcpkg-cmake-config.json index 59248ccaa390eb..450c30409bc873 100644 --- a/versions/v-/vcpkg-cmake-config.json +++ b/versions/v-/vcpkg-cmake-config.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "8a029a9c4c967f29abe2f3dd13f8bc47a62b396f", - "version-date": "2021-09-29", + "git-tree": "66d46c8862490290d423fbeb3ce97b8b5ab68242", + "version-date": "2021-11-05", "port-version": 0 }, { From a30d3967dcadc18ce8e5bedd35652d6141a5798d Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Thu, 18 Nov 2021 02:27:34 -0800 Subject: [PATCH 07/11] Address the review suggestions --- ports/vcpkg-cmake-config/vcpkg.json | 2 +- .../vcpkg_cmake_config_fixup.cmake | 16 ++++++++-------- versions/baseline.json | 2 +- versions/v-/vcpkg-cmake-config.json | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg.json b/ports/vcpkg-cmake-config/vcpkg.json index 4209e63d9aaa20..9d94e852e57f4d 100644 --- a/ports/vcpkg-cmake-config/vcpkg.json +++ b/ports/vcpkg-cmake-config/vcpkg.json @@ -1,4 +1,4 @@ { "name": "vcpkg-cmake-config", - "version-date": "2021-11-11" + "version-date": "2021-11-18" } diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index 0a53b4d79ab852..fa262fd4469770 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -212,18 +212,18 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] #and/or #\$<\$>:${CURRENT_INSTALLED_DIR}/lib/somelib> #with ${CURRENT_INSTALLED_DIR} being fully expanded - string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${_IMPORT_PREFIX}]] contents "${contents}") - - # Patch out any remaining absolute references + string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" cmake_current_packages_dir) - if (contents MATCHES ".*${cmake_current_packages_dir}.*") - string(PREPEND contents + string(REPLACE "${cmake_current_packages_dir}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") + + string(FIND "${contents}" [[${VCPKG_IMPORT_PREFIX}]] index) + if (NOT index STREQUAL "-1") + string(PREPEND contents [[ -get_filename_component(_IMPORT_PACKAGE_PREFIX "${CMAKE_CURRENT_LIST_DIR}" PATH) -get_filename_component(_IMPORT_PACKAGE_PREFIX "${_IMPORT_PACKAGE_PREFIX}" PATH) +get_filename_component(VCPKG_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}" PATH) +get_filename_component(VCPKG_IMPORT_PREFIX "${VCPKG_IMPORT_PREFIX}" PATH) ]] ) - string(REPLACE "${cmake_current_packages_dir}" [[${_IMPORT_PACKAGE_PREFIX}]] contents "${contents}") endif() file(WRITE "${main_cmake}" "${contents}") diff --git a/versions/baseline.json b/versions/baseline.json index 4dde05bf659378..57677b7d0260a2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7033,7 +7033,7 @@ "port-version": 0 }, "vcpkg-cmake-config": { - "baseline": "2021-11-11", + "baseline": "2021-11-18", "port-version": 0 }, "vcpkg-gfortran": { diff --git a/versions/v-/vcpkg-cmake-config.json b/versions/v-/vcpkg-cmake-config.json index bbe9ba79845941..5666e90fae431c 100644 --- a/versions/v-/vcpkg-cmake-config.json +++ b/versions/v-/vcpkg-cmake-config.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "2226996a3bbc9d61f4e0e7807b232a090077c32a", - "version-date": "2021-11-11", + "git-tree": "b698e2e765bba714b580c49027133343efaa96e8", + "version-date": "2021-11-18", "port-version": 0 }, { From 36790fb2fcf5c8c8bb891de6e0a06ef4b7f7fd6f Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Tue, 30 Nov 2021 22:42:49 -0800 Subject: [PATCH 08/11] fix up VCPKG_IMPORT_PREFIX if the file being modified at a deep subpath --- ports/vcpkg-cmake-config/vcpkg.json | 2 +- .../vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 11 ++++++----- versions/baseline.json | 2 +- versions/v-/vcpkg-cmake-config.json | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg.json b/ports/vcpkg-cmake-config/vcpkg.json index 9d94e852e57f4d..2106a395577487 100644 --- a/ports/vcpkg-cmake-config/vcpkg.json +++ b/ports/vcpkg-cmake-config/vcpkg.json @@ -1,4 +1,4 @@ { "name": "vcpkg-cmake-config", - "version-date": "2021-11-18" + "version-date": "2021-12-01" } diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index fa262fd4469770..a647c274a597bb 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -216,14 +216,15 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" cmake_current_packages_dir) string(REPLACE "${cmake_current_packages_dir}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") + get_filename_component(main_cmake_dir "${main_cmake}" DIRECTORY) + # Calculate relative to be a sequence of "../" + file(RELATIVE_PATH relative "${main_cmake_dir}" "${cmake_current_packages_dir}") + string(FIND "${contents}" [[${VCPKG_IMPORT_PREFIX}]] index) if (NOT index STREQUAL "-1") string(PREPEND contents -[[ -get_filename_component(VCPKG_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_DIR}" PATH) -get_filename_component(VCPKG_IMPORT_PREFIX "${VCPKG_IMPORT_PREFIX}" PATH) -]] - ) +"get_filename_component(VCPKG_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}\/${relative}\" ABSOLUTE) +get_filename_component(VCPKG_IMPORT_PREFIX \"\${VCPKG_IMPORT_PREFIX}\" PATH)") endif() file(WRITE "${main_cmake}" "${contents}") diff --git a/versions/baseline.json b/versions/baseline.json index b15ddeec823a7a..932400708d58b3 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7069,7 +7069,7 @@ "port-version": 0 }, "vcpkg-cmake-config": { - "baseline": "2021-11-18", + "baseline": "2021-12-01", "port-version": 0 }, "vcpkg-gfortran": { diff --git a/versions/v-/vcpkg-cmake-config.json b/versions/v-/vcpkg-cmake-config.json index 5666e90fae431c..539287d3695c24 100644 --- a/versions/v-/vcpkg-cmake-config.json +++ b/versions/v-/vcpkg-cmake-config.json @@ -1,8 +1,8 @@ { "versions": [ { - "git-tree": "b698e2e765bba714b580c49027133343efaa96e8", - "version-date": "2021-11-18", + "git-tree": "528312d90b7924f988c57200dc8528d0c8a896e0", + "version-date": "2021-12-01", "port-version": 0 }, { From d30bd435130d832e17f93c90272f078f623f2b23 Mon Sep 17 00:00:00 2001 From: PhoebeHui <20694052+PhoebeHui@users.noreply.github.com> Date: Wed, 1 Dec 2021 16:46:57 -0800 Subject: [PATCH 09/11] Fix regressions --- ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake | 4 +--- versions/v-/vcpkg-cmake-config.json | 2 +- 2 files changed, 2 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 a647c274a597bb..1e72466d60acfd 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -222,9 +222,7 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] string(FIND "${contents}" [[${VCPKG_IMPORT_PREFIX}]] index) if (NOT index STREQUAL "-1") - string(PREPEND contents -"get_filename_component(VCPKG_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}\/${relative}\" ABSOLUTE) -get_filename_component(VCPKG_IMPORT_PREFIX \"\${VCPKG_IMPORT_PREFIX}\" PATH)") + string(PREPEND contents "get_filename_component(VCPKG_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}\/${relative}\" ABSOLUTE)") endif() file(WRITE "${main_cmake}" "${contents}") diff --git a/versions/v-/vcpkg-cmake-config.json b/versions/v-/vcpkg-cmake-config.json index 539287d3695c24..37315f7bc0ce79 100644 --- a/versions/v-/vcpkg-cmake-config.json +++ b/versions/v-/vcpkg-cmake-config.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "528312d90b7924f988c57200dc8528d0c8a896e0", + "git-tree": "121e4c0087cf79386b2e23ffb2ee009995fea067", "version-date": "2021-12-01", "port-version": 0 }, From ad86850224e19a1a38bd0aa74476b62e89dd5371 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Mon, 6 Dec 2021 17:37:41 -0800 Subject: [PATCH 10/11] Remove out of date comments about multiconfig generators that are no longer relevant, fix spelling errors, and avoid calculating relative paths for the definition of VCPKG_IMPORT_PREFIX when not used. --- .../vcpkg_cmake_config_fixup.cmake | 27 ++++++------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake index 1e72466d60acfd..9563341ae268ca 100644 --- a/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake +++ b/ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake @@ -168,7 +168,7 @@ function(vcpkg_cmake_config_fixup) endforeach() endif() - #Fix ${_IMPORT_PREFIX} in cmake generated targets and configs; + #Fix ${_IMPORT_PREFIX} and absolute paths in cmake generated targets and configs; #Since those can be renamed we have to check in every *.cmake file(GLOB_RECURSE main_cmakes "${release_share}/*.cmake") @@ -201,28 +201,19 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] contents "${contents}") # This is a meson-related workaround, see https://github.com/mesonbuild/meson/issues/6955 endif() - #Fix wrongly absolute paths to install dir with the correct dir using ${_IMPORT_PREFIX} + #Fix absolute paths to installed dir with ones relative to ${CMAKE_CURRENT_LIST_DIR} #This happens if vcpkg built libraries are directly linked to a target instead of using - #an imported target for it. We could add more logic here to identify defect target files. - #Since the replacement here in a multi config build always requires a generator expression - #in front of the absoulte path to ${CURRENT_INSTALLED_DIR}. So the match should always be at - #least >:${CURRENT_INSTALLED_DIR}. - #In general the following generator expressions should be there: - #\$<\$:${CURRENT_INSTALLED_DIR}/debug/lib/somelib> - #and/or - #\$<\$>:${CURRENT_INSTALLED_DIR}/lib/somelib> - #with ${CURRENT_INSTALLED_DIR} being fully expanded + #an imported target. string(REPLACE "${CURRENT_INSTALLED_DIR}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") file(TO_CMAKE_PATH "${CURRENT_PACKAGES_DIR}" cmake_current_packages_dir) string(REPLACE "${cmake_current_packages_dir}" [[${VCPKG_IMPORT_PREFIX}]] contents "${contents}") - - get_filename_component(main_cmake_dir "${main_cmake}" DIRECTORY) - # Calculate relative to be a sequence of "../" - file(RELATIVE_PATH relative "${main_cmake_dir}" "${cmake_current_packages_dir}") - + # If ${VCPKG_IMPORT_PREFIX} was actually used, inject a definition of it: string(FIND "${contents}" [[${VCPKG_IMPORT_PREFIX}]] index) if (NOT index STREQUAL "-1") - string(PREPEND contents "get_filename_component(VCPKG_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}\/${relative}\" ABSOLUTE)") + get_filename_component(main_cmake_dir "${main_cmake}" DIRECTORY) + # Calculate relative to be a sequence of "../" + file(RELATIVE_PATH relative "${main_cmake_dir}" "${cmake_current_packages_dir}") + string(PREPEND contents "get_filename_component(VCPKG_IMPORT_PREFIX \"\${CMAKE_CURRENT_LIST_DIR}\/${relative}\" ABSOLUTE)") endif() file(WRITE "${main_cmake}" "${contents}") @@ -240,5 +231,3 @@ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)]] file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") endif() endfunction() - - From 83092db585ef7b7ae5f232f41c8597cfc5cef556 Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Mon, 6 Dec 2021 17:55:21 -0800 Subject: [PATCH 11/11] Fix version database. --- versions/v-/vcpkg-cmake-config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions/v-/vcpkg-cmake-config.json b/versions/v-/vcpkg-cmake-config.json index 37315f7bc0ce79..dda29410810e9c 100644 --- a/versions/v-/vcpkg-cmake-config.json +++ b/versions/v-/vcpkg-cmake-config.json @@ -1,7 +1,7 @@ { "versions": [ { - "git-tree": "121e4c0087cf79386b2e23ffb2ee009995fea067", + "git-tree": "51df1bbddb22782b9e7f23f9b3588674184e991a", "version-date": "2021-12-01", "port-version": 0 },