HomePhabricator

[CMAKE] Add support for libqrencode

Description

[CMAKE] Add support for libqrencode

Summary:
This diff adds an option to enable the QR code display (in the payment
request dialog).

The QR code is enabled by default and can be disabled by setting
-DENABLE_QRCODE=OFF on the cmake command line.

If either QT or the wallet is not built, the option is not used.

Test Plan:
With libqrencode installed:

mkdir buildcmake && cd buildcmake
cmake -GNinja ..
ninja
./src/qt/bitcoin-qt

Go the the Receive tab and click the Request payment button.
A QR code should be displayed.

rm -rf *
cmake -GNinja -DENABLE_QRCODE=OFF ..
ninja
./src/qt/bitcoin-qt

Go the the Receive tab and click the `` button.
The QR code should not be displayed.

Uninstall libqrencode. On Debian: sudo apt remove libqrencode*

rm -rf *
cmake -GNinja ..

CMake should output an error:

Could NOT find QREncode (missing: QRENCODE_INCLUDE_DIR QRENCODE_LIBRARY)
rm -rf *
cmake -GNinja .. -DBUILD_BITCOIN_WALLET=OFF
ninja

The build should be successful.

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D3015

Details

Provenance
FabienAuthored on May 9 2019, 10:15
FabienPushed on May 20 2019, 06:59
Reviewer
Restricted Project
Differential Revision
D3015: [CMAKE] Add support for libqrencode
Parents
rABC8f667b97fc01: [CI] Run functional tests both pre and post graviton
Branches
Unknown
Tags
Unknown