mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
Merge topic 'pkg_config_detailed_error'
ab8bd48352FindPkgConfig: Search for pkg-config.bat file on a Windows host3201dd521eFindPkgConfig: Show more info when pkg-config --version fails Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5273
This commit is contained in:
@@ -31,7 +31,13 @@ set(PKG_CONFIG_VERSION 1)
|
||||
if((NOT PKG_CONFIG_EXECUTABLE) AND (NOT "$ENV{PKG_CONFIG}" STREQUAL ""))
|
||||
set(PKG_CONFIG_EXECUTABLE "$ENV{PKG_CONFIG}" CACHE FILEPATH "pkg-config executable")
|
||||
endif()
|
||||
find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
|
||||
|
||||
set(PKG_CONFIG_NAMES "pkg-config")
|
||||
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")
|
||||
mark_as_advanced(PKG_CONFIG_EXECUTABLE)
|
||||
|
||||
set(_PKG_CONFIG_FAILURE_MESSAGE "")
|
||||
@@ -47,7 +53,9 @@ if (PKG_CONFIG_EXECUTABLE)
|
||||
string(APPEND _PKG_CONFIG_FAILURE_MESSAGE
|
||||
"The command\n"
|
||||
" \"${PKG_CONFIG_EXECUTABLE}\" --version\n"
|
||||
" failed with output\n${_PKG_CONFIG_VERSION_ERROR}"
|
||||
" failed with output:\n${PKG_CONFIG_VERSION_STRING}\n"
|
||||
" stderr: \n${_PKG_CONFIG_VERSION_ERROR}\n"
|
||||
" result: \n${_PKG_CONFIG_VERSION_RESULT}"
|
||||
)
|
||||
set(PKG_CONFIG_EXECUTABLE "")
|
||||
unset(PKG_CONFIG_VERSION_STRING)
|
||||
|
||||
Reference in New Issue
Block a user