should return nil when it does not add a new entry
[lqt.git] / BUILD
blob94bbaa26feaa4054bfc16dc165fdd64c4bd066e9
1 ======================
2   Build Instructions
3 ======================
6 Qt 4.4
8 Compilers:
9 GCC 4.2
10 MSVC 2008, 2008
13 1. CMake
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
20 Linux:
21 build> cmake ../lqt
22 build> make
25 Windows to build with the Visual Studio:
26 build> cmake ..\lqt
27 build> lqt.sln
30 Example lua files are in lqt/test, LUA_CPATH is needed:
32 Linux:
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 ==
53 cd cpptoxml
54 qmake
55 make
56 cd ..
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 ==
64 mkdir ./src
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
75 e.g.
76 /usr/include/QtGui/QtGui
77 instead of
78 ./src/qtgui.cpp
80 == Create destination directory and generate bindings ==
82 mkdir qtgui_src
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
93 some classes (-f)
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/
104 cd qtgui_src/
105 qmake -project -template lib -o qtgui.pro
106 qmake
107 make
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.