You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
drahosp edited this page Mar 19, 2011
·
5 revisions
Building pure Lua modules
The CMake script for installing pure modules is easy.
All you have to do is:
define project name - usually the name of the module.
include dist.cmake - this file provides macros relevant to LuaDist and will set up all variables that contain instalation paths.
write commands for installing module's files.
Here is an commented example fo the Abelhas module:
# Define projects name# The NONE tells CMake to not check for compilers as they are not neededproject ( abelhas NONE )
# Define minimun version of CMake for compatibilitycmake_minimum_required ( VERSION2.6 )
# Include dist.cmake - defines some macros and install pathsinclude ( dist.cmake )
# All is set up, so install:# First argument is the require name. Second argument is the source of the module.install_lua_module ( psopso.lua )
# or: install_lua_module ( pso.submodule src/pso_submodule.lua )# LuaDist will take care of the installation and renaming automatically# Install files README COPYING to data directoryinstall_data ( READMECOPYING )
# Install all files from examples directoryinstall_example ( examples/ )
# Install the content of the doc directoryinstall_doc ( doc/ )
That's all. Alternatively you can use CMake INSTALL command and install using INSTALL_* variables, but the included macro simplifies things considerably.
If you want to install a lua based application simply call:
install_lua_executable ( app_namesrc/app.lua )
LuaDist will automatically generate a binary executable for your application.