cmake: Use HINTS instead of PATHS in find_* commands

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.
This commit is contained in:
Hennadii Stepanov
2025-06-24 20:49:27 +01:00
parent ad654a4807
commit ead4468748

View File

@ -21,16 +21,16 @@ endif()
find_path(QRencode_INCLUDE_DIR
NAMES qrencode.h
PATHS ${PC_QRencode_INCLUDE_DIRS}
HINTS ${PC_QRencode_INCLUDE_DIRS}
)
find_library(QRencode_LIBRARY_RELEASE
NAMES qrencode
PATHS ${PC_QRencode_LIBRARY_DIRS}
HINTS ${PC_QRencode_LIBRARY_DIRS}
)
find_library(QRencode_LIBRARY_DEBUG
NAMES qrencoded qrencode
PATHS ${PC_QRencode_LIBRARY_DIRS}
HINTS ${PC_QRencode_LIBRARY_DIRS}
)
include(SelectLibraryConfigurations)
select_library_configurations(QRencode)