The following are required for compilation:
- an ordinary C++ development environment (g++, make, C++ libraries and
  headers, ...)
- cmake (if you want to install the KPart)
- a standard LaTeX environment
- a Qt 4 development environment (libraries, headers, qmake, ...): only
  QtCore, QtGui and QtXml are required, at least in version 4.6
- the poppler-qt4 libraries and headers, at least in version 0.6
- the kdelibs development environment (only if you want KDE integration
  and the KPart), at least in version 4.3
- the LaTeX pgf package (which includes TikZ)
- the LaTeX preview package

In Ubuntu you would obtain those by installing the following packages:
- build-essential
- cmake (if you want to install the KDE version)
- libqt4-dev
- qt4-dev-tools
- libpoppler-qt4-dev
- kdelibs5-dev (only if you want KDE integration and the KPart)
- pgf
- preview-latex-style

Install the Qt-only (qtikz) application (using qmake):
------------------------------------------------------

1. Edit the paths in qmake/qtikzconfig.pri
2. Run the following commands (this will create an executable named qtikz):
  mkdir buildqt
  cd buildqt
  qmake ../qtikz.pro
  make
  sudo make install
  sudo update-mime-database /usr/share/mime

Note that qmake will tell you where the files will be installed. If
you don't like the installation directories, you can change them in
the file qmake/qtikzconfig.pri before running make.  Make sure to make
the changes in qmake/qtikzconfig.pri before running make.

In order to uninstall qtikz run the following commands in the build directory:
  sudo make uninstall
  sudo update-mime-database /usr/share/mime

Install the KDE (ktikz) application and the KPart (using cmake):
----------------------------------------------------------------

Run the following commands (this will create an executable named ktikz
and a KPart which will be loaded when clicking a *.pgf or *.tikz file
in Konqueror):
  mkdir build
  cd build
  cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..
  make
  sudo make install

Because a new mimetype (text/x-pgf) is added to the system, as a user one
may additionally have to run
  kbuildsycoca4
or restart KDE so that konqueror uses the KPart for this mimetype.

In order to uninstall ktikz run the following commands in the build directory
(the path in the last command depends of course on where the mimetype was
installed, see the output of the make uninstall command for the correct path):
  sudo make uninstall
  sudo update-mime-database /usr/share/mime

You may additionally run the following command to remove the installation
directories created during "make install" (WARNING: this will also remove
the directories if they are not empty, use at your own risk):
  sudo make uninstalldirs
