| > - vcpkg: dependencies that have custom patches only relevant for my software or where maintainers apply patches once every six months Yeah, this is a pain point; maintainers need to be more on-the-ball about updating and maintaining packages and package versioning. Maintainers for large Linux package repos (e.g. apt, yum, pacman) can do it, I don't see why vcpkg maintainers can't. > vcpkg: not sure how I can pass specific flags to dependencies. For instance I need to build LLVM with specific CMake flags. Use overlay ports[1] and edit the portfile.cmake to pass in additional variables[2]. If you want this to be really configurable every time, then use `VCPKG_ENV_PASSTHROUGH`[3] in a custom triplet[4]. This Stack Overflow answer[5] (full disclosure: I wrote it) explains why you have to do this. > I would like to be able to tell CMake "for this build, use source folder /foo for dependency "foo" Use `FetchContent_Declare` with `SOURCE_DIR`[6; this leads to `ExternalProject`, but everything you can use there you can also use with `FetchContent`]. e.g. FetchContent_Declare(fmt SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../thirdparty/fmt/")
FetchContent_MakeAvailable(fmt)
> How do you handle dependencies that takes ages to build.Link vcpkg's asset and binary caches to a network drive that all developer terminals can access straightforwardly. S3, Azure, GCP, GitHub, local/network filesystems are all supported[7][8]. [1]: https://learn.microsoft.com/en-gb/vcpkg/concepts/overlay-por... [2]: https://learn.microsoft.com/en-gb/vcpkg/get_started/get-star... [3]: https://learn.microsoft.com/en-gb/vcpkg/users/triplets#vcpkg... [4]: https://learn.microsoft.com/en-gb/vcpkg/concepts/triplets [5]: https://stackoverflow.com/a/77954891/1654223 [6]: https://cmake.org/cmake/help/latest/module/ExternalProject.h... [7]: https://learn.microsoft.com/en-gb/vcpkg/users/assetcaching [8]: https://learn.microsoft.com/en-gb/vcpkg/consume/binary-cachi... |
> Use `FetchContent_Declare` with `SOURCE_DIR`
I know about this but it doesn't solve my problem: I want people who develop to be able to point to the source dir elsewhere, but I want e.g. CI and people who just grab it from github to have it point to some commit in usual FetchContent fashion. And I don't want to have to pass CMake flags for each "co-developed" dependency, that would be a very bad developer experience too. Every cmake flag I add is another couple support tickets from junior developers mistyping it in my experience.
> a network drive that all developer terminals can access straightforwardly
Not viable for OSS projects developed in the wild