summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-01-24 20:19:34 (GMT)
committerBrad King <brad.king@kitware.com>2017-01-24 20:21:33 (GMT)
commit2759e22575b9c63f3162a9629c2d8aa6b9d7effa (patch)
tree1d1dfcf944df001f5c4e1d8cfcf8214710fba98b
parent8ea12a8b80c4c3153cc602f1d0735b3db8581ae8 (diff)
downloadCMake-2759e22575b9c63f3162a9629c2d8aa6b9d7effa.zip
CMake-2759e22575b9c63f3162a9629c2d8aa6b9d7effa.tar.gz
CMake-2759e22575b9c63f3162a9629c2d8aa6b9d7effa.tar.bz2
FindLua: try to find library according to version from header
Patch-by: fft on gitlab.kitware.com Issue: #15756
-rw-r--r--Modules/FindLua.cmake16
1 files changed, 9 insertions, 7 deletions
diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake
index c777970..b59b9b3 100644
--- a/Modules/FindLua.cmake
+++ b/Modules/FindLua.cmake
@@ -75,16 +75,9 @@ function(_lua_set_version_vars)
include/lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
include/lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
)
- list(APPEND _lua_library_names
- lua${CMAKE_MATCH_1}${CMAKE_MATCH_2}
- lua${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
- lua-${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
- lua.${CMAKE_MATCH_1}.${CMAKE_MATCH_2}
- )
endforeach ()
set(_lua_include_subdirs "${_lua_include_subdirs}" PARENT_SCOPE)
- set(_lua_library_names "${_lua_library_names}" PARENT_SCOPE)
set(_lua_append_versions "${_lua_append_versions}" PARENT_SCOPE)
endfunction(_lua_set_version_vars)
@@ -152,6 +145,15 @@ endif ()
unset(_lua_include_subdirs)
unset(_lua_append_versions)
+if (LUA_VERSION_STRING)
+ set(_lua_library_names
+ lua${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}
+ lua${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
+ lua-${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
+ lua.${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}
+ )
+endif ()
+
find_library(LUA_LIBRARY
NAMES ${_lua_library_names} lua
HINTS