Hunter [CMake/C++] Package Manager: To be or not to be

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Hunter [CMake/C++] Package Manager: To be or not to be

Cristian Adam


For those of you who use Hunter for package management with CMake,  its maintainer has issued a call for support to keep it alive or take over its maintainership:

Hunter is different than vcpkg and Conan, it uses only CMake to do the package management. It also uses more CMake features than the others.

Let's take pcre2 package for example.  Which has bzip2 and zlib as dependencies. pcre2 package has a peculiarity when it's built as a static library, it needs the PCRE2_STATIC definition.

Conan is not using pcre2's CMake build system, instead the package is being build with the Conan Python infrastructure. I don't know if in the end you'll have CMake Module or CMake Config packages.

vcpkg is using  pcre2's CMake build system. It controls it from outside, and afterwards it does some patching to ensure PCRE2_STATIC works as expected. vcpkg is using CMake Module packages. In the vcpkg portfile the zlib and bzip2 dependencies are not mentioned. I assume they are somehow available in the vcpkg build environment prior to building pcre2.

Hunter is using  pcre2's CMake build system, and it does modify the pcre2's CMakeLists.txt to call the Hunter CMake API. It handles the dependencies, and then it properly installs / exports a CMake Config package. In the commit history you can see what it takes to import a package in the Hunter repository.

At QTBUG-75578 there is a description on how to use Hunter to download / build / install the 3rd party dependencies of Qt6::Base module, in order to build it on Windows with MinGW. You only need to edit one CMakeLists.txt file.

I would like to point out that Ruslan Baratov contributed the IPO/LTO functionality that landed in CMake 3.9.



Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: