"Whether or not to build the Lua plugin loader"
message(FATAL_ERROR "Lua plugin requires GObject Introspection.")
set(_LUAS "lua>=5.1.0;lua5.1>=5.1.0;luajit>=2.0.0;lua5.2>=5.2.0")
pkg_check_modules(LUA ${_LUA})
message(FATAL_ERROR "No usable Lua library was found")
include_directories(${LUA_INCLUDE_DIRS})
message(STATUS "checking for lua module 'lgi'")
# compile our lua-lgi test program
try_compile(LUA_LGI_COMPILE
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/gplugin-lua-test-lgi.c
-DINCLUDE_DIRECTORIES:STRING=${LUA_INCLUDE_DIRS}
-DLINK_LIBRARIES:STRING=${LUA_LIBRARIES}
COPY_FILE ${CMAKE_CURRENT_BINARY_DIR}/gplugin-lua-test-lgi
if(NOT ${LUA_LGI_COMPILE})
message(STATUS ${OUTPUT})
message(FATAL_ERROR "Failed to compile the lua-lgi test")
endif(NOT ${LUA_LGI_COMPILE})
# run our lua-lgi test program
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/gplugin-lua-test-lgi
RESULT_VARIABLE LUA_LGI_FOUND
if(${LUA_LGI_FOUND} EQUAL 0)
message(STATUS " found lgi")
else(${LUA_LGI_FOUND} EQUAL 0)
message(FATAL_ERROR " failed to find the 'lgi' lua module")
endif(${LUA_LGI_FOUND} EQUAL 0)
"Whether or not to run the moonscript tests"
add_library(gplugin-lua MODULE
set_target_properties(gplugin-lua PROPERTIES PREFIX "")
target_link_libraries(gplugin-lua
install(TARGETS gplugin-lua DESTINATION ${CMAKE_INSTALL_LIBDIR}/gplugin)