Skycoder42 / QHotkey

A global shortcut/hotkey for Desktop Qt-Applications
BSD 3-Clause "New" or "Revised" License
548 stars 161 forks source link

Fix shared library build #60

Closed Shatur closed 2 years ago

Shatur commented 2 years ago

Fixes the build as a shared library for CMake and adds tests for the CI. I also changed macro names according to the Qt example. The difference from the example is that we have an extra define QHOTKEY_SHARED (previously named as QHOTKEY_LIB, I just renamed it to avoid confusion) because we want to have an option to build the library statically. In this case QHOTKEY_EXPORT should be defined as an empty macro.

dbermond commented 2 years ago

This works perfectly for me! Great job! :)

I've tested it on Arch Linux and Windows 7. Under Windows, a client application can now link fine against a shared library produced with CMake. Static linking also worked fine under Windows. Clients can also link fine in Arch Linux with both a shared and static library, Qt6 and Qt5.

In time: maybe you can also update the version on the QHotkey/QHotkey.pro file. It still points to 1.2.1 and I forgot to update it on the previous pull request when the CMake version was updated.

Shatur commented 2 years ago

Thanks for testing!

In time: maybe you can also update the version on the QHotkey/QHotkey.pro file. It still points to 1.2.1 and I forgot to update it on the previous pull request when the CMake version was updated.

I'll do it.