From b7435b31f6e6754480a4e6d2910d74ee15f75fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Fri, 24 May 2024 10:40:53 +0200 Subject: [PATCH] build,cpp: Create forwarding headers in a gpgme++ folder * lang/cpp/src/Makefile.am (copied_headers): New. (build rule for all copied headers): New. (BUILT_SOURCES): New. (CLEANFILES): Add copied_headers. -- The forwarding headers make it easier to use the headers from the Qt bindings when building them against the built but not installed C++ bindings because we can always include the C++ headers with gpgme++/ prefix. This also helps to avoid including a C++ header with the same name as a header in the Qt bindings (e.g. util.h). GnuPG-bug-id: 7110 --- lang/cpp/src/Makefile.am | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lang/cpp/src/Makefile.am b/lang/cpp/src/Makefile.am index fbec70bb..a2edb49e 100644 --- a/lang/cpp/src/Makefile.am +++ b/lang/cpp/src/Makefile.am @@ -88,6 +88,14 @@ else libsuffix=.so endif +copied_headers = $(gpgmepp_headers:%=gpgme++/%) $(interface_headers:%=gpgme++/%) + +$(copied_headers): Makefile.am + mkdir -p $(builddir)/gpgme++/interfaces + echo -n "#include \"$(srcdir)" > "$@" + echo -n "$@" | sed "s/gpgme++//" >> "$@" + echo "\"" >> "$@" + if HAVE_W32_SYSTEM GpgmeppConfig.cmake: GpgmeppConfig-w32.cmake.in sed -e 's|[@]resolved_bindir@|$(bindir)|g' < "$<" | \ @@ -115,5 +123,8 @@ install-data-local: install-cmake-files uninstall-local: uninstall-cmake-files +BUILT_SOURCES = $(copied_headers) + CLEANFILES = GpgmeppConfig.cmake GpgmeppConfigVersion.cmake \ - gpgmepp_version.h GpgmeppConfig.cmake.in + gpgmepp_version.h GpgmeppConfig.cmake.in \ + $(copied_headers)