qlcplus icon indicating copy to clipboard operation
qlcplus copied to clipboard

CMake: Introduce LIBSSUBDIR to install shared libraries in a sub directory

Open kiilerix opened this issue 1 month ago • 1 comments

Description

Summary of Changes:

On Linux, /usr/lib/*.so is reserved for libraries that are shared to be used by other applications. Such shared libraries must thus have careful versioning and development headers etc.

The qlcplus .so libraries are pretty much application internals. They are not versioned, and are only used by qlcplus and the fixture editor (and tests). They do not belong in the public namespace in /usr/lib .

Static linking could be a good option without much overhead if we only had the 2 binaries. But it is not a good option when we also consider the test binaries.

Instead, make it so that if building with

    cmake -DLIBSSUBDIR:STRING=/qlcplus

the LIBSDIR default value of /usr/lib will be augmented to /usr/lib/qlcplus , and the binaries will get RPATH set to look there.

Also, with LIBSDIR already being specific to qlcplus and a specific build of it, there is no need to install plugins in a deep path like /usr/lib/qlcplus/qt6/plugins/qlcplus . Instead, just set PLUGINDIR to the LIBSDIR/plugins , like /usr/lib/qlcplus/plugins .

If not setting LIBSSUBDIR, everything will be as before.

Checklist

  • [x] I have read and followed the QLC+ Coding Guidelines.
  • [ x] My code adheres to the project's coding style, including:
    • [ ] Placing opening braces { on a new line for functions and class definitions.
    • [ x] Consistent use of spaces and indentation.
  • [x ] I have tested my changes on the following platforms:
    • [x ] Linux
    • [ ] Windows
    • [ ] macOS
  • [ ] I have added or updated documentation as necessary.

Testing

Built and tested RPM on Fedora.

kiilerix avatar Nov 13 '25 22:11 kiilerix

Coverage Status

coverage: 34.25%. remained the same when pulling e4882eb569678d5094980e3776f42233294f44fc on kiilerix:packaging-improvements into 3461538b212ce84a505e4d24b18ddcada73b1106 on mcallegari:master.

coveralls avatar Nov 13 '25 22:11 coveralls