From 8cae602e66f593bb2af1c5bbcbd3e48476a58596 Mon Sep 17 00:00:00 2001 From: Benjamin Gordon Date: Tue, 12 Jun 2018 23:19:48 -0600 Subject: [PATCH] Add support for libsecret to cmake gnucash has historically supported storing passwords for database backends with libsecret when HAVE_LIBSECRET is defined. The code is still present, but support for detecting libsecret's availablity was not ported over when the build system was converted to cmake. This change restores the missing detection. --- CMakeLists.txt | 5 +++++ cmake/README_CMAKE.txt | 5 ++--- gnucash/gnome-utils/CMakeLists.txt | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 989d5791bb..8207055837 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -505,6 +505,11 @@ find_program(POD2MAN_EXECUTABLE pod2man HINTS ${PERL_DIR}) gnc_pkg_check_modules (ICU4C REQUIRED icu-uc) gnc_pkg_check_modules (ICU4C_I18N REQUIRED icu-i18n) +GNC_PKG_CHECK_MODULES (LIBSECRET libsecret-1>=0.18) +IF (LIBSECRET_FOUND) + SET (HAVE_LIBSECRET ON) +ENDIF (LIBSECRET_FOUND) + #BOOST set (Boost_USE_MULTITHREADED ON) set (Boost_FIND_QUIETLY ON) diff --git a/cmake/README_CMAKE.txt b/cmake/README_CMAKE.txt index 8d2ce15e57..c0ca35da46 100644 --- a/cmake/README_CMAKE.txt +++ b/cmake/README_CMAKE.txt @@ -45,9 +45,8 @@ Limitations include: * Not all options available in `./configure` have been ported to this CMake system. - * Password management is included for OS X, but not - tested. Gnome-keyring and libsecret support has not - been ported over. + * Password management is included for OS X and libsecret, but not + tested. Gnome-keyring support has not been ported over. * The Xcode build only supports the Debug configuration. Others such as Release are not supported yet. diff --git a/gnucash/gnome-utils/CMakeLists.txt b/gnucash/gnome-utils/CMakeLists.txt index f772cb09cf..4f1bac715d 100644 --- a/gnucash/gnome-utils/CMakeLists.txt +++ b/gnucash/gnome-utils/CMakeLists.txt @@ -212,7 +212,7 @@ add_library (gncmod-gnome-utils ) target_link_libraries(gncmod-gnome-utils gncmod-app-utils gncmod-engine gnc-backend-xml-utils - ${CMAKE_DL_LIBS} ${GTK3_LDFLAGS} ${GTK_MAC_LDFLAGS}) + ${CMAKE_DL_LIBS} ${GTK3_LDFLAGS} ${LIBSECRET_LDFLAGS} ${GTK_MAC_LDFLAGS}) target_compile_definitions(gncmod-gnome-utils PUBLIC ${GTK_MAC_CFLAGS_OTHER} PRIVATE -DG_LOG_DOMAIN=\"gnc.gui\") @@ -232,6 +232,7 @@ target_include_directories(gncmod-gnome-utils ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${GTK_MAC_INCLUDE_DIRS} + ${LIBSECRET_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR} )