take dependencies from locally cloned repo #25822
|
Hello, I have a few repos, where each provides some functionality (assume that each repo provides some standalone library). For simplicity, I have repo A and repo B. And these repos has next relation: Repo A uses library provided by repo B. Then my repo A has a vcpkg-configuration.json that "points" to that custom registry, and the vcpkg.json that has a lists dependencies of A. Now the problem.
So... I'm looking for a way to simplify that process a bit. For dev-testing.
I've tried to use builtin registry within A's vcpkg-configuration.json and specifying the VCPKG_OVERLAY_PORTS to the /some/folder/within/my_os but it complains that local repo B desn't have portfile.cmake file, which is logical as this should not be a part of the B's repo. |
Replies: 3 comments 2 replies
|
The simply way is: directly extract repo B's package or just copy it instead of use |
|
The clean way is an overlay port + filesystem registry pointing at your local checkout. In your A repo's |
|
Adding to Mukunda Rao Katta (@MukundaKatta): for local iteration you usually do not need a second filesystem registry. An overlay port is enough. For example, in repo A you can create:
{
"name": "repo-b",
"version-string": "local",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
if(NOT DEFINED ENV{REPO_B_PATH})
message(FATAL_ERROR "Please set REPO_B_PATH to your local repo-b checkout")
endif()
set(SOURCE_PATH "$ENV{REPO_B_PATH}")
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
)
vcpkg_cmake_install()
# Only needed if repo-b installs CMake package config files.
vcpkg_cmake_config_fixup()Then reference the overlay in repo A's {
"overlay-ports": [
"./overlays"
],
"registries": [
// your existing registry config
]
}Or pass it on the command line: vcpkg install --overlay-ports=./overlaysOverlay ports take precedence over registry ports when resolving package names, so When you are done testing the local changes, remove the overlay entry or unset |
Adding to Mukunda Rao Katta (@MukundaKatta): for local iteration you usually do not need a second filesystem registry. An overlay port is enough.
For example, in repo A you can create:
overlays/repo-b/vcpkg.json:{ "name": "repo-b", "version-string": "local", "dependencies": [ { "name": "vcpkg-cmake", "host": true }, { "name": "vcpkg-cmake-config", "host": true } ] }overlays/repo-b/portfile.cmake: