mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 10:47:59 +08:00
FindPkgConfig: Restore preference for first pkg-config in PATH
Since commit ab8bd48352
(FindPkgConfig: Search for pkg-config.bat file
on a Windows host, 2020-09-25, v3.19.0-rc1~98^2) we prefer
`pkg-config.bat` over `pkg-config` regardless of the order they appear
in the `PATH`. Tell `find_program` to consider all names in each
directory so that the first one in `PATH` of any name wins.
Issue: #21239
This commit is contained in:
@@ -37,7 +37,10 @@ if(CMAKE_HOST_WIN32)
|
||||
list(PREPEND PKG_CONFIG_NAMES "pkg-config.bat")
|
||||
endif()
|
||||
|
||||
find_program(PKG_CONFIG_EXECUTABLE NAMES ${PKG_CONFIG_NAMES} DOC "pkg-config executable")
|
||||
find_program(PKG_CONFIG_EXECUTABLE
|
||||
NAMES ${PKG_CONFIG_NAMES}
|
||||
NAMES_PER_DIR
|
||||
DOC "pkg-config executable")
|
||||
mark_as_advanced(PKG_CONFIG_EXECUTABLE)
|
||||
|
||||
set(_PKG_CONFIG_FAILURE_MESSAGE "")
|
||||
|
Reference in New Issue
Block a user