Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg-cmake-config] add missing TOOLS_PATH #22863

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Additionally corrects common issues with targets, such as absolute paths and inc
vcpkg_cmake_config_fixup(
[PACKAGE_NAME <name>]
[CONFIG_PATH <config-directory>]
[TOOLS_PATH <tools/${PORT}>]
[DO_NOT_DELETE_PARENT_CONFIG_PATH]
[NO_PREFIX_CORRECTION]
)
Expand All @@ -36,8 +37,8 @@ and applies a rather simply correction which in some cases will yield the wrong

1. Moves `/debug/<CONFIG_PATH>/*targets-debug.cmake` to `/share/${PACKAGE_NAME}`.
2. Removes `/debug/<CONFIG_PATH>/*config.cmake`.
3. Transform all references matching `/bin/*.exe` to `/tools/<port>/*.exe` on Windows.
4. Transform all references matching `/bin/*` to `/tools/<port>/*` on other platforms.
3. Transform all references matching `/bin/*.exe` to `/${TOOLS_PATH}/*.exe` on Windows.
4. Transform all references matching `/bin/*` to `/${TOOLS_PATH}/*` on other platforms.
5. Fixes `${_IMPORT_PREFIX}` in auto generated targets.
6. Replace `${CURRENT_INSTALLED_DIR}` with `${_IMPORT_PREFIX}` in configs and targets.

Expand Down
2 changes: 1 addition & 1 deletion ports/vcpkg-cmake-config/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "vcpkg-cmake-config",
"version-date": "2021-12-28"
"version-date": "2022-01-30"
}
14 changes: 9 additions & 5 deletions ports/vcpkg-cmake-config/vcpkg_cmake_config_fixup.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Additionally corrects common issues with targets, such as absolute paths and inc
vcpkg_cmake_config_fixup(
[PACKAGE_NAME <name>]
[CONFIG_PATH <config-directory>]
[TOOLS_PATH <tools/${PORT}>]
[DO_NOT_DELETE_PARENT_CONFIG_PATH]
[NO_PREFIX_CORRECTION]
)
Expand All @@ -35,8 +36,8 @@ and applies a rather simply correction which in some cases will yield the wrong

1. Moves `/debug/<CONFIG_PATH>/*targets-debug.cmake` to `/share/${PACKAGE_NAME}`.
2. Removes `/debug/<CONFIG_PATH>/*config.cmake`.
3. Transform all references matching `/bin/*.exe` to `/tools/<port>/*.exe` on Windows.
4. Transform all references matching `/bin/*` to `/tools/<port>/*` on other platforms.
3. Transform all references matching `/bin/*.exe` to `/${TOOLS_PATH}/*.exe` on Windows.
4. Transform all references matching `/bin/*` to `/${TOOLS_PATH}/*` on other platforms.
5. Fixes `${_IMPORT_PREFIX}` in auto generated targets.
6. Replace `${CURRENT_INSTALLED_DIR}` with `${_IMPORT_PREFIX}` in configs and targets.

Expand All @@ -52,7 +53,7 @@ endif()
set(Z_VCPKG_CMAKE_CONFIG_FIXUP_GUARD ON CACHE INTERNAL "guard variable")

function(vcpkg_cmake_config_fixup)
cmake_parse_arguments(PARSE_ARGV 0 "arg" "DO_NOT_DELETE_PARENT_CONFIG_PATH;NO_PREFIX_CORRECTION" "PACKAGE_NAME;CONFIG_PATH" "")
cmake_parse_arguments(PARSE_ARGV 0 "arg" "DO_NOT_DELETE_PARENT_CONFIG_PATH;NO_PREFIX_CORRECTION" "PACKAGE_NAME;CONFIG_PATH;TOOLS_PATH" "")

if(DEFINED arg_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "vcpkg_cmake_config_fixup was passed extra arguments: ${arg_UNPARSED_ARGUMENTS}")
Expand All @@ -63,6 +64,9 @@ function(vcpkg_cmake_config_fixup)
if(NOT arg_CONFIG_PATH)
set(arg_CONFIG_PATH "share/${arg_PACKAGE_NAME}")
endif()
if(NOT arg_TOOLS_PATH)
Copy link
Contributor

Choose a reason for hiding this comment

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

hrmm, this should be if(NOT DEFINED arg_TOOLS_PATH), but I won't ask you to change this for now.

set(arg_TOOLS_PATH "tools/${PORT}")
endif()
set(target_path "share/${arg_PACKAGE_NAME}")

string(REPLACE "." "\\." EXECUTABLE_SUFFIX "${VCPKG_TARGET_EXECUTABLE_SUFFIX}")
Expand Down Expand Up @@ -146,7 +150,7 @@ function(vcpkg_cmake_config_fixup)
foreach(release_target IN LISTS release_targets)
file(READ "${release_target}" contents)
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" contents "${contents}")
string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" contents "${contents}")
string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \"]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" contents "${contents}")
file(WRITE "${release_target}" "${contents}")
endforeach()

Expand All @@ -159,7 +163,7 @@ function(vcpkg_cmake_config_fixup)

file(READ "${debug_target}" contents)
string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${_IMPORT_PREFIX}" contents "${contents}")
string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \";]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/tools/${PORT}/\\1" contents "${contents}")
string(REGEX REPLACE "\\\${_IMPORT_PREFIX}/bin/([^ \";]+${EXECUTABLE_SUFFIX})" "\${_IMPORT_PREFIX}/${arg_TOOLS_PATH}/\\1" contents "${contents}")
string(REPLACE "\${_IMPORT_PREFIX}/lib" "\${_IMPORT_PREFIX}/debug/lib" contents "${contents}")
string(REPLACE "\${_IMPORT_PREFIX}/bin" "\${_IMPORT_PREFIX}/debug/bin" contents "${contents}")
file(WRITE "${release_share}/${debug_target_rel}" "${contents}")
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -7169,7 +7169,7 @@
"port-version": 0
},
"vcpkg-cmake-config": {
"baseline": "2021-12-28",
"baseline": "2022-01-30",
"port-version": 0
},
"vcpkg-gfortran": {
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": "fea8f92ffa5e14c7111fe526f8cc93ecd8f9dbf0",
"version-date": "2022-01-30",
"port-version": 0
},
{
"git-tree": "e33152002c946b93a0262931ba8bf54a2e6ab9ad",
"version-date": "2021-12-28",
Expand Down