[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