Skip to content

Commit 7df7533

Browse files
committed
perf: add more options to vcpkg-cmake-module
Signed-off-by: msclock <[email protected]>
1 parent 8bcf380 commit 7df7533

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

ports/vcpkg-cmake-module/vcpkg.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "vcpkg-cmake-module",
3-
"version-date": "2023-10-10",
3+
"version-date": "2023-10-11",
44
"license": "MIT"
55
}

ports/vcpkg-cmake-module/vcpkg_cmake_module.cmake

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ include_guard(GLOBAL)
33
function(vcpkg_cmake_module)
44
# Set options
55
set(_opt)
6-
set(_single_opt)
6+
set(_single_opt PACKAGE_NAME MODULE_PATH)
77
set(_multi_opt FILE_LIST DIRECTORY_LIST)
88
cmake_parse_arguments(PARSE_ARGV 0 "arg" "${_opt}" "${_single_opt}"
99
"${_multi_opt}")
@@ -20,7 +20,16 @@ function(vcpkg_cmake_module)
2020
FATAL_ERROR "Both arg_FILE_LIST and arg_DIRECTORY_LIST cannot be empty")
2121
endif()
2222

23-
set(_modules_path "_modules")
23+
if(NOT arg_PACKAGE_NAME)
24+
set(arg_PACKAGE_NAME "${PORT}")
25+
endif()
26+
27+
if(NOT arg_MODULE_PATH)
28+
set(arg_MODULE_PATH "${arg_PACKAGE_NAME}")
29+
endif()
30+
31+
set(_modules_dir_path "cmake")
32+
set(_modules_path "${_modules_dir_path}/${arg_MODULE_PATH}")
2433

2534
if(arg_FILE_LIST)
2635
foreach(_file ${arg_FILE_LIST})
@@ -39,9 +48,10 @@ function(vcpkg_cmake_module)
3948

4049
file(
4150
WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake
42-
"include_guard(GLOBAL)\n\nlist(APPEND CMAKE_MODULE_PATH \${CMAKE_CURRENT_LIST_DIR}/${_modules_path})\n"
51+
"include_guard(GLOBAL)\n\nlist(APPEND CMAKE_MODULE_PATH \${CMAKE_CURRENT_LIST_DIR}/${_modules_dir_path})\n"
4352
)
4453

54+
unset(_modules_dir_path)
4555
unset(_modules_path)
4656

4757
endfunction()

versions/baseline.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"port-version": 0
66
},
77
"vcpkg-cmake-module": {
8-
"baseline": "2023-10-10",
8+
"baseline": "2023-10-11",
99
"port-version": 0
1010
}
1111
}

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": "142c34e22ecfeb0ab76e55fcb196f67e2bbebe25",
6+
"port-version": 0
7+
},
38
{
49
"version-date": "2023-10-10",
510
"git-tree": "5eb5bf9667874adcdf3c454039ac5d693ca314d4",

0 commit comments

Comments
 (0)