neithanmo / csound-rs

This is a Rust bindings for Csound.
MIT License
13 stars 5 forks source link

Use csound cmake module for finding the dependency #4

Open sdroege opened 4 years ago

sdroege commented 4 years ago

At least on Linux /usr/share/cmake/Csound/FindCsound.cmake is shipped with csound, which allows to find the location of the library and everything else needed to make use of it.

build.rs should check for this and make use of it instead of only looking in hardcoded locations.

There's probably a way to have cmake evaluate it and give cargo the relevant information.

sdroege commented 4 years ago

There's probably a way to have cmake evaluate it and give cargo the relevant information.

The way is to have a dummy cmake build system and extract the information from the files generated by cmake. And that's why it's a bad idea to use cmake... too bad csound doesn't even provide a pkg-config file.

neithanmo commented 4 years ago

yeah, It is like mocking all the process and doing it in the build.rs. I already looked at this. Thinking of adding support for pkg-config, at least for linux .

sdroege commented 4 years ago

It would be great to add pkg-config in general. It's the only available cross-platform mechanism that we have currently for finding C/C++ libraries