3 ms·
Interesting. I've been messing for a while with my own boilerplate C++ project [0], since I got sick of having to recreate the CMake set up for every app I cre
by kartikkumar 8y ago
Interesting.
I've been messing for a while with my own boilerplate C++ project [0], since I got sick of having to recreate the CMake set up for every app I created. It's taken a lot of CMake magic to get it working and I'm still not totally happy with the config using ExternalProject_add to automagically deal with dependencies that aren't present.
I've been evaluating Hunter [1] and wondering whether to step over.
If I understand correctly, the big advantage of Bake is that it completely replaces CMake for dependency management (at least that's what I take away from the readme)?
[0] https://github.com/kartikkumar/cppbase https://github.com/kartikkumar/cppbase
[1] https://github.com/ruslo/hunter https://github.com/ruslo/hunter
- humanrebar 8y agoAvoid ExternalProject_Add. You're better off using 'find_package', 'add_subdirectory', 'pkg_check_modules', or Conan depending on where your dependency comes from. In my opinion, CMake is best as a (meta)build system, leaving packaging details to a different layer.
- kartikkumar 8y agoI use ExternalProject_Add of building external dependencies from source, like this: https://github.com/kartikkumar/cppbase/blob/master/Dependencies.cmake https://github.com/kartikkumar/cppbase/blob/master/Dependenc...
- ajmmertens 8y agoYes, that is correct. Bake can find dependencies regardless of where the dependency's source code is. You also don't need to first install your project before it can be used as a dependency, building is enough. A big difference with CMake is that bake stores package binaries, include files and metadata in a $HOME/bake directory. It won't actually install anything to /usr/local (or equivalent), unless you explicitly tell it to. Users typically first build everything to their $HOME/bake folder, and then when they want to make it available for all users, copy the contents of that folder to /opt when distributing the project.