diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2014-10-03 22:20:10 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2014-10-03 22:31:02 +0200 |
commit | b51edca84601ca233a58d535aa88a00715a188b8 (patch) | |
tree | b8b448f6c500a5d9ee7238362e759d59d317160e /cmake | |
parent | 57104a0c6d7eda8f73152bba29242f1da8cbfffa (diff) | |
download | weechat-b51edca84601ca233a58d535aa88a00715a188b8.zip |
core: use pkg-config to find Lua lib/headers with cmake, detection of Lua 5.2
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/FindLua.cmake | 50 |
1 files changed, 3 insertions, 47 deletions
diff --git a/cmake/FindLua.cmake b/cmake/FindLua.cmake index 87cb8af39..5dd706674 100644 --- a/cmake/FindLua.cmake +++ b/cmake/FindLua.cmake @@ -33,51 +33,7 @@ if(LUA_FOUND) set(LUA_FIND_QUIETLY TRUE) endif() -find_path( - LUA51_INCLUDE_PATH lua.h - PATHS /usr/include /usr/local/include /usr/pkg/include - PATH_SUFFIXES lua51 lua5.1 lua-5.1 -) - -find_library( - LUA51_LIBRARY NAMES lua51 lua5.1 lua-5.1 lua - PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib - PATH_SUFFIXES lua51 lua5.1 lua-5.1 -) - -if(LUA51_INCLUDE_PATH AND LUA51_LIBRARY) - set(LUA_INCLUDE_PATH "${LUA51_INCLUDE_PATH}") - set(LUA_LIBRARY "${LUA51_LIBRARY}") - set(LUA_VERSION "5.1") - set(LUA_FOUND TRUE) -else() - find_path( - LUA50_INCLUDE_PATH lua.h - PATHS /usr/include /usr/local/include /usr/pkg/include - PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua - ) - find_library( - LUA50_LIBRARY NAMES lua50 lua5.0 lua-5.0 lua - PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib - PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua - ) - find_library( - LUALIB50_LIBRARY NAMES lualib50 lualib5.0 lualib-5.0 lualib - PATHS /lib /usr/lib /usr/local/lib /usr/pkg/lib - PATH_SUFFIXES lua50 lua5.0 lua-5.0 lua - ) - if(LUA50_INCLUDE_PATH AND LUA50_LIBRARY AND LUALIB50_LIBRARY) - set(LUA_INCLUDE_PATH "${LUA50_INCLUDE_PATH}") - set(LUA_LIBRARY "${LUA50_LIBRARY}") - set(LUALIB_LIBRARY "${LUALIB50_LIBRARY}") - set(LUA_VERSION "5.0") - set(LUA_FOUND TRUE) - endif() +find_package(PkgConfig) +if(PKG_CONFIG_FOUND) + pkg_search_module(LUA lua5.2 lua5.1 lua5.0) endif() - -mark_as_advanced( - LUA_INCLUDE_PATH - LUA_LIBRARY - LUALIB_LIBRARY -# LUA_VERSION -) |