-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmake: Switch from tri-state options to boolean. Stage FOUR #169
Conversation
9b3bb40
to
ea4bb59
Compare
CMakeLists.txt
Outdated
cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "WITH_GUI" OFF) | ||
if(WITH_QRENCODE) | ||
if(VCPKG_TARGET_TRIPLET) | ||
# TODO: vcpkg fails to build libqrencode package due to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see this is move only, but we shouldn't be adding comments like this to our build system, as we aren't a vcpkg (or any other package manager) issue tracker. Especially since this is about a (sub)-dependency we don't even use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. The comment has been dropped.
ea4bb59
to
6c72c2e
Compare
Rebased to resolve conflicts. |
21e245c
to
c744830
Compare
c744830
to
5de23c7
Compare
cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "WITH_GUI" OFF) | ||
if(WITH_QRENCODE) | ||
find_package(PkgConfig REQUIRED) | ||
pkg_check_modules(libqrencode REQUIRED IMPORTED_TARGET libqrencode) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only tangentially related to this PR, but the error printed by pkg_check_modules
is kind of ugly for a user facing message:
CMake Error at /usr/share/cmake-3.28/Modules/FindPkgConfig.cmake:619 (message):
The following required packages were not found:
- libqrencode
Call Stack (most recent call first):
/usr/share/cmake-3.28/Modules/FindPkgConfig.cmake:841 (_pkg_check_modules_internal)
CMakeLists.txt:123 (pkg_check_modules)
Would be nice to have something along the lines of what configure would print in a similar case:
configure: error: QR support requested but cannot be built. Use --without-qrencode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This PR is a continuation of #161, #162 and #164 and tackles with the
WITH_QRENCODE
options.It becomes enabled when building GUI with the default value
ON
.