cmake: Switch from tri-state options to boolean. Stage FOUR#169
Merged
Conversation
9b3bb40 to
ea4bb59
Compare
fanquake
reviewed
Apr 25, 2024
| 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.
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.
Owner
Author
There was a problem hiding this comment.
I agree. The comment has been dropped.
ea4bb59 to
6c72c2e
Compare
Owner
Author
|
Rebased to resolve conflicts. |
theuni
reviewed
Apr 29, 2024
21e245c to
c744830
Compare
c744830 to
5de23c7
Compare
sedited
reviewed
May 1, 2024
| 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.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is a continuation of #161, #162 and #164 and tackles with the
WITH_QRENCODEoptions.It becomes enabled when building GUI with the default value
ON.