From 823e7bea382ef028643b114dfb85d49a147b2e6e Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Wed, 13 Jan 2021 02:48:54 +0000 Subject: [PATCH] Fix MyGUI detection `libfind_pkg_detect` used `pkg_check_modules`, which requires all the given modules to be found. This means it always failed for MyGUI, which passes `MyGUI${MYGUI_STATIC_SUFFIX} MYGUI${MYGUI_STATIC_SUFFIX}` to it. Replaces `pkg_check_modules` with `pkg_search_module`, which finds the first match instead. --- cmake/LibFindMacros.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/LibFindMacros.cmake b/cmake/LibFindMacros.cmake index 2be27c5fc..3044601f6 100644 --- a/cmake/LibFindMacros.cmake +++ b/cmake/LibFindMacros.cmake @@ -19,11 +19,11 @@ macro (libfind_package PREFIX PKG) endmacro() # A simple wrapper to make pkg-config searches a bit easier. -# Works the same as CMake's internal pkg_check_modules but is always quiet. -macro (libfind_pkg_check_modules) +# Works the same as CMake's internal pkg_search_module but is always quiet. +macro (libfind_pkg_search_module) find_package(PkgConfig QUIET) if (PKG_CONFIG_FOUND) - pkg_check_modules(${ARGN} QUIET) + pkg_search_module(${ARGN} QUIET) endif() endmacro() @@ -47,7 +47,7 @@ function (libfind_pkg_detect PREFIX) message(FATAL_ERROR "libfind_pkg_detect requires at least a pkg_config package name to be passed.") endif() # Find library - libfind_pkg_check_modules(${PREFIX}_PKGCONF ${pkgargs}) + libfind_pkg_search_module(${PREFIX}_PKGCONF ${pkgargs}) if (pathargs) find_path(${PREFIX}_INCLUDE_DIR NAMES ${pathargs} HINTS ${${PREFIX}_PKGCONF_INCLUDE_DIRS}) endif()