1 # Copyright (c) 2019-2020 The Bitcoin developers
2 # Distributed under the MIT software license, see the accompanying
3 # file COPYING or http://www.opensource.org/licenses/mit-license.php.
9 # Find the QREncode library. The following
10 # components are available::
13 # This will define the following variables::
15 # QREncode_FOUND - system has QREncode lib
16 # QREncode_INCLUDE_DIRS - the QREncode include directories
17 # QREncode_LIBRARIES - Libraries needed to use QREncode
19 # And the following imported target::
24 find_brew_prefix(_QREncode_BREW_HINT qrencode)
26 find_package(PkgConfig)
27 pkg_check_modules(PC_QREncode QUIET libqrencode)
29 find_path(QREncode_INCLUDE_DIR
31 HINTS ${_QREncode_BREW_HINT}
32 PATHS ${PC_QREncode_INCLUDE_DIRS}
36 set(QREncode_INCLUDE_DIRS "${QREncode_INCLUDE_DIR}")
37 mark_as_advanced(QREncode_INCLUDE_DIR)
39 # TODO: extract a version number.
40 # For now qrencode does not provide an easy way to extract a version number.
42 if(QREncode_INCLUDE_DIR)
43 include(ExternalLibraryHelper)
44 find_component(QREncode qrencode
46 HINTS ${_QREncode_BREW_HINT}
47 PATHS ${PC_QREncode_LIBRARY_DIRS}
48 INCLUDE_DIRS ${QREncode_INCLUDE_DIRS}
52 include(FindPackageHandleStandardArgs)
53 find_package_handle_standard_args(QREncode
56 REASON_FAILURE_MESSAGE "if displaying QR codes is not required, it can be skipped by passing -DENABLE_QRCODE=OFF to the cmake command line"