cmake/LuaHelpers.cmake: check_lua_module: use 'lua -l'

It only shortens the traceback a bit for when a module is not found
though, only removing the "(command line):1: in main chunk" (with
lua5.2).
This commit is contained in:
Daniel Hahler
2018-02-22 01:22:26 +01:00
parent 8851903434
commit ef0a07c073

View File

@@ -4,7 +4,7 @@
# Check if a module is available in Lua
function(check_lua_module LUA_PRG_PATH MODULE RESULT_VAR)
execute_process(COMMAND ${LUA_PRG_PATH} -e "require('${MODULE}')"
execute_process(COMMAND ${LUA_PRG_PATH} -l "${MODULE}" -e ""
RESULT_VARIABLE module_missing)
if(module_missing)
set(${RESULT_VAR} False PARENT_SCOPE)