|
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 |
2 | 2 | # on earlier CMake versions. |
3 | 3 |
|
4 | 4 | # Distributed under the OSI-approved BSD 3-Clause License. See accompanying |
@@ -51,7 +51,7 @@ unset(_lua_append_versions) |
51 | 51 |
|
52 | 52 | # this is a function only to have all the variables inside go away automatically |
53 | 53 | 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) |
55 | 55 |
|
56 | 56 | if (Lua_FIND_VERSION_EXACT) |
57 | 57 | if (Lua_FIND_VERSION_COUNT GREATER 1) |
@@ -121,10 +121,10 @@ function(_lua_get_header_version) |
121 | 121 | file(STRINGS "${_hdr_file}" lua_version_strings |
122 | 122 | REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*") |
123 | 123 |
|
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};") |
125 | 125 | 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};") |
128 | 128 | set(LUA_VERSION_STRING "${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}.${LUA_VERSION_PATCH}") |
129 | 129 | else () |
130 | 130 | string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" LUA_VERSION_STRING ";${lua_version_strings};") |
|
0 commit comments