BUILD(cmake): Fix incorrect usage of pkg_search_module

The incorrect use of this function caused calls to get_pkgconf_variable
to fail.

Fixes #6038
This commit is contained in:
Robert Adam 2023-04-07 12:42:04 +02:00
parent d748235f33
commit fb3f115692

View File

@ -252,8 +252,8 @@ function(get_pkgconf_variable)
message(FATAL_ERROR "get_pkgconf_variable: pkg-config was not found - can't use it to fetch variables")
endif()
pkg_search_module("${GET_PKGCONF_VAR_MODULE}" QUIET)
if(NOT ${GET_PKGCONF_VAR_MODULE}_FOUND)
pkg_search_module("PKGCONF_MODULE" "${GET_PKGCONF_VAR_MODULE}" QUIET)
if(NOT PKGCONF_MODULE_FOUND)
if(GET_PKGCONF_VAR_DEBUG)
message(STATUS "Unable to find module \"${GET_PKGCONF_VAR_MODULE}\" via pkg-conf")
set(VAR_VALUE "NOTFOUND")