Installing QTM from source
==========================

QTM is built using CMake, a cross-platform build tool.  Although it is still
possible to use qmake, I don't recommend it and am not maintaining the qmake
project file at the moment as there are no translations.  A version of CMake
may be in your operating system's package repositories and installable using
APT, YUM or whatever.  Failing that, you can download it from
http://www.cmake.org/.

You need version 2.4.3 or later.  Note: version 2.4.4 is buggy.  I recommend
getting the most recent version possible; you can get the sources from the
CMake homepage and build the latest version using the version supplied with
your OS.

CMake replaces the "configure" stage which appears with many applications
distibuted as source.

You must also have the common build tools, including the GNU C++ compiler
and GNU Make.  If you are using Ubuntu, type:

	sudo apt-get install build-essential

On other systems, there will be a group of common software development
packages which you may find in the package installation program, such as
Synaptic.

CMake options
-------------

If you do not specify any of these, the defaults will be used.

USE_STI:BOOL - If you are using Qt 4.2 or later, and your desktop includes a system tray -
i.e. a set of icons which you can use to control programs without going
through their main window - you can compile in the QTM system-tray icon. 
This provides much of QTM's distinctive functionality, such as QuickPost and
the templates that go with it.  Default: FALSE

QDEBUG:BOOL - If you are a developer and are helping to fix bugs with QTM, set
this option.  This will mean that messages will appear in the terminal
window at certain intervals, a mechanism I use to identify when things go
wrong.  If you just want to use QTM for blogging, do not enable this. 
Default: FALSE

DESKTOP_ENTRY_PATH:PATH - QTM includes a file called qtm.desktop, which the
desktop uses to decide where to put QTM in its menu system, such as in KDE
and GNOME.  Different systems look for this file in different places. 
Ubuntu, for example, uses /usr/share/applications, while Mandriva and
PCLinuxOS use /usr/share/applications/kde (at least, if they are using KDE). 
Default: /usr/share/applications

CMAKE_INSTALL_PREFIX:PATH - When you run "make install", this tells your
system where to put QTM.  If you are building a binary package, you should
specify /usr, so that QTM goes to /usr/bin.  Leave this out if installing
it for your own use.  Default: /usr/local (so that qtm will be in 
/usr/local/bin)

Configuring
-----------

By this point, I presume you have already unpacked the bundle.  If not, type
this:

tar zxvf qtm-x.x.x.tar.gz
cd qtm-x.x.x.tar.gz

Of course, substitute the numbers for x.x.x.  You may be able to use the
mouse and your desktop's copy and paste features rather than to type the
file's name out.

Then, to configure without any options, type this:

	cmake .

To configure with options, type this:

	cmake -D [option]=[value] .

Do not type the brackets.  So, to configure with the system tray included,
debugging messages off and the desktop spec file at
/usr/share/applications/kde, type this:

	cmake -D USE_STI:BOOL=TRUE .

Remember, as the desktop spec is in /usr/share/applications and debug is off
by default, you don't need to include these options.  You must type -D before
each option.

Also, remember the dot.  It refers to the current directory and tells CMake
to look for a file called CMakeLists.txt there.  CMake will not do anything
if you just type "cmake".

CMake will look for Qt; it will expect to find a file called either qmake or
qmake-qt4 in your search path.  If you have a Unix-type OS, the normal place
for such files is the /usr/bin directory.  Some operating systems are buggy,
however, and do not make sure that qmake is in the search path.  Your
easiest way round this is to find out where qmake is, and add that directory
to the search path.  A likely location is /usr/lib/qt4/bin.  So, to add that
to the search path, type this:

	PATH=/usr/lib/qt4/bin
	export PATH

If the computer is yours, you can also type this, as root or with sudo:

	ln -s /usr/lib/qt4/bin/qmake /usr/bin/qmake-qt4

Building and installing
-----------------------

Now comes the easy bit.  Type this:

	make
	
Then, as root or with sudo:

	make install

And it will install QTM in the /usr/local/bin, unless you have specified
otherwise.
