system-deps icon indicating copy to clipboard operation
system-deps copied to clipboard

Hook for libraries without pkg-config support

Open sdroege opened this issue 5 years ago • 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.

sdroege avatar May 01 '20 13:05 sdroege

@gdesmott This was accidentally closed instead of the other issue

sdroege avatar Jul 10 '20 08:07 sdroege

Oups, thanks :)

gdesmott avatar Jul 10 '20 08:07 gdesmott

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

jalcine avatar Nov 24 '20 23:11 jalcine

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 :)

sdroege avatar Nov 25 '20 07:11 sdroege

@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.

gdesmott avatar Nov 25 '20 08:11 gdesmott

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).

sdroege avatar Nov 25 '20 08:11 sdroege

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.

pepijndevos avatar Nov 28 '20 16:11 pepijndevos

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

sdroege avatar Nov 28 '20 16:11 sdroege

So I'm still working on this but I figured how to resolve my dependencies from CMake via Cargo. I build a project that links against everything I needed and then write out properties that hold information I'd want to the cache (include dirs, compiler flags, library linking search paths, etc). I then use cmake -LA to find those properties and parse them out.

It's definitely rough of a solution and I can see a lot of cleanup for it but I think it's the way outside of just using something like Meson for building Rust projects.

On Sat, Nov 28, 2020, at 08:48, Sebastian Dröge wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gdesmott/system-deps/issues/3#issuecomment-735254743, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADOMBESL436G245VEVJDMTSSESU5ANCNFSM4MXC2HMQ.

jalcine avatar Nov 28 '20 16:11 jalcine

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

sdroege avatar Nov 28 '20 16:11 sdroege

Ah I didn't know that! Tbh if this works, I can work on a crate to abstract this for other projects (I def do want to do this).

For context, I'm doing this for a KDE cross platform application and KDE goes all in on CMake (for some reason).

On Sat, Nov 28, 2020, at 08:59, Sebastian Dröge wrote:

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

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gdesmott/system-deps/issues/3#issuecomment-735256102, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADOMBEBLHQREQHSAUT2NCDSSET7XANCNFSM4MXC2HMQ.

jalcine avatar Nov 28 '20 20:11 jalcine