diff options
Diffstat (limited to 'libs/luajit-cmake/CMakeLists.txt')
-rw-r--r-- | libs/luajit-cmake/CMakeLists.txt | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/libs/luajit-cmake/CMakeLists.txt b/libs/luajit-cmake/CMakeLists.txt new file mode 100644 index 0000000..ea0c74d --- /dev/null +++ b/libs/luajit-cmake/CMakeLists.txt @@ -0,0 +1,25 @@ +cmake_minimum_required(VERSION 3.0) + +# manually configure the luajit dir (added by sanine) +set(LUAJIT_DIR ${CMAKE_CURRENT_LIST_DIR}/luajit) + +option(LUA_DIR "Path of Lua 5.4 source dir" OFF) +option(LUAJIT_DIR "Path of LuaJIT 2.1 source dir" OFF) + +if(LUAJIT_DIR) + project(luajit) + include(LuaJIT.cmake) + if (PARENT_DIRECTORY) + set(LUA_TARGET luajit PARENT_SCOPE) + set(LUA_LIBRARIES libluajit PARENT_SCOPE) + endif() +elseif(LUA_DIR) + project(lua) + include(lua.cmake) + if (PARENT_DIRECTORY) + set(LUA_TARGET lua PARENT_SCOPE) + set(LUA_LIBRARIES liblua PARENT_SCOPE) + endif() +else() + message(FATAL_ERROR "Must set LUAJIT_DIR or LUA_DIR to build with CMake") +endif() |