From 16c6f23791e2b3093b6074fe7bab6a9393ffc0b8 Mon Sep 17 00:00:00 2001 From: Dennis Luxen Date: Sat, 10 Dec 2022 20:50:32 +0100 Subject: [PATCH] Fix CMake warning CMake Warning (dev) at /usr/share/cmake-3.24/Modules/FindPackageHandleStandardArgs.cmake:438 (message): The package name passed to `find_package_handle_standard_args` (PkgConfig) does not match the name of the calling package (Lua). This can lead to problems in calling code that expects `find_package` result variables (e.g., `_FOUND`) to follow a certain pattern. Call Stack (most recent call first): /usr/share/cmake-3.24/Modules/FindPkgConfig.cmake:99 (find_package_handle_standard_args) cmake/FindLua.cmake:39 (include) CMakeLists.txt:571 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. --- cmake/FindLua.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake index 237dca8e6..d8cc01e8a 100644 --- a/cmake/FindLua.cmake +++ b/cmake/FindLua.cmake @@ -36,7 +36,10 @@ # This is because, the lua location is not standardized and may exist in # locations other than lua/ -include(FindPkgConfig) +if(NOT PKG_CONFIG_FOUND) + include(CMakeFindDependencyMacro) + find_dependency(PkgConfig) +endif() unset(_lua_include_subdirs) unset(_lua_library_names)