Mailing List Archive

[PATCH gpgme] qt: Fix DLL version in cmake config files
From: Biswapriyo Nath <nathbappai@gmail.com>

Signed-off-by: Biswapriyo Nath <nathbappai@gmail.com>
---
lang/qt/src/QGpgmeConfig-w32.cmake.in.in | 4 ++--
lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lang/qt/src/QGpgmeConfig-w32.cmake.in.in b/lang/qt/src/QGpgmeConfig-w32.cmake.in.in
index b897805..a58b940 100644
--- a/lang/qt/src/QGpgmeConfig-w32.cmake.in.in
+++ b/lang/qt/src/QGpgmeConfig-w32.cmake.in.in
@@ -65,11 +65,11 @@ set_target_properties(QGpgme PROPERTIES
IMPORTED_IMPLIB_RELEASE "@resolved_libdir@/libqgpgme.dll.a"
INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@"
INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt5::Core"
- IMPORTED_LOCATION "@resolved_libdir@/libqgpgme-7.dll"
+ IMPORTED_LOCATION "@resolved_libdir@/libqgpgme-15.dll"
)

list(APPEND _IMPORT_CHECK_TARGETS QGgpme )
-list(APPEND _IMPORT_CHECK_FILES_FOR_Qgpgme "@resolved_libdir@/libqgpgme.dll.a" "@resolved_bindir@/libqgpgme-7.dll" )
+list(APPEND _IMPORT_CHECK_FILES_FOR_Qgpgme "@resolved_libdir@/libqgpgme.dll.a" "@resolved_bindir@/libqgpgme-15.dll" )

if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
diff --git a/lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in b/lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in
index 6cb8af4..8e61f35 100644
--- a/lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in
+++ b/lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in
@@ -65,11 +65,11 @@ set_target_properties(QGpgmeQt6 PROPERTIES
IMPORTED_IMPLIB_RELEASE "@resolved_libdir@/libqgpgmeqt6.dll.a"
INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@"
INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt6::Core"
- IMPORTED_LOCATION "@resolved_libdir@/libqgpgmeqt6-7.dll"
+ IMPORTED_LOCATION "@resolved_libdir@/libqgpgmeqt6-15.dll"
)

list(APPEND _IMPORT_CHECK_TARGETS QGpgmeQt6 )
-list(APPEND _IMPORT_CHECK_FILES_FOR_QGpgmeQt6 "@resolved_libdir@/libqgpgmeqt6.dll.a" "@resolved_bindir@/libqgpgmeqt6-7.dll" )
+list(APPEND _IMPORT_CHECK_FILES_FOR_QGpgmeQt6 "@resolved_libdir@/libqgpgmeqt6.dll.a" "@resolved_bindir@/libqgpgmeqt6-15.dll" )

if(CMAKE_VERSION VERSION_LESS 2.8.12)
message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.")
--
2.41.0


_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH gpgme] qt: Fix DLL version in cmake config files [ In reply to ]
Hi,

Good timing! Less than one day after the release of version 1.21. :-)

On Samstag, 8. Juli 2023 07:14:44 CEST Biswapriyo Nath via Gnupg-devel wrote:
> @@ -65,11 +65,11 @@ set_target_properties(QGpgme PROPERTIES
> IMPORTED_IMPLIB_RELEASE "@resolved_libdir@/libqgpgme.dll.a"
> INTERFACE_INCLUDE_DIRECTORIES
> "@resolved_includedir@/qgpgme;@resolved_includedir@"
> INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt5::Core"
> - IMPORTED_LOCATION "@resolved_libdir@/libqgpgme-7.dll"
> + IMPORTED_LOCATION "@resolved_libdir@/libqgpgme-15.dll"

I think this is still wrong because it should certainly be @resolved_bindir@
as below because the DLL is installed in bindir.

Makes me wonder when/how IMPORTED_LOCATION is used because, apparently, we
never had any problems linking libkleo and kleopatra against QGpgME with MinGW
despite IMPORTED_LOCATION pointing to a not existing file.

> list(APPEND _IMPORT_CHECK_TARGETS QGgpme )
> -list(APPEND _IMPORT_CHECK_FILES_FOR_Qgpgme
> "@resolved_libdir@/libqgpgme.dll.a" "@resolved_bindir@/libqgpgme-7.dll" )
> +list(APPEND _IMPORT_CHECK_FILES_FOR_Qgpgme
> "@resolved_libdir@/libqgpgme.dll.a" "@resolved_bindir@/libqgpgme-15.dll" )

Regards,
Ingo
Re: [PATCH gpgme] qt: Fix DLL version in cmake config files [ In reply to ]
> I think this is still wrong because it should certainly be @resolved_bindir@
> as below because the DLL is installed in bindir.

Yes, I was going to send that patch after this one is merged. Should I
send both fixes in one patch?


> Makes me wonder when/how IMPORTED_LOCATION is used because, apparently, we
> never had any problems linking libkleo and kleopatra against QGpgME with MinGW
> despite IMPORTED_LOCATION pointing to a not existing file.

It seems that the `find_package(QGpgme CONFIG)` call succeed if
QGpgmeConfig.cmake and QGpgmeConfigVersion.cmake file is present. The
existence of .dll or .dll.a file was not checked by cmake. I found
that using Process Monitor in Microsoft Windows OS (filter: path
contains qgpgme).

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel
Re: [PATCH gpgme] qt: Fix DLL version in cmake config files [ In reply to ]
On Samstag, 8. Juli 2023 18:01:20 CEST Biswapriyo Nath wrote:
> > I think this is still wrong because it should certainly be
> > @resolved_bindir@ as below because the DLL is installed in bindir.
>
> Yes, I was going to send that patch after this one is merged. Should I
> send both fixes in one patch?

Okay. I have committed your patch and also fixed the path. Thanks!

> > Makes me wonder when/how IMPORTED_LOCATION is used because, apparently, we
> > never had any problems linking libkleo and kleopatra against QGpgME with
> > MinGW despite IMPORTED_LOCATION pointing to a not existing file.
>
> It seems that the `find_package(QGpgme CONFIG)` call succeed if
> QGpgmeConfig.cmake and QGpgmeConfigVersion.cmake file is present. The
> existence of .dll or .dll.a file was not checked by cmake.

Indeed. At least, when using Qt 5. It wasn't checked because of typos in the
variable names which made the loop that should have checked the files an empty
loop. I have fixed this and also avoided the duplication of the file paths.

Regards,
Ingo
Re: [PATCH gpgme] qt: Fix DLL version in cmake config files [ In reply to ]
> Indeed. At least, when using Qt 5. It wasn't checked because of typos in the
> variable names which made the loop that should have checked the files an empty
> loop. I have fixed this and also avoided the duplication of the file paths.

The typo was hard to notice. Thank you.

_______________________________________________
Gnupg-devel mailing list
Gnupg-devel@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-devel