Update BUILD
[lqt/mk.git] / doc / no-cmake-build.txt
blobf2a87d22a3a19df01b2cbddb04422cdf92ede41b
1 If you don't wanna use CMake you could start here.
2 This can be useful if CMake fails, if you have particular 
3 needs, or just want to understand how lqt works.
5 This file is maybe not up to date!
8 == Build the C++ parser ==
10 First you have to build the C++ parser, called cpptoxml.
12 If you took lqt from KDE svn, you don't have cpptoxml, so you need to
13 get it separately from svn.kde.org/home/kde/trunk/kdesupport/cpptoxml
15 cd cpptoxml
16 qmake
17 make
18 cd ..
21 == Create a cpp file including the module ==
23 mkdir ./src
24 echo '#include <QtGui>' > ./src/qtgui.cpp
26 == Create the XML description of the file ==
28 ./cpptoxml/cpptoxml -C cpptoxml/parser/rpp/pp-qt-configuration ./src/qtgui.cpp > src/qtgui.xml
30 Remember that you have to set the QT_INCLUDE env variable such that
31 $QT_INCLUDE contains the QtCore, QtGui, etc... directories. You can check with
33 ls -d $QT_INCLUDE/Qt*
35 It should show a list of directories corresponding to the various
36 modules of Qt.
38 The same command could be issued directly on the header file
39 e.g.
40 /usr/include/QtGui/QtGui
41 instead of
42 ./src/qtgui.cpp
44 == Create destination directory and generate bindings ==
46 mkdir qtgui_src
47 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
49 On windows use the command:
50 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
54 The options tell the generator which is the name of the
55 module (-n), which type definitions to use (-t), which files
56 must be included in the final binding (-i), how to filter out
57 some classes (-f)
59 Every time you issue this command you will likely end up with
60 different binding file and also a different number of files,
61 even if src/qtgui.xml has not changed. It is probably better
62 to always begin with an empty directory each time, so that
63 there are no leftover files from previous runs.
65 The generator creates a <module_name>_types.lua which can be
66 given to other generators using the switch -t. In this way
67 the classes generated by the first run will be available to
68 the second binding.
70 == Copy static files and compile binding ==
72 cp common/lqt_*.?pp qtgui_src/
73 cd qtgui_src/
74 qmake -project -template lib -o qtgui.pro
75 qmake
76 make
78 Then wait. If everything works, you will likely have a
79 working lua module named libqtgui.so.1.0.0 . Rename or
80 link as qtcore.so, and place where require can find it.
82 You may have to tell qmake where to find Lua headers.