Skip to content
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

Merged
merged 4 commits into from
May 1, 2024

Conversation

hebasto
Copy link
Owner

@hebasto hebasto commented Apr 24, 2024

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.

@hebasto hebasto marked this pull request as draft April 24, 2024 15:18
@hebasto hebasto marked this pull request as ready for review April 24, 2024 15:54
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

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.

Copy link
Owner Author

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.

@hebasto hebasto added the enhancement New feature or request label Apr 25, 2024
@hebasto
Copy link
Owner Author

hebasto commented Apr 25, 2024

Rebased to resolve conflicts.

cmake/module/FindBerkeleyDB.cmake Outdated Show resolved Hide resolved
cmake/optional_qt.cmake Outdated Show resolved Hide resolved
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)

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

Copy link

@TheCharlatan TheCharlatan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@hebasto hebasto merged commit 3c26fec into cmake-staging May 1, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants