Qt: Install CamelCase forward includes
authorAndre Heinecke <aheinecke@intevation.de>
Tue, 12 Jul 2016 09:47:33 +0000 (11:47 +0200)
committerAndre Heinecke <aheinecke@intevation.de>
Tue, 12 Jul 2016 09:47:33 +0000 (11:47 +0200)
* lang/qt/src/Makefile.am (camelcase_headers): New. Create and install
CamelCase headers.

--
For Qt Libraries it is a common pattern that headers are installed
additionally under their Namespace / Class Name so that automated
inclusion works once a class is used in code. This was also
done for QGpgME headers when they lived in Libkleo so this increases
compatibility.

lang/qt/src/Makefile.am

index 3f5025c..ae316ba 100644 (file)
@@ -35,6 +35,7 @@ qgpgme_sources = \
     qgpgmeverifyopaquejob.cpp threadedjobmixin.cpp \
     gpgme_backend_debug.cpp
 
+# If you add one here make sure that you also add one in camelcase
 qgpgme_headers= \
     adduseridjob.h \
     changeexpiryjob.h \
@@ -66,6 +67,36 @@ qgpgme_headers= \
     listallkeysjob.h \
     verifydetachedjob.h
 
+camelcase_headers= \
+    AddUserIDJob \
+    ChangeExpiryJob \
+    ChangeOwnerTrustJob \
+    ChangePasswdJob \
+    DataProvider \
+    DecryptJob \
+    DecryptVerifyJob \
+    DownloadJob \
+    EncryptJob \
+    ExportJob \
+    HierarchicalKeyKistJob \
+    Job \
+    MultiDeleteJob \
+    Protocol \
+    QGpgMENewCryptoConfig \
+    SignJob \
+    SignKeyJob \
+    SignEncryptJob \
+    VerifyOpaqueJob \
+    RefreshKeysJob \
+    CryptoConfig \
+    DeleteJob \
+    ImportFromKeyserverJob \
+    ImportJob \
+    KeyGenerationJob \
+    KeyListJob \
+    ListAllKeysJob \
+    VerifyDetachedJob
+
 private_qgpgme_headers = \
     qgpgme_export.h \
     abstractimportjob.h \
@@ -148,6 +179,8 @@ qgpgme_moc_sources = \
 
 qgpgmeincludedir = $(includedir)/qgpgme
 qgpgmeinclude_HEADERS = $(qgpgme_headers)
+camelcaseincludedir = $(includedir)/QGpgME
+camelcaseinclude_HEADERS = $(camelcase_headers)
 nodist_include_HEADERS = qgpgme_version.h
 
 libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
@@ -171,6 +204,11 @@ QGpgmeConfig.cmake: QGpgmeConfig.cmake.in
        sed -e 's|[@]libsuffix@|$(libsuffix)|g' < "$@" > "$@".2
        mv "$@".2 "$@"
 
+$(camelcase_headers): Makefile.am
+       echo -n "#include \"qgpgme/" > "$@"
+       echo -n "$@" | tr '[:upper:]' '[:lower:]' >> "$@"
+       echo ".h\"" >> "$@"
+
 install-cmake-files: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake
        -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/Gpgmepp
        $(INSTALL) QGpgmeConfig.cmake \
@@ -187,9 +225,9 @@ install-data-local: install-cmake-files
 
 uninstall-local: uninstall-cmake-files
 
-BUILT_SOURCES = $(qgpgme_moc_sources)
+BUILT_SOURCES = $(qgpgme_moc_sources) $(camelcase_headers)
 
-CLEANFILES = $(qgpgme_moc_sources) QGpgmeConfig.cmake
+CLEANFILES = $(qgpgme_moc_sources) $(camelcase_headers) QGpgmeConfig.cmake
 
 nodist_libqgpgme_la_SOURCES = $(qgpgme_moc_sources)