@ -67,11 +67,13 @@ if( WITH_GNOKII AND (BUILD_KADDRESSBOOK OR BUILD_KMOBILE) )
endif ( )
endif ( )
if ( BUILD_LIBTDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOOK OR BUILD_KONTACT )
if ( ( BUILD_LIBTDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOOK OR BUILD_KONTACT ) AND NOT HAVE_GPGME_0_4_BRANCH )
if ( NOT HAVE_GPGME_0_4_BRANCH )
message ( STATUS "checking for 'gpgme'" )
message ( STATUS "checking for 'gpgme'" )
endif ( )
# c h e c k f o r g p g m e
pkg_search_module ( GPGME gpgme )
if ( NOT GPGME_FOUND )
# f i n d g p g m e - c o n f i g
# f i n d g p g m e - c o n f i g
find_program ( GPGME_EXECUTABLE NAMES gpgme-config )
find_program ( GPGME_EXECUTABLE NAMES gpgme-config )
@ -79,12 +81,6 @@ if( BUILD_LIBTDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOO
tde_message_fatal ( "gpgme-config was NOT found.\n gpgme library is installed?" )
tde_message_fatal ( "gpgme-config was NOT found.\n gpgme library is installed?" )
endif ( )
endif ( )
# f i n d g p g - e r r o r - c o n f i g
find_program ( GPG_ERR_EXECUTABLE NAMES gpgrt-config gpg-error-config )
if ( NOT GPG_ERR_EXECUTABLE )
tde_message_fatal ( "gpgrt-config or gpg-error-config was NOT found.\n gpg-error library is installed?" )
endif ( )
macro ( __run_gpgme_config __type __var )
macro ( __run_gpgme_config __type __var )
execute_process (
execute_process (
C O M M A N D $ { G P G M E _ E X E C U T A B L E } - - $ { _ _ t y p e }
C O M M A N D $ { G P G M E _ E X E C U T A B L E } - - $ { _ _ t y p e }
@ -96,6 +92,29 @@ if( BUILD_LIBTDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOO
endif ( )
endif ( )
endmacro ( )
endmacro ( )
__run_gpgme_config ( version GPGME_VERSION )
__run_gpgme_config ( cflags GPGME_INCLUDE_DIRS )
__run_gpgme_config ( libs GPGME_LIBRARIES )
if ( GPGME_INCLUDE_DIRS )
string ( REGEX REPLACE "(^| +)-I" ";" GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS}" )
endif ( )
if ( GPGME_LIBRARIES )
string ( REGEX REPLACE "(^| +)-l" ";" GPGME_LIBRARIES "${GPGME_LIBRARIES}" )
endif ( )
endif ( )
# c h e c k f o r g p g - e r r o r
pkg_search_module ( GPGERR gpg-error )
if ( NOT GPGERR_FOUND )
# f i n d g p g - e r r o r - c o n f i g
find_program ( GPG_ERR_EXECUTABLE NAMES gpgrt-config gpg-error-config )
if ( NOT GPG_ERR_EXECUTABLE )
tde_message_fatal ( "gpgrt-config or gpg-error-config was NOT found.\n gpg-error library is installed?" )
endif ( )
macro ( __run_gpgerr_config __type __var )
macro ( __run_gpgerr_config __type __var )
execute_process (
execute_process (
C O M M A N D $ { G P G _ E R R _ E X E C U T A B L E } - - $ { _ _ t y p e }
C O M M A N D $ { G P G _ E R R _ E X E C U T A B L E } - - $ { _ _ t y p e }
@ -107,48 +126,31 @@ if( BUILD_LIBTDENETWORK OR BUILD_CERTMANAGER OR BUILD_KMAIL OR BUILD_KADDRESSBOO
endif ( )
endif ( )
endmacro ( )
endmacro ( )
__run_gpgme_config ( version GPGME_VERSION )
__run_gpgme_config ( cflags GPGME_INCLUDE_DIRS )
__run_gpgme_config ( libs GPGME_LIBRARIES )
__run_gpgerr_config ( version GPGERR_VERSION )
__run_gpgerr_config ( version GPGERR_VERSION )
__run_gpgerr_config ( cflags GPGERR_INCLUDE_DIRS )
__run_gpgerr_config ( cflags GPGERR_INCLUDE_DIRS )
__run_gpgerr_config ( libs GPGERR_LIBRARIES )
__run_gpgerr_config ( libs GPGERR_LIBRARIES )
# c l e a n u p
if ( GPGME_INCLUDE_DIRS )
string ( REGEX REPLACE "(^| +)-I" ";" GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS}" )
endif ( )
if ( GPGME_LIBRARIES )
string ( REGEX REPLACE "(^| +)-l" ";" GPGME_LIBRARIES "${GPGME_LIBRARIES}" )
endif ( )
if ( GPGERR_INCLUDE_DIRS )
if ( GPGERR_INCLUDE_DIRS )
string ( REGEX REPLACE "(^| +)-I" ";" GPGERR_INCLUDE_DIRS "${GPGERR_INCLUDE_DIRS}" )
string ( REGEX REPLACE "(^| +)-I" ";" GPGERR_INCLUDE_DIRS "${GPGERR_INCLUDE_DIRS}" )
endif ( )
endif ( )
if ( GPGERR_LIBRARIES )
if ( GPGERR_LIBRARIES )
string ( REGEX REPLACE "(^| +)-l" ";" GPGERR_LIBRARIES "${GPGERR_LIBRARIES}" )
string ( REGEX REPLACE "(^| +)-l" ";" GPGERR_LIBRARIES "${GPGERR_LIBRARIES}" )
endif ( )
endif ( )
set ( GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS};${GPGERR_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE )
set( GPGME_LIBRARIES "${GPGME_LIBRARIES};${GPGERR_LIBRARIES}" CACHE INTERNAL "" FORCE )
endif( )
# a s s u m i n g t h a t a l l n e w e r s y s t e m h a v e g p g m e > = 0 . 4
# a s s u m i n g t h a t a l l n e w e r s y s t e m h a v e g p g m e > = 0 . 4
set ( GPGME_INCLUDE_DIRS "${GPGME_INCLUDE_DIRS};${GPGERR_INCLUDE_DIRS}" CACHE INTERNAL "" FORCE )
set ( GPGME_LIBRARIES "${GPGME_LIBRARIES};${GPGERR_LIBRARIES}" CACHE INTERNAL "" FORCE )
set ( HAVE_GPGME_0_4_BRANCH 1 CACHE INTERNAL "" )
set ( HAVE_GPGME_0_4_BRANCH 1 CACHE INTERNAL "" )
# N O T E : a s s u m e w e h a v e l a r g e f i l e support ( need for gpgme )
# F I X M E : t o b e s u r e , w e m u s t c h e c k i t
add_definitions ( -D_FILE_OFFSET_BITS=64 )
if ( NOT HAVE_GPGME_0_4_BRANCH )
message ( STATUS " found 'gpgme', version ${GPGME_VERSION}" )
message ( STATUS " found 'gpgme', version ${GPGME_VERSION}" )
endif ( )
# c h e c k f o r v a r i o u s G P G M E f e a t u r e s
# c h e c k f o r v a r i o u s G P G M E f e a t u r e s
tde_save ( CMAKE_CXX_FLAGS )
tde_save ( CMAKE_CXX_FLAGS )
tde_save ( CMAKE_REQUIRED_INCLUDES )
tde_save ( CMAKE_REQUIRED_INCLUDES )
tde_save ( CMAKE_REQUIRED_LIBRARIES )
tde_save ( CMAKE_REQUIRED_LIBRARIES )
string ( REGEX REPLACE "-include tqt.h" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
string ( REGEX REPLACE "-include tqt.h" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
# S e e F I X M E a b o v e r e g a r d i n g - D _ F I L E _ O F F S E T _ B I T S = 6 4
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LARGEFILES_DEFINITIONS}" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_FILE_OFFSET_BITS=64" )
set ( CMAKE_REQUIRED_INCLUDES "${GPGME_INCLUDE_DIRS}" )
set ( CMAKE_REQUIRED_INCLUDES "${GPGME_INCLUDE_DIRS}" )
set ( CMAKE_REQUIRED_LIBRARIES "${GPGME_LIBRARIES}" )
set ( CMAKE_REQUIRED_LIBRARIES "${GPGME_LIBRARIES}" )