From fa6563cf7b40f3bfbf09e856420bff8de6820558 Mon Sep 17 00:00:00 2001 From: wzy <32936898+Freed-Wu@users.noreply.github.com> Date: Mon, 19 Aug 2024 21:23:22 +0800 Subject: [PATCH] add LUA_VERSION to allow users to choose lua version (#358) --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 356731e..42f2ebb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ +set(LUA_VERSION "lua" CACHE STRING "lua version") if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/lua5.4/lua.h") find_package(PkgConfig) if(PkgConfig_FOUND) - foreach(pkg lua lua54 lua53 lua52 luajit lua51) + foreach(pkg ${LUA_VERSION} lua54 lua53 lua52 luajit lua51) pkg_check_modules(LUA IMPORTED_TARGET GLOBAL ${pkg}) if(LUA_FOUND) break()