Skip to content

Commit 3acf94a

Browse files
committed
cmake: update FindLua for lua 5.5
Kitware/CMake@261b7b9
1 parent 01755e1 commit 3acf94a

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cmake/Modules/FindLua.cmake

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This is a copy of CMake's builtin FindLua to get support for Lua 5.4
1+
# This is a copy of CMake's builtin FindLua to get support for Lua 5.5
22
# on earlier CMake versions.
33

44
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
@@ -51,7 +51,7 @@ unset(_lua_append_versions)
5151

5252
# this is a function only to have all the variables inside go away automatically
5353
function(_lua_get_versions)
54-
set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0)
54+
set(LUA_VERSIONS5 5.5 5.4 5.3 5.2 5.1 5.0)
5555

5656
if (Lua_FIND_VERSION_EXACT)
5757
if (Lua_FIND_VERSION_COUNT GREATER 1)
@@ -121,10 +121,10 @@ function(_lua_get_header_version)
121121
file(STRINGS "${_hdr_file}" lua_version_strings
122122
REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*")
123123

124-
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MAJOR ";${lua_version_strings};")
124+
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR(_N)?[ \t]+\"?([0-9])\"?[ \t]*;.*" "\\2" LUA_VERSION_MAJOR ";${lua_version_strings};")
125125
if (LUA_VERSION_MAJOR MATCHES "^[0-9]+$")
126-
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_MINOR ";${lua_version_strings};")
127-
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" LUA_VERSION_PATCH ";${lua_version_strings};")
126+
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR(_N)?[ \t]+\"?([0-9])\"?[ \t]*;.*" "\\2" LUA_VERSION_MINOR ";${lua_version_strings};")
127+
string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE(_N)?[ \t]+\"?([0-9])\"?[ \t]*;.*" "\\2" LUA_VERSION_PATCH ";${lua_version_strings};")
128128
set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}")
129129
else ()
130130
string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};")

0 commit comments

Comments
 (0)