mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-09-25 04:09:36 +03:00
FindLua51: Use Lua51_VERSION result variable
If using both FindLua and FindLua51 modules, the FindLua51 and Lua 5.2 or newer is found, FindLua51 module can set the Lua_VERSION variable to empty value. Instead, the Lua51_VERSION can be used to bypass this issue. Issue: #27088
This commit is contained in:
@@ -7,9 +7,9 @@ FindLua50
|
||||
|
||||
.. note::
|
||||
|
||||
This module is specifically for Lua version branch 5.0, which is obsolete and
|
||||
not maintained anymore. In new code use the latest supported Lua version and
|
||||
the version-agnostic module :module:`FindLua` instead.
|
||||
This module is intended specifically for Lua version branch 5.0, which is
|
||||
obsolete and not maintained anymore. In new code use the latest supported
|
||||
Lua version and the version-agnostic module :module:`FindLua` instead.
|
||||
|
||||
Finds the Lua library:
|
||||
|
||||
|
||||
+10
-10
@@ -7,9 +7,9 @@ FindLua51
|
||||
|
||||
.. note::
|
||||
|
||||
This module is specifically for Lua version branch 5.1, which is obsolete and
|
||||
not maintained anymore. In new code use the latest supported Lua version and
|
||||
the version-agnostic module :module:`FindLua` instead.
|
||||
This module is intended specifically for Lua version branch 5.1, which is
|
||||
obsolete and not maintained anymore. In new code use the latest supported
|
||||
Lua version and the version-agnostic module :module:`FindLua` instead.
|
||||
|
||||
Finds the Lua library:
|
||||
|
||||
@@ -45,10 +45,10 @@ This module defines the following variables:
|
||||
|
||||
Boolean indicating whether (the requested version of) Lua was found.
|
||||
|
||||
``Lua_VERSION``
|
||||
``Lua51_VERSION``
|
||||
.. versionadded:: 4.2
|
||||
|
||||
The version of Lua found.
|
||||
The version of Lua 5.1 found.
|
||||
|
||||
Cache Variables
|
||||
^^^^^^^^^^^^^^^
|
||||
@@ -75,9 +75,9 @@ The following variables are provided for backward compatibility:
|
||||
|
||||
``LUA_VERSION_STRING``
|
||||
.. deprecated:: 4.2
|
||||
Superseded by the ``Lua_VERSION``.
|
||||
Use ``Lua51_VERSION``, which has the same value.
|
||||
|
||||
The version of Lua found.
|
||||
The version of Lua 5.1 found.
|
||||
|
||||
Examples
|
||||
^^^^^^^^
|
||||
@@ -146,15 +146,15 @@ endif()
|
||||
if(LUA_INCLUDE_DIR AND EXISTS "${LUA_INCLUDE_DIR}/lua.h")
|
||||
file(STRINGS "${LUA_INCLUDE_DIR}/lua.h" lua_version_str REGEX "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua .+\"")
|
||||
|
||||
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" Lua_VERSION "${lua_version_str}")
|
||||
set(LUA_VERSION_STRING "${Lua_VERSION}")
|
||||
string(REGEX REPLACE "^#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([^\"]+)\".*" "\\1" Lua51_VERSION "${lua_version_str}")
|
||||
set(LUA_VERSION_STRING "${Lua51_VERSION}")
|
||||
unset(lua_version_str)
|
||||
endif()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Lua51
|
||||
REQUIRED_VARS LUA_LIBRARIES LUA_INCLUDE_DIR
|
||||
VERSION_VAR Lua_VERSION)
|
||||
VERSION_VAR Lua51_VERSION)
|
||||
|
||||
mark_as_advanced(LUA_INCLUDE_DIR LUA_LIBRARIES LUA_LIBRARY LUA_MATH_LIBRARY)
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ foreach(
|
||||
HDF5 Hg HSPELL
|
||||
Icotool ImageMagick
|
||||
Jasper JPEG
|
||||
LibArchive LibLZMA LIBLZMA LibXml2 LibXslt LTTngUST
|
||||
LibArchive LibLZMA LIBLZMA LibXml2 LibXslt LTTngUST Lua
|
||||
OpenCL OpenSceneGraph OPENSCENEGRAPH OpenSSL OPENSSL
|
||||
Perl PerlLibs PkgConfig PNG PostgreSQL Protobuf
|
||||
Ruby RUBY
|
||||
|
||||
Reference in New Issue
Block a user