aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorRui Abreu Ferreira <raf-ep@gmx.com>2014-07-11 12:12:10 +0100
committerJohn Szakmeister <john@szakmeister.net>2014-07-11 19:28:54 -0400
commit6f0d3c0e77bbcd769effed3e5568d9038486f16d (patch)
tree6ec8b9ad46712753cc14b2c7cf908437e1a814ec /CMakeLists.txt
parente47968537cfc958b991ff10c6be1dcda65cb95f0 (diff)
downloadrneovim-6f0d3c0e77bbcd769effed3e5568d9038486f16d.tar.gz
rneovim-6f0d3c0e77bbcd769effed3e5568d9038486f16d.tar.bz2
rneovim-6f0d3c0e77bbcd769effed3e5568d9038486f16d.zip
Refactor the lua dependency checking.
This is in preparation for the next step, which is to find a suitable lua interpreter, rather than just erroring when an interpreter is found but doesn't have the necessary dependencies. Helped-by: John Szakmeister <john@szakmeister.net>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt26
1 files changed, 6 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b58f717eb6..97b21d1f14 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,29 +98,15 @@ if(NOT EXISTS ${LUA_PRG})
find_program(LUA_PRG lua)
endif()
-if(EXISTS ${LUA_PRG})
- message(STATUS "Using the lua interpreter ${LUA_PRG}")
-else()
- message(FATAL_ERROR "A lua interpreter is required for building the Neovim")
-endif()
-
-execute_process(COMMAND ${LUA_PRG} -e "require('lpeg')"
- RESULT_VARIABLE LUA_LPEG_MISSING
- ERROR_QUIET)
+include(LuaHelpers)
+set(LUA_DEPENDENCIES lpeg cmsgpack)
+check_lua_deps(${LUA_PRG} "${LUA_DEPENDENCIES}" LUA_PRG_WORKS)
-if(${LUA_LPEG_MISSING})
- message(FATAL_ERROR
- "The 'lpeg' lua package is required for building Neovim")
+if(NOT LUA_PRG_WORKS)
+ message(FATAL_ERROR "A suitable Lua interpreter was not found")
endif()
-execute_process(COMMAND ${LUA_PRG} -e "require('cmsgpack')"
- RESULT_VARIABLE LUA_MSGPACK_MISSING
- ERROR_QUIET)
-
-if(${LUA_MSGPACK_MISSING})
- message(FATAL_ERROR
- "The 'cmsgpack' lua package is required for building Neovim")
-endif()
+message(STATUS "Using the Lua interpreter ${LUA_PRG}")
add_subdirectory(config)
add_subdirectory(src/nvim)