Use cmake instead of pkg-config to find packages in dunecontrol
The library pkg-config is used to distinguish if a module is already installed or not. With this information, it gives precedence for the modules to include in case of double definitions.
The issue with pkg-config
-
De-facto dependency: The website hints that
pkg-configis an optional dependency. However, the reality is that using DUNE withoutdunecontrolrequires you to know how several internal things about DUNE. So, most of our users (specially newcomers), requiredunecontrolto use DUNE at all Now, the problem is thatdunecontroldepends inpkg-configeven though all of our documentations say its optional. I have fallen into this trap several times when creating minimal setups. -
Finds packages the
pkg-configway: It tries to find information extracting information from the.pcfiles. But this is not how the build system in dune works. Our build system is built with cmake, that is to say that if cmake cannot find a package, it doesn't matter how does the.pcfile looks like. In other words, that's just a proxy for the real way to find dune modules.
Proposal
Make dune control find packages using cmake and use this to distinguish if a module is installed or not.
Edited by Santiago Ospina De Los Ríos