16 Create an out-of-source directory, for instance relative to the lqt
17 sources the directory ../build, then with qmake in your PATH
18 variable call in ../build
25 Windows to build with the Visual Studio:
30 Example lua files are in lqt/test, LUA_CPATH is needed:
33 build> export LUA_CPATH=$PWD/lib/lib?.so
34 build> ./bin/lua ../lqt/test/webview.lua
36 Windows (debug build):
37 build> set LUA_CPATH=%CD%\bin\Debug\?.dll
38 build> bin\Debug\lua.exe ..\lqt\test\t7.lua
41 build>export LUA_CPATH=$PWD/lib/lib?.dylib
42 build> ./bin/lua ../lqt/test/webview.lua
45 Without any option it also builds Lua which could
46 be suppressed by -DSYSTEM_LUA
47 (TODO is FindLua broken?)
52 2. qmake, step by step ==
55 == Build the C++ parser ==
62 Checkouts from KDE svn needs to build cpptoxml seperately
63 svn.kde.org/home/kde/trunk/kdesupport/cpptoxml
66 == Create a cpp file including the module ==
69 echo '#include <QtGui>' > ./src/qtgui.cpp
71 == Create the XML description of the file ==
73 ./cpptoxml/cpptoxml -C cpptoxml/parser/rpp/pp-qt-configuration ./src/qtgui.cpp > src/qtgui.xml
75 Rememebr that you have to set the QT_INCLUDE env variable such that
76 $QT_INCLUDE contains the QtCore, QtGui, etc... directories
78 The same command could be issued directly on the header file
80 /usr/include/QtGui/QtGui
84 == Create destination directory and generate bindings ==
87 lua generator/generator.lua src/qtgui.xml -i QtGui -i lqt_qt.hpp -n qtgui -t generator/types.lua -t generator/qtypes.lua -f generator/qt_internal.lua
89 On windows use the command:
90 lua generator\generator.lua src\qtgui.xml -i QtGui -i lqt_qt.hpp -n qtgui -t generator\types.lua -t generator\qtypes.lua -f generator\qt_internal.lua
94 The options tell the generator which is the name of the
95 module (-n), which type definitions to use (-t), which files
96 must be included in the final binding (-i), how to filter out
99 Every time you issue this command you will likely end up with
100 different binding file and also a different number of files,
101 even if src/qtgui.xml has not changed. It is probably better
102 to always begin with an empty directory each time, so that
103 there are no leftover files from previous runs.
105 The generator creates a <module_name>_types.lua which can be
106 given to other generators using the switch -t. In this way
107 the classes generated by the first run will be available to
110 == Copy static files and compile binding ==
112 cp common/lqt_*.?pp qtgui_src/
114 qmake -project -template lib -o qtgui.pro
118 Then wait. If everything works, you will likely have a
119 working lua module named libqtgui.so.1.0.0 . Rename or
120 link as qtcore.so, and place where require can find it.
122 You may have to tell qmake where to find Lua headers.