use pkg-config to find luajit as last instance

* From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Date: Tue, 27 Dec 2016 15:23:09 +0100
* backported from 7336cbdfe2
This commit is contained in:
mckaygerhard 2023-01-06 13:21:44 -04:00
parent 68acdf12b4
commit 8cf6e9fe56

View File

@ -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}") STRING(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"LuaJIT ([^\"]+)\".*" "\\1" LUA_VERSION_STRING "${lua_version_str}")
UNSET(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() ENDIF()
INCLUDE(FindPackageHandleStandardArgs) INCLUDE(FindPackageHandleStandardArgs)