summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-11-19 15:45:32 +0100
committerPřemysl Janouch <p.janouch@gmail.com>2015-11-21 14:09:33 +0100
commitfbfe0ba18a1bf4400d71910869b2ab3601827606 (patch)
treeea471283d3b1e982f5111399f0882ceb15ff0b3a /CMakeLists.txt
parent5ee210a5b724dabb8580654e3d2811537ff7f6b4 (diff)
downloadxK-fbfe0ba18a1bf4400d71910869b2ab3601827606.tar.gz
xK-fbfe0ba18a1bf4400d71910869b2ab3601827606.tar.xz
xK-fbfe0ba18a1bf4400d71910869b2ab3601827606.zip
degesch: add a stubbed Lua plugin loader
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt24
1 files changed, 17 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aa0d3e0..64bb667 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -38,6 +38,20 @@ list (APPEND project_libraries ${libssl_LIBRARIES})
include_directories (${libssl_INCLUDE_DIRS})
link_directories (${libssl_LIBRARY_DIRS})
+# FIXME: other Lua versions may be acceptable, don't know yet
+pkg_search_module (lua lua5.3 lua-5.3 lua>=5.3)
+option (WITH_LUA "Enable experimental support for Lua plugins" ${lua_FOUND})
+
+if (WITH_LUA)
+ if (NOT lua_FOUND)
+ message (FATAL_ERROR "Lua library not found")
+ endif (NOT lua_FOUND)
+
+ list (APPEND project_libraries ${lua_LIBRARIES})
+ include_directories (${lua_INCLUDE_DIRS})
+ link_directories (${lua_LIBRARY_DIRS})
+endif (WITH_LUA)
+
# -lpthread is only there for debugging (gdb & errno)
# -lrt is only for glibc < 2.17
# -liconv may or may not be a part of libc
@@ -75,13 +89,9 @@ elseif (WANT_LIBEDIT)
endif ((WANT_READLINE AND WANT_LIBEDIT) OR (NOT WANT_READLINE AND NOT WANT_LIBEDIT))
# Generate a configuration file
-if (WANT_READLINE)
- set (HAVE_READLINE 1)
-endif (WANT_READLINE)
-
-if (WANT_LIBEDIT)
- set (HAVE_EDITLINE 1)
-endif (WANT_LIBEDIT)
+set (HAVE_READLINE "${WANT_READLINE}")
+set (HAVE_EDITLINE "${WANT_LIBEDIT}")
+set (HAVE_LUA "${WITH_LUA}")
include (GNUInstallDirs)
set (plugin_dir ${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME})