QGIS/cmake/FindQtKeychain.cmake
Alessandro Pasotti 090d5305e5 [feature][needs-docs] Master Password integration with OS password manager
This PR adds (optional) synchronization of the master password
with the OS password manager (AKA wallet/keychain).

A set of new menu items has been added in the options ->
authentication -> utilities to manage the new behavior.

Notifications are handled by the message bar unless the
password r/w operation is triggered from a modal dialog,
in this case the notifications will be routed through
the recently exposed QgisApp::showSystemNotification
that uses the OS tray notifications.

This new feature requires libqt5keychain, and was tested
with v. 0.5+
2017-04-11 15:00:29 +02:00

52 lines
1.3 KiB
CMake

# Find QtKeychain
# ~~~~~~~~~~~~~~~
# Copyright (c) 2016, Boundless Spatial
# Author: Larry Shaffer <lshaffer (at) boundlessgeo (dot) com>
#
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
#
# CMake module to search for QtKeychain library from:
# https://github.com/frankosterfeld/qtkeychain
#
# If it's found it sets QTKEYCHAIN_FOUND to TRUE
# and following variables are set:
# QTKEYCHAIN_INCLUDE_DIR
# QTKEYCHAIN_LIBRARY
FIND_PATH(QTKEYCHAIN_INCLUDE_DIR keychain.h
PATHS
${LIB_DIR}/include
"$ENV{LIB_DIR}/include"
$ENV{INCLUDE}
/usr/local/include
/usr/include
PATH_SUFFIXES qt5keychain qtkeychain
)
FIND_LIBRARY(QTKEYCHAIN_LIBRARY NAMES qt5keychain qtkeychain
PATHS
${LIB_DIR}
"$ENV{LIB_DIR}"
$ENV{LIB}
/usr/local/lib
/usr/lib
)
IF (QTKEYCHAIN_INCLUDE_DIR AND QTKEYCHAIN_LIBRARY)
SET(QTKEYCHAIN_FOUND TRUE)
ELSE()
SET(QTKEYCHAIN_FOUND FALSE)
ENDIF (QTKEYCHAIN_INCLUDE_DIR AND QTKEYCHAIN_LIBRARY)
IF (QTKEYCHAIN_FOUND)
IF (NOT QTKEYCHAIN_FIND_QUIETLY)
MESSAGE(STATUS "Found QtKeychain: ${QTKEYCHAIN_LIBRARY}")
ENDIF (NOT QTKEYCHAIN_FIND_QUIETLY)
ELSE (QTKEYCHAIN_FOUND)
IF (QTKEYCHAIN_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find QtKeychain")
ENDIF (QTKEYCHAIN_FIND_REQUIRED)
ENDIF (QTKEYCHAIN_FOUND)