Fix compile error on linux using Gpgmepp caused by incorrect upper/lower case
Needs ReviewPublic

Authored by habacker on Jul 2 2018, 9:03 AM.

Details

Summary

The Gpgmepp library provides a library name that contains only lowercase
letters.

Test Plan

compiled on linux

Diff Detail

Repository
R261 KMyMoney
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 551
Build 563: arc lint + arc unit
habacker requested review of this revision.Jul 2 2018, 9:03 AM
habacker created this revision.
wojnilowicz added inline comments.
kmymoney/plugins/xml/libkgpgfile/CMakeLists.txt
16

In my GpgmeppConfig.cmake on Linux I see

add_library(Gpgmepp SHARED IMPORTED)

gpgmepp starts with uppercase "G", so everything seems correct to me as it is. Why do you need the change?

habacker added inline comments.Jul 3 2018, 1:40 PM
kmymoney/plugins/xml/libkgpgfile/CMakeLists.txt
16

I see, you are refering to the cmake target. On the host I tried to build kmymoney from master branch and got an error `-lGpgmepp not available', refering to a shared library in the file system, which is lower case

rpm -q libgpgmepp6
libgpgmepp6-1.9.0-120.6.x86_64
rpm -q -l libgpgmepp6
/usr/lib64/libgpgmepp.so.6
/usr/lib64/libgpgmepp.so.6.4.0

I need to check why this happend and will report back if it persists

In general, the issue occurs, if the cmake package Gpgmepp was not found, but the term 'Gpgmepp' has been added to a call to target_link_libraries, which translates the term into -lGpgmepp, searching for a real shared library with this name.

In general, the issue occurs, if the cmake package Gpgmepp was not found, but the term 'Gpgmepp' has been added to a call to target_link_libraries, which translates the term into -lGpgmepp, searching for a real shared library with this name.

That would be a bug, but where is that?
I see that every linking to gpgmepp is guarded by Gpgmepp_FOUND.

I can think of that this reference may be included as a direct library dependency in a 3rdparty dependency, if GPGME was not found

I can think of that this reference may be included as a direct library dependency in a 3rdparty dependency, if GPGME was not found

In that case we could write something like this in our cmake files

find_package(Gpgmepp)
find_package(gpgmepp)

and correct other locations respectively.

wojnilowicz resigned from this revision.Mar 10 2019, 6:51 AM