gdesmott/system-deps

Hook for libraries without pkg-config support

sdroege opened this issue · 11 comments

This could then be used to run things like sdl2-config, and similar to retrieve the same information. Crates could provide code to extract these things and then provide the same information as pkg-config to metadeps.

@gdesmott This was accidentally closed instead of the other issue

Oups, thanks :)

Definitely would be handy for myself; I'm doing a search for packages via CMake's system.

How do you handle CMake's system though? It seems rather non-trivial, see e.g. this.

From what I understand in meson they create a small temporary cmake build system just for doing dependency checks, and from looking at the code of that it doesn't seem very easy.

But if you want to implement something around that, that would be great :)

@jalcine which CMake libraries not shipping pkg-config file are you looking to support? I'm wondering if they are that common. From the common above supporting those seems a lot of work, much more than shipping a pkg-config file in those libraries I suspect.

Yeah CMake modules are not really meant to be used outside CMake, they need to be interpreted by it. But there are quite a few projects only shipping a CMake module unfortunately.

The other more easy case is the *-config scripts that e.g. SDL, Python, OpenSSL, etc are shipping with (but they also all have pkg-config files not IIRC).

I wonder what would be the correct way to handle Windows builds? If you get a Gnu toolchain pkg-config is a thing, but in the MSVC world it seems to be not so much a thing. Not sure what the correct approach would be.

There isn't really one. Some things are using CMake, others use pkg-config, others have nothing

@jalcine That's basically what meson is doing for its cmake dependency resolver that I mentioned above. That's definitely a possible approach