Skip to content

cmake: Switch from tri-state options to boolean. Stage FOUR - #169

Merged
hebasto merged 4 commits into
cmake-stagingfrom
240424-cmake-EC
May 1, 2024
Merged

hebasto merged 4 commits into
cmake-stagingfrom
240424-cmake-EC

Conversation

@hebasto

@hebasto hebasto commented Apr 24, 2024

Copy link
Copy Markdown
Owner

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
Comment thread 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

Copy link
Copy Markdown

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
Copy Markdown
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

hebasto commented Apr 25, 2024

Copy link
Copy Markdown
Owner Author

Rebased to resolve conflicts.

Comment thread cmake/module/FindBerkeleyDB.cmake Resolved
Comment thread cmake/optional_qt.cmake Resolved
Comment thread CMakeLists.txt
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)

Copy link
Copy Markdown

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

@sedited sedited left a comment

Copy link
Copy Markdown

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
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