diff options
Diffstat (limited to 'ConfigureChecks.cmake')
-rw-r--r-- | ConfigureChecks.cmake | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index aaa2eb93c..dd7034c7e 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -151,6 +151,73 @@ if( BUILD_LIBTDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOO if( NOT HAVE_GPGME_0_4_BRANCH ) message( STATUS " found 'gpgme', version ${GPGME_VERSION}" ) endif( ) + + # check for various GPGME features + tde_save( CMAKE_CXX_FLAGS ) + tde_save( CMAKE_REQUIRED_LIBRARIES ) + string( REGEX REPLACE "-include tqt.h" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" ) + # See FIXME above regarding -D_FILE_OFFSET_BITS=64 + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GPGME_INCLUDE_DIRS} -D_FILE_OFFSET_BITS=64") + set( CMAKE_REQUIRED_LIBRARIES "${GPGME_LIBRARIES}") + + # check for GPGME_KEYLIST_MODE_VALIDATE + check_cxx_source_compiles(" + #include <gpgme.h> + int main() { + gpgme_keylist_mode_t mode = GPGME_KEYLIST_MODE_VALIDATE; + };" + HAVE_GPGME_KEYLIST_MODE_VALIDATE ) + + # check for gpgme_cancel + check_cxx_source_compiles(" + #include <gpgme.h> + int main() { + gpgme_ctx_t ctx = 0; + gpgme_error_t e = gpgme_cancel( ctx ); + };" + HAVE_GPGME_CANCEL ) + + # check for gpgme_key_t->keylist_mode + check_cxx_source_compiles(" + #include <gpgme.h> + int main() { + gpgme_key_t key = 0; + key->keylist_mode = 0; + };" + HAVE_GPGME_KEY_T_KEYLIST_MODE ) + + # check for gpgme_decrypt_result_t->wrong_key_usage + check_cxx_source_compiles(" + #include <gpgme.h> + int main() { + gpgme_decrypt_result_t res; + unsigned int wku = res->wrong_key_usage; + };" + HAVE_GPGME_WRONG_KEY_USAGE ) + + # check for GPGME_INCLUDE_CERTS_DEFAULT + check_cxx_source_compiles(" + #include <gpgme.h> + int main() { + int i = GPGME_INCLUDE_CERTS_DEFAULT; + };" + HAVE_GPGME_INCLUDE_CERTS_DEFAULT ) + + # check for gpgme_op_getauditlog + check_cxx_source_compiles(" + #include <gpgme.h> + int main() { + gpgme_ctx_t ctx = 0; + gpgme_data_t data = 0; + unsigned int flags = 0; + gpgme_error_t e = gpgme_op_getauditlog( ctx, data, flags ); + };" + HAVE_GPGME_OP_GETAUDITLOG ) + + # done checking for GPGME features + tde_restore( CMAKE_CXX_FLAGS ) + tde_restore( CMAKE_REQUIRED_LIBRARIES ) + endif( ) |