3 ms·
Oh okay - I think in that case it's possible Hunter would solve your problems. If you rewrite your library to use Hunter, then when it gets pulled in with add_s
by geokon 4y ago
Oh okay - I think in that case it's possible Hunter would solve your problems. If you rewrite your library to use Hunter, then when it gets pulled in with add_subdirectory(), it should just build and get it's dependencies with Hunter - all from within CMake itself. No external tool necessary (the Hunter functions are defined in the project root `.cmake` file)
I don't see any reason that wouldn't work - but.. you'd have to test it. I've never tried running a Hunterless top-level project with a Hunter-ized subdirectory. The top level project would still get some benefits like the namespaced targets (so you won't clobber anything in top-level)
The only small catch is that Hunter inevitably does build a cache of build artifacts/targets for your dependencies. As long as you keep using the same toolchain files these keep getting reused each time you rebuild your project. That does however mean you will get some user folder like ~/.hunter with those build artifacts (look at the Hunter config options.. maybe this can be somehow hidden in the build directory?). I dunno if that would irritate the project users. If it's company internal that's probably an okay ask. If it's random devs on github then that's a bit not-nice :)
- galangalalgol 4y agoThanks! That looks like it might be fine. The conan cache works the same way but all our builds and deployments are containerized so the ~/.conan wasn't the issue, it was that conan was in control, not cmake.