Skip to content

Commit 8fafb81

Browse files
committed
Merge bitcoin/bitcoin#32805: cmake: Use HINTS instead of PATHS in find_* commands
ead4468 cmake: Use `HINTS` instead of `PATHS` in `find_*` commands (Hennadii Stepanov) Pull request description: According to the CMake documentation, `HINTS` "should be paths computed by system introspection, such as a hint provided by the location of another item already found", which is precisely the case in the `FindQRencode` module. Entries in `HINTS` are searched before those in `PATHS`. On macOS, Homebrew’s `libqrencode` will therefore be located at its real path rather than via the symlink in the default prefix. A backport to 29.x is required for bitcoin/bitcoin#32804, as this change prevents contamination of include directories by broad locations such as `/usr/local/include` or `/opt/homebrew/include`, which take precedence over Qt’s `-iframework` flags. Below is the relevant change in the configuration logs on my macOS 15.5 `x64`: - master branch @ ead4468: ``` % cmake -B build -DBUILD_GUI=ON <snip> -- Found QRencode: /usr/local/lib/libqrencode.dylib (found version "4.1.1") <snip> ``` - this PR: ``` % cmake -B build -DBUILD_GUI=ON <snip> -- Found QRencode: /usr/local/Cellar/qrencode/4.1.1/lib/libqrencode.dylib (found version "4.1.1") <snip> ``` ACKs for top commit: fanquake: ACK ead4468 Tree-SHA512: 1f0b04e3efeb7fe3efbb969be911abbcf56030d715acd87c0fbaf24422cdf1122f169e32242571256916c96a159212842e1e73092145c63ecc495ce429c6e587
2 parents e5f9218 + ead4468 commit 8fafb81

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

cmake/module/FindQRencode.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ endif()
2121

2222
find_path(QRencode_INCLUDE_DIR
2323
NAMES qrencode.h
24-
PATHS ${PC_QRencode_INCLUDE_DIRS}
24+
HINTS ${PC_QRencode_INCLUDE_DIRS}
2525
)
2626

2727
find_library(QRencode_LIBRARY_RELEASE
2828
NAMES qrencode
29-
PATHS ${PC_QRencode_LIBRARY_DIRS}
29+
HINTS ${PC_QRencode_LIBRARY_DIRS}
3030
)
3131
find_library(QRencode_LIBRARY_DEBUG
3232
NAMES qrencoded qrencode
33-
PATHS ${PC_QRencode_LIBRARY_DIRS}
33+
HINTS ${PC_QRencode_LIBRARY_DIRS}
3434
)
3535
include(SelectLibraryConfigurations)
3636
select_library_configurations(QRencode)

0 commit comments

Comments
 (0)