print the method name on argument mismatch
[lqt.git] / BUILD
blobb2a55762738da60ab362a37a1f5d6cc1a9fb204e
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
40 Mac
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 ==
57 cd cpptoxml
58 qmake
59 make
60 cd ..
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 ==
68 mkdir ./src
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
79 e.g.
80 /usr/include/QtGui/QtGui
81 instead of
82 ./src/qtgui.cpp
84 == Create destination directory and generate bindings ==
86 mkdir qtgui_src
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
97 some classes (-f)
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
108 the second binding.
110 == Copy static files and compile binding ==
112 cp common/lqt_*.?pp qtgui_src/
113 cd qtgui_src/
114 qmake -project -template lib -o qtgui.pro
115 qmake
116 make
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.