This PR introduces the FindQRencode
CMake module, following the official CMake guidelines for managing upstream libraries that lack a config file package. This module enhances flexibility in locating the libqrencode
library by making the use of pkg-config
optional.
With this update, libqrencode
can be detected on systems where either pkg-config
or the libqrencode.pc
file is unavailable, such as Windows environments using the vcpkg package manager. However, if libqrencode.pc
is available, it remains beneficial as the only direct source of the library’s version information.
Additionally, the libqrencode
vcpkg package is enabled for MSVC builds.
Here is a diff for configuration output on Ubuntu 24.10:
0 -- Detecting CXX compile features - done
1 -- Found SQLite3: /usr/include (found suitable version "3.46.1", minimum required is "3.7.17")
2 -- Found PkgConfig: /usr/bin/pkg-config (found version "1.8.1")
3--- Checking for module 'libqrencode'
4--- Found libqrencode, version 4.1.1
5+-- Found QRencode: /usr/lib/x86_64-linux-gnu/libqrencode.so (found version "4.1.1")
6 -- Found Qt: /usr/lib/x86_64-linux-gnu/cmake/Qt5 (found suitable version "5.15.15", minimum required is "5.11.3")
7 -- Performing Test CXX_SUPPORTS__WERROR
8 -- Performing Test CXX_SUPPORTS__WERROR - Success