2015-12-03 21:18:39 +01:00
|
|
|
# Locate LuaJIT library
|
|
|
|
# This module defines
|
|
|
|
# LUAJIT_FOUND, if false, do not try to link to Lua
|
2021-05-25 21:16:55 +02:00
|
|
|
# LUA_LIBRARY, where to find the lua library
|
2015-12-03 21:18:39 +01:00
|
|
|
# LUA_INCLUDE_DIR, where to find lua.h
|
|
|
|
#
|
|
|
|
# This module is similar to FindLua51.cmake except that it finds LuaJit instead.
|
|
|
|
|
|
|
|
FIND_PATH(LUA_INCLUDE_DIR luajit.h
|
|
|
|
HINTS
|
|
|
|
$ENV{LUA_DIR}
|
2019-08-18 10:08:57 +02:00
|
|
|
PATH_SUFFIXES include/luajit-2.1 include/luajit-2.0 include/luajit-5_1-2.1 include/luajit-5_1-2.0 include luajit
|
2015-12-03 21:18:39 +01:00
|
|
|
PATHS
|
|
|
|
~/Library/Frameworks
|
|
|
|
/Library/Frameworks
|
|
|
|
/sw # Fink
|
|
|
|
/opt/local # DarwinPorts
|
|
|
|
/opt/csw # Blastwave
|
|
|
|
/opt
|
|
|
|
)
|
|
|
|
|
2019-06-10 03:56:55 +02:00
|
|
|
# Test if running on vcpkg toolchain
|
|
|
|
if(DEFINED VCPKG_TARGET_TRIPLET AND DEFINED VCPKG_APPLOCAL_DEPS)
|
|
|
|
# On vcpkg luajit is 'lua51' and normal lua is 'lua'
|
|
|
|
FIND_LIBRARY(LUA_LIBRARY
|
|
|
|
NAMES lua51
|
|
|
|
HINTS
|
|
|
|
$ENV{LUA_DIR}
|
|
|
|
PATH_SUFFIXES lib
|
|
|
|
)
|
|
|
|
else()
|
|
|
|
FIND_LIBRARY(LUA_LIBRARY
|
|
|
|
NAMES luajit-5.1
|
|
|
|
HINTS
|
|
|
|
$ENV{LUA_DIR}
|
|
|
|
PATH_SUFFIXES lib64 lib
|
|
|
|
PATHS
|
|
|
|
~/Library/Frameworks
|
|
|
|
/Library/Frameworks
|
|
|
|
/sw
|
|
|
|
/opt/local
|
|
|
|
/opt/csw
|
|
|
|
/opt
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2015-12-03 21:18:39 +01:00
|
|
|
INCLUDE(FindPackageHandleStandardArgs)
|
|
|
|
# handle the QUIETLY and REQUIRED arguments and set LUAJIT_FOUND to TRUE if
|
2021-05-25 21:16:55 +02:00
|
|
|
# all listed variables exist
|
2020-04-28 16:34:18 +02:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LuaJIT
|
2021-05-25 21:16:55 +02:00
|
|
|
REQUIRED_VARS LUA_LIBRARY LUA_INCLUDE_DIR)
|
2015-12-03 21:18:39 +01:00
|
|
|
|
2021-05-25 21:16:55 +02:00
|
|
|
MARK_AS_ADVANCED(LUA_INCLUDE_DIR LUA_LIBRARY)
|