From: Kevin Ottens Date: Thu, 29 Oct 2020 12:24:20 +0000 (+0100) Subject: Get rid of FindQt5Keychain.cmake X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~78^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=3427dadaeb3527e6fe395b5aa5a0e6b299afc98b;p=nextcloud-desktop.git Get rid of FindQt5Keychain.cmake QtKeychain provides Qt5KeychainConfig.cmake and friends nowadays, so no need to have a less reliable and outdated find module on our end. Also this shows that we were including keychain.h in the wrong way and were not using the link target, so both got fixed as well. Signed-off-by: Kevin Ottens --- diff --git a/cmake/modules/FindQt5Keychain.cmake b/cmake/modules/FindQt5Keychain.cmake deleted file mode 100644 index 4aff32d6f..000000000 --- a/cmake/modules/FindQt5Keychain.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# (c) 2014 Copyright ownCloud GmbH -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING* file. - -# - Try to find QtKeychain -# Once done this will define -# QTKEYCHAIN_FOUND - System has QtKeychain -# QTKEYCHAIN_INCLUDE_DIRS - The QtKeychain include directories -# QTKEYCHAIN_LIBRARIES - The libraries needed to use QtKeychain -# QTKEYCHAIN_DEFINITIONS - Compiler switches required for using LibXml2 - -# When we build our own Qt we also need to build QtKeychain with it -# so that it doesn't pull a different Qt version. For that reason -# first look in the Qt lib directory for QtKeychain. -get_target_property(_QTCORE_LIB_PATH Qt5::Core IMPORTED_LOCATION_RELEASE) - -# Use PATH here because Debian 7.0 has CMake 2.8.9 and DIRECTORY is only available from 2.8.12+ -get_filename_component(QT_LIB_DIR "${_QTCORE_LIB_PATH}" PATH) - -find_path(QTKEYCHAIN_INCLUDE_DIR - NAMES - keychain.h - HINTS - ${QT_LIB_DIR}/../include - PATH_SUFFIXES - qt5keychain - ) - -find_library(QTKEYCHAIN_LIBRARY - NAMES - qt5keychain - lib5qtkeychain - HINTS - ${QT_LIB_DIR} - PATHS - /usr/lib - /usr/lib/${CMAKE_ARCH_TRIPLET} - /usr/local/lib - /opt/local/lib - ${CMAKE_LIBRARY_PATH} - ${CMAKE_INSTALL_PREFIX}/lib - ) - -include(FindPackageHandleStandardArgs) -# handle the QUIETLY and REQUIRED arguments and set QTKEYCHAIN_FOUND to TRUE -# if all listed variables are TRUE -find_package_handle_standard_args(Qt5Keychain DEFAULT_MSG - QTKEYCHAIN_LIBRARY QTKEYCHAIN_INCLUDE_DIR) - -mark_as_advanced(QTKEYCHAIN_INCLUDE_DIR QTKEYCHAIN_LIBRARY) diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 000d00752..2ff8c17ac 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -227,9 +227,8 @@ set( final_src ${3rdparty_MOC} ) -if(QTKEYCHAIN_FOUND OR QT5KEYCHAIN_FOUND) - list(APPEND libsync_LINK_TARGETS ${QTKEYCHAIN_LIBRARY}) - include_directories(${QTKEYCHAIN_INCLUDE_DIR}) +if(Qt5Keychain_FOUND) + list(APPEND libsync_LINK_TARGETS qt5keychain) endif() # add executable icon on windows and osx diff --git a/src/gui/creds/shibbolethcredentials.cpp b/src/gui/creds/shibbolethcredentials.cpp index b19133785..e56ed8be4 100644 --- a/src/gui/creds/shibbolethcredentials.cpp +++ b/src/gui/creds/shibbolethcredentials.cpp @@ -33,7 +33,7 @@ #include "owncloudgui.h" #include "syncengine.h" -#include +#include using namespace QKeychain; diff --git a/src/gui/proxyauthhandler.cpp b/src/gui/proxyauthhandler.cpp index 9c2703bda..a2f11bce2 100644 --- a/src/gui/proxyauthhandler.cpp +++ b/src/gui/proxyauthhandler.cpp @@ -21,7 +21,7 @@ #include -#include +#include using namespace OCC; using namespace QKeychain; diff --git a/src/libsync/CMakeLists.txt b/src/libsync/CMakeLists.txt index aef76d246..d7957dab8 100644 --- a/src/libsync/CMakeLists.txt +++ b/src/libsync/CMakeLists.txt @@ -106,8 +106,7 @@ target_link_libraries(${synclib_NAME} if (NOT TOKEN_AUTH_ONLY) find_package(Qt5 REQUIRED COMPONENTS Widgets Svg) - target_link_libraries(${synclib_NAME} Qt5::Widgets Qt5::Svg ${QTKEYCHAIN_LIBRARY}) - target_include_directories(${synclib_NAME} PRIVATE ${QTKEYCHAIN_INCLUDE_DIR}) + target_link_libraries(${synclib_NAME} Qt5::Widgets Qt5::Svg qt5keychain) endif() if(INOTIFY_FOUND) diff --git a/src/libsync/account.cpp b/src/libsync/account.cpp index 5477edcd9..b6709e7fa 100644 --- a/src/libsync/account.cpp +++ b/src/libsync/account.cpp @@ -40,7 +40,7 @@ #include #include -#include +#include #include "creds/abstractcredentials.h" using namespace QKeychain; diff --git a/src/libsync/clientsideencryption.cpp b/src/libsync/clientsideencryption.cpp index 134a83425..dcd512d1b 100644 --- a/src/libsync/clientsideencryption.cpp +++ b/src/libsync/clientsideencryption.cpp @@ -33,7 +33,7 @@ #include #include -#include +#include #include "common/utility.h" #include "wordlist.h" diff --git a/src/libsync/creds/httpcredentials.cpp b/src/libsync/creds/httpcredentials.cpp index 9b1d10a9e..551d2f3cd 100644 --- a/src/libsync/creds/httpcredentials.cpp +++ b/src/libsync/creds/httpcredentials.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include "account.h" #include "accessmanager.h" diff --git a/src/libsync/creds/keychainchunk.h b/src/libsync/creds/keychainchunk.h index 4c31eca16..0a08b8f2f 100644 --- a/src/libsync/creds/keychainchunk.h +++ b/src/libsync/creds/keychainchunk.h @@ -17,7 +17,7 @@ #define KEYCHAINCHUNK_H #include -#include +#include #include "accountfwd.h" // We don't support insecure fallback