Repository navigation
How do I use nested vcpkg manifests in submodules/sub-projects? #18122
Replies: 12 comments 15 replies
|
Hi Michael Price (@mikepricedev) Thanks for posting this issue. You might forget to add Could you please refer to the usage of |
|
Please let me know if the above suggestion can work for you. |
|
NancyLi1013 In my case, Frozen is a dep of the It is only when the I also noticed something else particular. The |
|
Michael Price (@mikepricedev), does this still be a question for you? From manifests.md, when invoked from any subdirectory of the directory containing vcpkg.json, vcpkg install with no package arguments will install all manifest dependencies into /vcpkg_installed/. |
|
I'm running into this problem too.. But I'm relying on visual studio 2019 cmake support to use vcpkg. It seems to be ignoring the sub directory/sub directory. Is there support for add_subdirectory and sub directories with their own vcpkg.json? (And just using the main project without opening separate visual studio 2019 instances with their own cmakelists.txt). |
|
Dennis Fehr (@cyraid) there is currently no support for having multiple top level manifests. We have considered some ways to solve this, but none of them very good. If you're interested in solving this issue, please open a discussion topic about it. Otherwise, writing a top-level vcpkg.json that contains all of the dependencies your subdirectories need, or alternatively using vcpkg to manage these dependencies as well, are the two solutions we see right now. |
|
Hi nicole mazzuca (@strega-nil) ! Thank you for the reply! Where would you guys like to discuss this? I mean, I don't have much time to talk about it but my quick input would be to add a ADD_TARGET_VCPKG in the sub directory inside that CMakeLists.txt. So, ADD_LIBRARY(MyPlugin), and then ADD_TARGET_VCPKG(MyPlugin). This way you could add the appropriate includes and properties etc. for that target. This would of course also call vcpkg in that directory too, but perhaps with the same cache directory and out from CMakeSettings.json? |
|
Dennis Fehr (@cyraid) https://github.com/microsoft/vcpkg/discussions |
|
We'd also like to have nested We have many projects in a small monorepo. Some of the projects require some larger dependencies (OpenCV, Qt), while some only requires header only libraries. The projects can be added/excluded from the solution by CMake option toggles. It would be nice to only acquire/build, say Qt and OpenCV, if the projects that uses those dependencies are being configured and built. |
|
Vcpkg doesn't support separate |
|
CMakePresets.json uses an include section to solve this issue. Could that be an option to solve the issue for vcpkg.json too ? |
|
Why does vcpkg need to use a singular manifest-file before the very first use of project? Cause right now we either have to maintain one giant manifest that hopefully has no conflicts and does not go stale (app A and app B need lib C => added to manifest. A nolonger needs C => stays in manifest cause B, B no longer needs it but C stays cause of A), or have a hacky script that combines all manifests before the very first call to project. Either working recursive or a way to call it for the current file/directory would help a lot. |
Uh oh!
There was an error while loading. Please reload this page.
In the above folder structure the "sub_project" submodule uses vcpkg and a vcpkg.json manifest to manage its deps. The root project also uses vcpkg and a vcpkg.json manifest to manage deps.
However, when the project is configured the sub_project's CMakeLists.txt vcpkg wiring no longer finds packages installed in
sub_project/vcpkg_installeddir.Steps taken:
vcpkg installran insub_projectdir.vcpkg_installeddir was created as expected.find_packagein submodule cmake. (in my case using the frozen lib)'frozen/map.h' file not found #include <frozen/map.h>not an issue in sub_project standalone.Note: using vcpkg as a submodule technique in both i.e.
All reactions