berndporr / iir1

DSP IIR realtime filter library written in C++
http://berndporr.github.io/iir1/
MIT License
627 stars 137 forks source link

Fedora cmake fixes #44

Closed oturpe closed 1 year ago

oturpe commented 1 year ago

I am currently trying to package iir1 for Fedora, because DOSBox Staging has grown a dependency to it. Mostly, packaging has been easy, but ran into two problems:

Allow disabling static library installation

In many cases, static library is not needed for installation. For instance, Fedora and other Linux distributions normally only ship shared libraries. Add option to disable installation of static library.

The static library is needed when building tests, so the new option only affects installation, not build.

Install CMake files to libdir

Linux distributions do not always use /usr/lib as libdir. For example, in Fedora, /usr/lib is intended for 32-bit libraries and normal 64-bit libraries go to /usr/lib64.

On the other hand, CMake configuration is intended to go to ${libdir}/cmake. To make this work in various cases, use CMAKE_INSTALL_LIBDIR variable instead of hard coded 'lib'.

This system is used also in CMake's own documentation.

oturpe commented 1 year ago

There was a third problem as well, which is that in Fedora, by policy everything must be built from sources, so the prebuilt docs directory cannot be used. I could have further modified the build script to allow docs rebuild, but I instead just ran doxygen as part of the build.

If there is interest in having such option in the build script, I can provide a patch for that as well.

berndporr commented 1 year ago

Thanks. Well the static library is important for Windooze and a lot of people use the lib on Windows. Same for doxygen. Under Linux it's available of course but under Win rather not so it's pre-compiled. Thanks for offering to add a script for doxygen that if that were included then I'd get tons of e-mails from Win users so let's keep it rather as it is.