Hacker News new | ask | show | jobs
by MaxBarraclough 1554 days ago
> there are already many powerful C/C++ package managers, the most well-known and most used are: vcpkg, conan, conda, etc. Although they are very powerful, they have a common problem: The build system doesn't have built-in support for them.

CMake supports pkg-config, for what that's worth.

3 comments

And so does Meson. I don't think the xmake author spent a lot of time using other build systems (in fact their short paragraph about Meson demonstrates that they clearly never did use that, using vcpkg with Meson is like 0 effort), it's pretty trivial to simply install a library with "vcpkg/conan install whateverlib" and then use it in your build system via the standard "find_package" (CMake)/"dependency" (Meson) mechanism of adding dependencies.

> In addition, there is another problem, that is, we need to additionally call the vcpkg install [packages] command to install this package. > > Each of these links requires an additional exploration process for users, and it is impossible to achieve real one-click compilation.

And personally I don't think that this "real one-click compilation" should be a goal. On the contrary, I think the current process is pretty much exactly how it should work - first you install your dependencies via your package manager, then you can inspect/vet/whatever them if you want, and then you let your build system build.

I think this honestly undersells cmake on this front. CMake's ExternalProject[1] and FetchContent[2] features basically combine into a package manager, letting you pretty seemlessly incorporate things from arbitrary places, especially if they themselves use cmake.

[1] https://cmake.org/cmake/help/latest/module/ExternalProject.h... [2] https://cmake.org/cmake/help/latest/module/FetchContent.html

> CMake supports pkg-config, for what that's worth.

And in CMake support for Conan is literally a single line of code: conan_basic_setup()

https://docs.conan.io/en/latest/getting_started.html

On top of all this, it's really mind-boggling how a build system's main selling point is doing something a build system has no business doing.