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 Without any option it also builds Lua which could
42 be suppressed by -DSYSTEM_LUA
43 (TODO is FindLua broken?)
48 2. qmake, step by step ==
51 == Build the C++ parser ==
58 Checkouts from KDE svn needs to build cpptoxml seperately
59 svn.kde.org/home/kde/trunk/kdesupport/cpptoxml
62 == Create a cpp file including the module ==
65 echo '#include <QtGui>' > ./src/qtgui.cpp
67 == Create the XML description of the file ==
69 ./cpptoxml/cpptoxml -C cpptoxml/parser/rpp/pp-qt-configuration ./src/qtgui.cpp > src/qtgui.xml
71 Rememebr that you have to set the QT_INCLUDE env variable such that
72 $QT_INCLUDE contains the QtCore, QtGui, etc... directories
74 The same command could be issued directly on the header file
76 /usr/include/QtGui/QtGui
80 == Create destination directory and generate bindings ==
83 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
85 On windows use the command:
86 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
90 The options tell the generator which is the name of the
91 module (-n), which type definitions to use (-t), which files
92 must be included in the final binding (-i), how to filter out
95 Every time you issue this command you will likely end up with
96 different binding file and also a different number of files,
97 even if src/qtgui.xml has not changed. It is probably better
98 to always begin with an empty directory each time, so that
99 there are no leftover files from previous runs.
101 == Copy static files and compile binding ==
103 cp common/lqt_*.?pp qtgui_src/
105 qmake -project -template lib -o qtgui.pro
109 Then wait. If everything works, you will likely have a
110 working lua module named libqtgui.so.1.0.0 . Rename or
111 link as qtcore.so, and place where require can find it.
113 You may have to tell qmake where to find Lua headers.