diff options
author | Jocelyn Turcotte <jturcotte@woboq.com> | 2017-05-08 19:19:29 +0300 |
---|---|---|
committer | Jocelyn Turcotte <jturcotte@woboq.com> | 2017-05-09 00:18:06 +0300 |
commit | dca2b673380409d888df3604524815e4f4b8ff16 (patch) | |
tree | 7284ac4bc1d8a2fdf12ef69958a4884fe7b2c279 /cmake | |
parent | ea691aa2a05101f1a8e79d2dc59306a8647ce582 (diff) |
Favor QtKeychain installed together with Qt
By default we will look in /usr/lib, which would prevent us from
using a different path for Qt as QtKeychain depends on Qt itself.
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/modules/FindQt5Keychain.cmake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cmake/modules/FindQt5Keychain.cmake b/cmake/modules/FindQt5Keychain.cmake index 809b9d659..6848763fe 100644 --- a/cmake/modules/FindQt5Keychain.cmake +++ b/cmake/modules/FindQt5Keychain.cmake @@ -9,9 +9,17 @@ # 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) +get_filename_component(QT_LIB_DIR "${_QTCORE_LIB_PATH}" DIRECTORY) + find_path(QTKEYCHAIN_INCLUDE_DIR NAMES keychain.h + HINTS + ${QT_LIB_DIR}/../include PATH_SUFFIXES qt5keychain ) @@ -20,6 +28,8 @@ find_library(QTKEYCHAIN_LIBRARY NAMES qt5keychain lib5qtkeychain + HINTS + ${QT_LIB_DIR} PATHS /usr/lib /usr/lib/${CMAKE_ARCH_TRIPLET} |