I’m having persistent difficulties installing and linking to Qt libraries on Linux.
In previous questions here and here, I asked about how to install Qt libraries along with their namelinks, since the library name searched for by the linker (libQt5Core.so.5) was a symlink to libQt5Core.so.5.12.5 rather the file itself.
I had some success with:
install(CODE "file(COPY ${QT_MAIN_DIR}/lib/libQt5Core.so DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} FOLLOW_SYMLINK_CHAIN)")
…but that didn’t quite work because the only symlink it copied was libQt5Gui.so -> libQt5Gui.so.5.12.5 rather than libQt5Gui.so.5. I know that libQt5Gui.so.5 is what I want because if I go to the installation directory and manually type:
ln -s libQt5Core.so.5.12.5 libQt5Core.so.5
…then everything works as it should.
So, if I can’t get CMake to generate a link for libQt5Core.so.5 automatically, it looks like what I need to do is to get my application to link to either libQt5Core.so or libQt5Core.so.5.12.5 instead of libQt5Core.so.5. But I can’t see how I can control that.
Please can someone advise?