[kdepimlibs/frameworks] /: Make gpgme++ compile standalone.
David Faure
faure at kde.org
Tue Feb 21 11:26:01 UTC 2012
Git commit b92666b7afb2d5fe8935996f6da6019f13c61c26 by David Faure.
Committed on 21/02/2012 at 12:24.
Pushed by dfaure into branch 'frameworks'.
Make gpgme++ compile standalone.
Had to put a local copy of MACRO_BOOL_TO_01 into FindGpgme.cmake.
What's the plan for that macro? ECM? CMake builtin? Not using #cmakedefine?
CCMAIL: kde-buildsystem at kde.org
M +20 -13 cmake/modules/FindGpgme.cmake
M +32 -6 gpgme++/CMakeLists.txt
M +1 -1 gpgme++/assuanresult.cpp
M +1 -1 gpgme++/callbacks.cpp
M +1 -1 gpgme++/data.cpp
M +1 -1 gpgme++/encryptionresult.cpp
M +1 -1 gpgme++/engineinfo.cpp
M +1 -1 gpgme++/eventloopinteractor.cpp
M +13 -5 gpgme++/gpgme++_export.h
M +1 -1 gpgme++/importresult.cpp
M +1 -1 gpgme++/keygenerationresult.cpp
M +1 -1 gpgme++/keylistresult.cpp
M +1 -1 gpgme++/signingresult.cpp
M +1 -1 gpgme++/trustitem.cpp
M +1 -1 gpgme++/verificationresult.cpp
M +1 -1 gpgme++/vfsmountresult.cpp
http://commits.kde.org/kdepimlibs/b92666b7afb2d5fe8935996f6da6019f13c61c26
diff --git a/cmake/modules/FindGpgme.cmake b/cmake/modules/FindGpgme.cmake
index 17ad3be..872c045 100644
--- a/cmake/modules/FindGpgme.cmake
+++ b/cmake/modules/FindGpgme.cmake
@@ -42,8 +42,16 @@ macro( macro_bool_to_bool FOUND_VAR )
endforeach()
endmacro()
-include (MacroEnsureVersion)
-
+#HACK: local copy...
+MACRO(MACRO_BOOL_TO_01 FOUND_VAR )
+ FOREACH (_current_VAR ${ARGN})
+ IF(${FOUND_VAR})
+ SET(${_current_VAR} 1)
+ ELSE(${FOUND_VAR})
+ SET(${_current_VAR} 0)
+ ENDIF(${FOUND_VAR})
+ ENDFOREACH(_current_VAR)
+ENDMACRO(MACRO_BOOL_TO_01)
if ( WIN32 )
@@ -206,9 +214,8 @@ else() # not WIN32
exec_program( ${_GPGMECONFIG_EXECUTABLE} ARGS --version OUTPUT_VARIABLE GPGME_VERSION )
set( _GPGME_MIN_VERSION "1.1.7" )
- macro_ensure_version( ${_GPGME_MIN_VERSION} ${GPGME_VERSION} _GPGME_INSTALLED_VERSION_OK )
- if ( NOT _GPGME_INSTALLED_VERSION_OK )
+ if ( ${GPGME_VERSION} VERSION_LESS ${_GPGME_MIN_VERSION} )
message( STATUS "The installed version of gpgme is too old: ${GPGME_VERSION} (required: >= ${_GPGME_MIN_VERSION})" )
@@ -384,15 +391,15 @@ if ( NOT Gpgme_FIND_QUIETLY )
set( _gpgme_homepage "http://www.gnupg.org/related_software/gpgme" )
endif()
- macro_log_feature(
- GPGME_FOUND
- "gpgme"
- "GNU Privacy Guard (GPG/PGP) support"
- ${_gpgme_homepage}
- ${_req}
- "${_GPGME_MIN_VERSION} or greater"
- "Necessary to compile many PIM applications, including KMail"
- )
+ #macro_log_feature(
+ # GPGME_FOUND
+ # "gpgme"
+ # "GNU Privacy Guard (GPG/PGP) support"
+ # ${_gpgme_homepage}
+ # ${_req}
+ # "${_GPGME_MIN_VERSION} or greater"
+ # "Necessary to compile many PIM applications, including KMail"
+ #)
else()
diff --git a/gpgme++/CMakeLists.txt b/gpgme++/CMakeLists.txt
index 674d5d3..df9ed43 100644
--- a/gpgme++/CMakeLists.txt
+++ b/gpgme++/CMakeLists.txt
@@ -1,11 +1,37 @@
+cmake_minimum_required(VERSION 2.8.7 FATAL_ERROR)
+
project( gpgmepp )
+
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules)
+
+find_package(extra-cmake-modules 0.0.3 REQUIRED)
+set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${EXTRA_CMAKE_MODULES_MODULE_PATH})
+
+# Used by find_package
+include(FeatureSummary)
+
+find_package(Qt5Transitional REQUIRED)
+
+# ECM
+include(ECMVersion)
+ecm_version(5 0 0)
+include(ECMQtFramework)
+
+find_package(Gpgme)
+set_package_properties(Gpgme PROPERTIES
+ URL "http://www.gnupg.org/related_software/gpgme/"
+ DESCRIPTION "The GnuPG Made Easy (GPGME) library)"
+ TYPE REQUIRED
+)
+include (ConfigureChecks.cmake)
+
#KDE4_NO_ENABLE_FINAL(gpgmepp)
if (MINGW)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mms-bitfields")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mms-bitfields")
endif()
-include_directories( ${GPGME_INCLUDES} ${Boost_INCLUDE_DIR} )
+include_directories( ${GPGME_INCLUDES} ${Boost_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/.. )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-gpgme++.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-gpgme++.h )
@@ -49,7 +75,7 @@ set( _gpgmepp_soversion 2 )
set( GPGMEPP_INCLUDE ${INCLUDE_INSTALL_DIR} ${GPGME_INCLUDES} ${Boost_INCLUDE_DIR} )
if ( GPGME_VANILLA_FOUND )
- kde4_add_library( gpgmepp ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_vanilla.cpp )
+ add_library( gpgmepp SHARED ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_vanilla.cpp )
target_link_libraries( gpgmepp ${GPGME_VANILLA_LIBRARIES} )
if(WINCE)
target_link_libraries(gpgmepp ${WCECOMPAT_LIBRARIES})
@@ -65,7 +91,7 @@ if ( GPGME_VANILLA_FOUND )
endif()
if ( GPGME_GLIB_FOUND )
- kde4_add_library( gpgmepp-glib ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_glib.cpp )
+ add_library( gpgmepp-glib SHARED ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_glib.cpp )
target_link_libraries( gpgmepp-glib ${GPGME_GLIB_LIBRARIES} )
set_target_properties( gpgmepp-glib PROPERTIES
VERSION ${_gpgmepp_version}
@@ -78,7 +104,7 @@ endif()
if ( GPGME_QT_FOUND )
- kde4_add_library( gpgmepp-qt ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_qt.cpp )
+ add_library( gpgmepp-qt SHARED ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_qt.cpp )
target_link_libraries( gpgmepp-qt ${GPGME_QT_LIBRARIES} )
if(WIN32)
target_link_libraries( gpgmepp-qt ${GPGME_VANILLA_LIBRARIES} )
@@ -94,7 +120,7 @@ endif()
if ( GPGME_PTHREAD_FOUND )
- kde4_add_library( gpgmepp-pthread ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_vanilla.cpp )
+ add_library( gpgmepp-pthread SHARED ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_vanilla.cpp )
target_link_libraries( gpgmepp-pthread ${GPGME_PTHREAD_LIBRARIES} )
set_target_properties( gpgmepp-pthread PROPERTIES
VERSION ${_gpgmepp_version}
@@ -106,7 +132,7 @@ if ( GPGME_PTHREAD_FOUND )
endif()
if ( GPGME_PTH_FOUND )
- kde4_add_library( gpgmepp-pth ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_vanilla.cpp )
+ add_library( gpgmepp-pth SHARED ${LIBRARY_TYPE} ${gpgme_LIB_SRCS} context_vanilla.cpp )
target_link_libraries( gpgmepp-pth ${GPGME_PTH_LIBRARIES} )
set_target_properties( gpgmepp-pth PROPERTIES
VERSION ${_gpgmepp_version}
diff --git a/gpgme++/assuanresult.cpp b/gpgme++/assuanresult.cpp
index bc144d8..012dbbd 100644
--- a/gpgme++/assuanresult.cpp
+++ b/gpgme++/assuanresult.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/assuanresult.h>
#include "result_p.h"
diff --git a/gpgme++/callbacks.cpp b/gpgme++/callbacks.cpp
index 775ba07..02f0d82 100644
--- a/gpgme++/callbacks.cpp
+++ b/gpgme++/callbacks.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include "callbacks.h"
#include "util.h"
diff --git a/gpgme++/data.cpp b/gpgme++/data.cpp
index 8f2fda3..a662f3e 100644
--- a/gpgme++/data.cpp
+++ b/gpgme++/data.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/error.h>
#include <gpgme++/interfaces/dataprovider.h>
diff --git a/gpgme++/encryptionresult.cpp b/gpgme++/encryptionresult.cpp
index 1a302dd..30b220d 100644
--- a/gpgme++/encryptionresult.cpp
+++ b/gpgme++/encryptionresult.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/encryptionresult.h>
#include "result_p.h"
diff --git a/gpgme++/engineinfo.cpp b/gpgme++/engineinfo.cpp
index 6f7be46..93e87b5 100644
--- a/gpgme++/engineinfo.cpp
+++ b/gpgme++/engineinfo.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include "engineinfo.h"
diff --git a/gpgme++/eventloopinteractor.cpp b/gpgme++/eventloopinteractor.cpp
index 3f164a1..ed117b4 100644
--- a/gpgme++/eventloopinteractor.cpp
+++ b/gpgme++/eventloopinteractor.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/eventloopinteractor.h>
diff --git a/gpgme++/gpgme++_export.h b/gpgme++/gpgme++_export.h
index 6e70db8..9c61142 100644
--- a/gpgme++/gpgme++_export.h
+++ b/gpgme++/gpgme++_export.h
@@ -21,18 +21,26 @@
#define GPGMEPP_EXPORT_H
/* needed for GPGMEPP_EXPORT and KDE_IMPORT macros */
-#include <kdemacros.h>
+/* HACK! Port this to generated export header */
+#include <qglobal.h>
+
+/* HACK */
+#ifndef KDE_DEPRECATED
+# define KDE_DEPRECATED __attribute__ ((__deprecated__))
+# define KDE_DEPRECATED_EXPORT KDECORE_EXPORT __attribute__ ((__deprecated__))
+# define KDE_DEPRECATED_NO_EXPORT KDECORE_NO_EXPORT __attribute__ ((__deprecated__))
+#endif
#ifndef GPGMEPP_EXPORT
# if defined(KDEPIM_STATIC_LIBS)
/* No export/import for static libraries */
# define GPGMEPP_EXPORT
# elif defined(MAKE_GPGME___LIB) || defined(MAKE_GPGMEPP_LIB)
- /* We are building this library */
-# define GPGMEPP_EXPORT KDE_EXPORT
+ /* We are building this library */
+# define GPGMEPP_EXPORT Q_DECL_EXPORT
# else
- /* We are using this library */
-# define GPGMEPP_EXPORT KDE_IMPORT
+ /* We are using this library */
+# define GPGMEPP_EXPORT
# endif
#endif
diff --git a/gpgme++/importresult.cpp b/gpgme++/importresult.cpp
index 909ba03..d251a3d 100644
--- a/gpgme++/importresult.cpp
+++ b/gpgme++/importresult.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/importresult.h>
#include "result_p.h"
diff --git a/gpgme++/keygenerationresult.cpp b/gpgme++/keygenerationresult.cpp
index 90c2238..10eb9e4 100644
--- a/gpgme++/keygenerationresult.cpp
+++ b/gpgme++/keygenerationresult.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/keygenerationresult.h>
#include "result_p.h"
diff --git a/gpgme++/keylistresult.cpp b/gpgme++/keylistresult.cpp
index 69ef54b..792454d 100644
--- a/gpgme++/keylistresult.cpp
+++ b/gpgme++/keylistresult.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/keylistresult.h>
#include "result_p.h"
diff --git a/gpgme++/signingresult.cpp b/gpgme++/signingresult.cpp
index 0f7f1dd..dcf7d3e 100644
--- a/gpgme++/signingresult.cpp
+++ b/gpgme++/signingresult.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/signingresult.h>
#include "result_p.h"
diff --git a/gpgme++/trustitem.cpp b/gpgme++/trustitem.cpp
index da4e9c4..a10c9d4 100644
--- a/gpgme++/trustitem.cpp
+++ b/gpgme++/trustitem.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/trustitem.h>
diff --git a/gpgme++/verificationresult.cpp b/gpgme++/verificationresult.cpp
index d64a057..80012b9 100644
--- a/gpgme++/verificationresult.cpp
+++ b/gpgme++/verificationresult.cpp
@@ -20,7 +20,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/verificationresult.h>
#include <gpgme++/notation.h>
#include "result_p.h"
diff --git a/gpgme++/vfsmountresult.cpp b/gpgme++/vfsmountresult.cpp
index b58876e..d7e686c 100644
--- a/gpgme++/vfsmountresult.cpp
+++ b/gpgme++/vfsmountresult.cpp
@@ -21,7 +21,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <gpgme++/config-gpgme++.h>
+#include <config-gpgme++.h>
#include <gpgme++/vfsmountresult.h>
#include "result_p.h"
More information about the Kde-buildsystem
mailing list