saturneric / GpgFrontend

A free, open-source, robust yet user-friendly, compact and cross-platform tool for OpenPGP encryption. It stands out as an exceptional GUI frontend for the modern GnuPG (gpg).
https://gpgfrontend.bktus.com
GNU General Public License v3.0
473 stars 46 forks source link

Do not assume locations of libraries. #23

Closed Kamilcuk closed 2 years ago

Kamilcuk commented 2 years ago

Lines in src/gpg/CMakeLists.txt are odd:

    message(STATUS "Link GPG Static Library For Unix")
     target_link_libraries(gpg
            /usr/local/lib/libgpgme.a /usr/local/lib/libgpg-error.a /usr/local/lib/libassuan.a
             Qt5::Network Qt5::PrintSupport Qt5::Widgets Qt5::Test Qt5::Core)

Surely not /usr/local/lib! It's also odd that there are multiple paths for each operating system. I can install the library anywhere I would want to. It's also odd to force the use of static library. The proper way would be to do like:

// already searches /usr/local/lib by itself, because it should be listed in `CMAKE_LIBRARY_PATH`
find_library(gpgme NAMES libgpgme.a)
target_link_libraries(gpg PUBLIC
       ${gpgme}
)

That way If I want to I can cmake -D GPGME=/my/path/to/libgpgme.a specify manual path.

saturneric commented 2 years ago

Thanks, configure files project is not yet mature. I will continue to improve it.

saturneric commented 2 years ago

This issue solved now #26.