Skip to content

Commit a3891fc

Browse files
committed
fix: export path in vcpkg-cmake-wrapper with subdirectories
Signed-off-by: msclock <[email protected]>
1 parent c8a9870 commit a3891fc

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

ports/vcpkg-cmake-module/portfile.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if(NOT TARGET_TRIPLET STREQUAL _HOST_TRIPLET)
2-
message(WARNING "vcpkg-cmake-module is a host-only port; please mark it as a host port in your dependencies.")
2+
message(WARNING "${PORT} is a host-only port; please mark it as a host port in your dependencies.")
33
endif()
44

55
file(INSTALL

ports/vcpkg-cmake-module/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vcpkg-cmake-module",
33
"version-date": "2023-10-11",
4-
"port-version": 1,
4+
"port-version": 2,
55
"license": "MIT"
66
}

ports/vcpkg-cmake-module/vcpkg_cmake_module.cmake

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ function(vcpkg_cmake_module)
4747
endif()
4848

4949
if(arg_DIRECTORY_LIST)
50+
# Delete tail "/"
51+
if(arg_DIRECTORY_LIST MATCHES [[(/$)]])
52+
string(REGEX REPLACE [[(/$)]] "" arg_DIRECTORY_LIST ${arg_DIRECTORY_LIST})
53+
endif()
54+
5055
foreach(_dir "${arg_DIRECTORY_LIST}")
5156
if(NOT IS_DIRECTORY ${_dir})
5257
message(
@@ -68,15 +73,15 @@ function(vcpkg_cmake_module)
6873
LIST_DIRECTORIES ON
6974
RELATIVE "${_dir}"
7075
"${_dir}/*")
76+
7177
list(FILTER _dir_itmes EXCLUDE REGEX [[^\.]])
72-
message(STATUS ${_dir_itmes})
78+
7379
foreach(_item ${_dir_itmes})
7480
if(IS_DIRECTORY "${_dir}/${_item}")
7581
string(
7682
APPEND
7783
_export_in_vcpkg_cmake_wrapper
78-
"${_export_in_vcpkg_cmake_wrapper}list(APPEND CMAKE_PREFIX_PATH "
79-
"\${CMAKE_CURRENT_LIST_DIR}/${_modules_dir_path}/${_dir_name}/${_item})\n"
84+
"list(APPEND CMAKE_PREFIX_PATH \${CMAKE_CURRENT_LIST_DIR}/${_modules_path}/${_dir_name}/${_item})\n"
8085
)
8186
endif()
8287
endforeach()

versions/baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"vcpkg-cmake-module": {
88
"baseline": "2023-10-11",
9-
"port-version": 1
9+
"port-version": 2
1010
}
1111
}
1212
}

versions/v-/vcpkg-cmake-module.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
22
"versions": [
3+
{
4+
"version-date": "2023-10-11",
5+
"git-tree": "b070717c7a2a4af190f9be0622c30c578d8026ef",
6+
"port-version": 2
7+
},
38
{
49
"version-date": "2023-10-11",
510
"git-tree": "852db71c3ded39767390a021f35ff897a16671d9",

0 commit comments

Comments
 (0)