From 8cf6e9fe567a0e5446314e2c8914edfde153eca0 Mon Sep 17 00:00:00 2001 From: mckaygerhard Date: Fri, 6 Jan 2023 13:21:44 -0400 Subject: [PATCH] use pkg-config to find luajit as last instance * From: Igor Gnatenko * Date: Tue, 27 Dec 2016 15:23:09 +0100 * backported from https://codeberg.org/minenux/minetest-engine-minetest/commit/7336cbdfe22fb7a774359b325bc6a65cfa6a729d --- cmake/Modules/FindLuaJIT.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/Modules/FindLuaJIT.cmake b/cmake/Modules/FindLuaJIT.cmake index cd6e7bdd8..4841b821a 100644 --- a/cmake/Modules/FindLuaJIT.cmake +++ b/cmake/Modules/FindLuaJIT.cmake @@ -38,6 +38,12 @@ IF(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/luajit.h") STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"LuaJIT ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}") UNSET(lua_version_str) +ELSE() + find_package (PkgConfig REQUIRED) + pkg_check_modules (LuaJIT QUIET REQUIRED luajit) + set (LUA_LIBRARY ${LuaJIT_LIBRARIES}) + set (LUA_INCLUDE_DIR ${LuaJIT_INCLUDE_DIRS}) + set (LUA_VERSION_STRING ${LuaJIT_VERSION}) ENDIF() INCLUDE(FindPackageHandleStandardArgs)