Skip to content

Instantly share code, notes, and snippets.

@greatwolf
Created January 31, 2020 05:16
Show Gist options
  • Save greatwolf/0dbde1b5cd44b78023a565ad5638181c to your computer and use it in GitHub Desktop.
Save greatwolf/0dbde1b5cd44b78023a565ad5638181c to your computer and use it in GitHub Desktop.
LuaCOM rockspec modified to build with CMake.
package = "LuaCOM"
version = "scm.moteus-1"
source = {
url = "https://github.com/moteus/luacom/archive/master.zip",
dir = "luacom-master",
}
description = {
summary = "Use COM libraries from Lua",
detailed = [[
LuaCOM is an add-on library to the Lua language that allows Lua programs to use and implement objects that follow Microsoft's Component Object Model (COM) specification and use the ActiveX technology for property access and method calls. ]],
license = "MIT/X11",
homepage = "http://luaforge.net/projects/luacom/"
}
supported_platforms = {
"windows"
}
dependencies = {
"lua >= 5.1"
}
build = {
type = "cmake",
variables = {
CMAKE_C_FLAGS = "$(CFLAGS)",
LUA = "$(LUA)",
LUA_LIBRARY = "$(LUA_LIBDIR)/$(LUALIB)",
CMAKE_PREFIX_PATH = "$(LUA_LIBDIR)",
CMAKE_INSTALL_PREFIX = "$(PREFIX)",
},
}
@greatwolf
Copy link
Author

INSTALL_LMOD and INSTALL_CMOD in 'luacom/cmake/lua.cmake' also needs to be changed to ${INSTALL_LIB} so there's no extra 'lua' subdirectory. That extra lua subdirectory causes problems with require since stock Lua does not have that in the package.path and package.cpath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment