Use cmake_symbol_check to test for AB_Banking_RuntimeConfig_SetCharValue

instead of relying on AQBanking versions.
This commit is contained in:
John Ralls
2019-08-11 09:43:27 -07:00
parent 2a6a4e34d6
commit adae341def
3 changed files with 12 additions and 4 deletions

View File

@@ -45,6 +45,7 @@ include (GncAddTest)
include (MakeDistFiles) include (MakeDistFiles)
include (GNUInstallDirs) include (GNUInstallDirs)
include (TestBigEndian) include (TestBigEndian)
include (CheckSymbolExists)
# ############################################################ # ############################################################
# These options are settable from the CMake command line. For example, to disable # These options are settable from the CMake command line. For example, to disable
@@ -359,6 +360,13 @@ endif ()
if (WITH_AQBANKING) if (WITH_AQBANKING)
pkg_check_modules (GWENHYWFAR REQUIRED gwenhywfar>=4.9.99) pkg_check_modules (GWENHYWFAR REQUIRED gwenhywfar>=4.9.99)
pkg_check_modules (AQBANKING REQUIRED aqbanking>=5.3.4) pkg_check_modules (AQBANKING REQUIRED aqbanking>=5.3.4)
set(CMAKE_REQUIRED_INCLUDES "${AQBANKING_INCLUDE_DIRS}"
"${GWENHYWFAR_INCLUDE_DIRS}")
set(CMAKE_REQUIRED_LIBRARIES "-laqbanking")
check_symbol_exists("AB_Banking_RuntimeConfig_SetCharValue"
"aqbanking/banking.h" AQB_HAS_RUNTIME_CONFIG)
set(CMAKE_REQUIRED_INCLUDES)
set(CMAKE_REQUIRED_LIBRARIES)
if(WITH_GNUCASH) if(WITH_GNUCASH)
pkg_check_modules (GWEN_GTK3 gwengui-gtk3) pkg_check_modules (GWEN_GTK3 gwengui-gtk3)
if(GWEN_GTK3_FOUND AND GWEN_GTK3_VERSION VERSION_GREATER "4.20.0") if(GWEN_GTK3_FOUND AND GWEN_GTK3_VERSION VERSION_GREATER "4.20.0")

View File

@@ -363,6 +363,9 @@
#cmakedefine WEBKIT2_3 1 #cmakedefine WEBKIT2_3 1
#cmakedefine WEBKIT1 1 #cmakedefine WEBKIT1 1
/* Definition for AQBanking Runtime Config feature */
#cmakedefine AQB_HAS_RUNTIME_CONFIG 1
/* Definitions for all OS */ /* Definitions for all OS */
/* From cutecash */ /* From cutecash */
//#define HAVE_LIBQOF /**/ //#define HAVE_LIBQOF /**/

View File

@@ -159,10 +159,7 @@ gnc_AB_BANKING_new(void)
api = AB_Banking_new("gnucash", NULL, 0); api = AB_Banking_new("gnucash", NULL, 0);
g_return_val_if_fail(api, NULL); g_return_val_if_fail(api, NULL);
#if AQBANKING_VERSION_INT >= 59925 \ #if AQB_HAS_RUNTIME_CONFIG
|| (AQBANKING_VERSION_INT == 59924 && AQBANKING_VERSION_BUILD >= 1) \
|| (AQBANKING_VERSION_INT >= 50709 && AQBANKING_VERSION_INT < 59900) \
|| (AQBANKING_VERSION_INT == 50708 && AQBANKING_VERSION_BUILD >= 1)
/* These two values must be set because newest bank regulation requires /* These two values must be set because newest bank regulation requires
the bank servers to require it. The string itself results from our the bank servers to require it. The string itself results from our
registration with the German bank association at registration with the German bank association at