Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Adam <dev@robert-adam.de>2022-09-12 16:37:55 +0300
committerGitHub <noreply@github.com>2022-09-12 16:37:55 +0300
commitabbb4cf9f1728beb264ad9be54be345aaa4c3d2e (patch)
treea69fe47c5bc8abd62d6cf43d985a649cc5358807
parent8826f1ec63dd3986efa6be06dd620f37491c01fc (diff)
parentc7b127f7be7f8c6692dbfbaf37aba63f0dcce4e6 (diff)
Merge PR #5881: BUILD(cmake): Silence pkg-config warnings
-rw-r--r--cmake/pkg-utils.cmake36
1 files changed, 22 insertions, 14 deletions
diff --git a/cmake/pkg-utils.cmake b/cmake/pkg-utils.cmake
index fabccdd26..c21f3dc2f 100644
--- a/cmake/pkg-utils.cmake
+++ b/cmake/pkg-utils.cmake
@@ -249,24 +249,32 @@ function(get_pkgconf_variable)
message(FATAL_ERROR "get_pkgconf_variable: pkg-config was not found - can't use it to fetch variables")
endif()
- if(GET_PKGCONF_VAR_DEBUG)
- message(STATUS "get_pkgconf_variable: Searching for \"${GET_PKGCONF_VAR_VARIABLE_NAME}\" in module \"${GET_PKGCONF_VAR_MODULE}\"")
- endif()
+ pkg_search_module("${GET_PKGCONF_VAR_MODULE}" QUIET)
+ if(NOT ${GET_PKGCONF_VAR_MODULE}_FOUND)
+ if(GET_PKGCONF_VAR_DEBUG)
+ message(STATUS "Unable to find module \"${GET_PKGCONF_VAR_MODULE}\" via pkg-conf")
+ set(VAR_VALUE "NOTFOUND")
+ endif()
+ else()
+ if(GET_PKGCONF_VAR_DEBUG)
+ message(STATUS "get_pkgconf_variable: Searching for \"${GET_PKGCONF_VAR_VARIABLE_NAME}\" in module \"${GET_PKGCONF_VAR_MODULE}\"")
+ endif()
- pkg_get_variable(VAR_VALUE "${GET_PKGCONF_VAR_MODULE}" "${GET_PKGCONF_VAR_VARIABLE_NAME}")
+ pkg_get_variable(VAR_VALUE "${GET_PKGCONF_VAR_MODULE}" "${GET_PKGCONF_VAR_VARIABLE_NAME}")
- if(NOT VAR_VALUE AND GET_PKGCONF_VAR_VARIABLE_NAME MATCHES ".*_.*")
- # There seems to be a difference between pkgconf and pkg-config where one uses underscores
- # in variable names, whereas the other does not. We assume that VAR_NAME is the version with
- # the underscores, so if that failed to fetch a value, we try again without the underscores.
- string(REPLACE "_" "" VAR_NAME_WITHOUT_UNDERSCORES "${GET_PKGCONF_VAR_VARIABLE_NAME}")
+ if(NOT VAR_VALUE AND GET_PKGCONF_VAR_VARIABLE_NAME MATCHES ".*_.*")
+ # There seems to be a difference between pkgconf and pkg-config where one uses underscores
+ # in variable names, whereas the other does not. We assume that VAR_NAME is the version with
+ # the underscores, so if that failed to fetch a value, we try again without the underscores.
+ string(REPLACE "_" "" VAR_NAME_WITHOUT_UNDERSCORES "${GET_PKGCONF_VAR_VARIABLE_NAME}")
- if(GET_PKGCONF_VAR_DEBUG)
- message(STATUS "get_pkgconf_variable: Removed underscores from variable name")
- message(STATUS "get_pkgconf_variable: Now searching for variable \"${VAR_NAME_WITHOUT_UNDERSCORES}\"")
- endif()
+ if(GET_PKGCONF_VAR_DEBUG)
+ message(STATUS "get_pkgconf_variable: Removed underscores from variable name")
+ message(STATUS "get_pkgconf_variable: Now searching for variable \"${VAR_NAME_WITHOUT_UNDERSCORES}\"")
+ endif()
- pkg_get_variable(VAR_VALUE "${GET_PKGCONF_VAR_MODULE}" "${VAR_NAME_WITHOUT_UNDERSCORES}")
+ pkg_get_variable(VAR_VALUE "${GET_PKGCONF_VAR_MODULE}" "${VAR_NAME_WITHOUT_UNDERSCORES}")
+ endif()
endif()
if(NOT VAR_VALUE)