QXmlEdit Installation
=====================

Requirements
============

QXmlEdit requires QT 4 or QT 5 (4.7.3 or higher) to be installed. Qt sqlite driver and QtSql module are
required. OpenGL is required if QwtPlot3D library is used.

Quick Guide
===========

QXmlEdit is built and installed using qmake. The package is composed by
an application and some libraries.
In the main folder there is a main QxmlEdit.pro file.

Extract the source, go to top folder

   qmake
   make
   sudo make install

The file DISTRIBUTING contains a list of files that should take part in a binary distribution.
To configure the destination folders, check the marker 'BEGIN INSTALLATION FOLDERS DECLARATION' in
each project file present in the src subfolder.

The program is composed by some shared objects (or DLL) loaded at the program start. When installing
on a Linux system make sure that the libraries are in the library search path.

To compile a release version use
qmake "CONFIG+=release"

In the main folder there are "compile.xxx" batch commands for Linux and Windows, to configure and compile the project.

To parametrize the installation
-------------------------------
The qmake project reads the following variables from environment variables.

folder for data: QXMLEDIT_INST_DATA_DIR
folder for the executable: QXMLEDIT_INST_DIR
folder for the documentation: QXMLEDIT_INST_DOC_DIR
folder for the shared libraries: QXMLEDIT_INST_LIB_DIR
folder for the language translations: QXMLEDIT_INST_TRANSLATIONS_DIR
folder for the includes of the xml edit widget: QXMLEDIT_INST_INCLUDE_DIR
disable the precompiled headers by setting the value to non empty string: QXMLEDIT_INST_AVOID_PRECOMP_HEADERS
disable the link with QwtPlot3D setting QXMLEDIT_NO_QWTPLOT to non empty string
enable C++11 compiler option defining QXMLEDIT_INST_USE_C11=y (default: not enabled)

QwtPlot3D library is linked (statically) by default unless QXMLEDIT_NO_QWTPLOT environment variable is defined and not empty.
It is used as an optional component and can be excluded without compromising QXmlEdit functionalities.
Warning: QwtPlot3D library requires OpenGL.

To force the executable name all lowercase (qxmledit) as in Unix style, the following enviroment variable
must be set to 1:
QXMLEDIT_UNIX_LOWERCASE_NAME
For unix, except MacOS, the flag is automatically set.

The variable QXMLEDIT_VERSIONED force library version number if not empty. On Linux the libraries are versioned by default.

If the environment variables are not set, a default is used.

IMPORTANT NOTE FOR LINUX INSTALLERS
-----------------------------------
Starting from 0.8.15 the name of the executable on Unix systems, except MacOS, is lowercase by default.
This behaviour can be changed via the QXMLEDIT_UNIX_LOWERCASE_NAME variable.
The .desktop and .appdata file have been updated.
This can require some attention when upgrading a previously installed package.

Note for Qt4 compatibility
--------------------------
QXmlEdit is source compatible with Qt4.7.3, Qt4.8 and Qt5.

Additional resources
--------------------
There are resources for a Linux desktop installation:

.desktop file in: install_scripts/environment/desktop/QXmlEdit.desktop
AppData file in: install_scripts/environment/desktop/QXmlEdit.appdata.xml
man file:  install_scripts/environment/man/qxmledit.1

Pixmap icons in: install_scripts/environment/icon
Scalable icon: source/images/icon.svg

Mac OS X Note
=============
Snippets and sample style files should be copied in a "SharedSupport" directory in the final bundle.
There is an installation script to create the final package after the build. The script expects some enviroment
variables to be set, as specified in the script itself.
MacOS X Mavericks has been tested with Qt5.2.


Windows Users Note
==================

In the install_scripts directory there is a NSIS NullSoft installer script that can be used to
generate a package compatible with Windows Installer. Simply put required files into "distribution"
subdirectory and generate the script. The needed libraries are in the Qt and mingw packages.
There is a script for using QT5 and another one for QT4.

Qt must be compiled statically to build a single file executable.

Projects
--------
Main project: QXmlEdit.pro
Unit tests: test/test.pro
Test to use the XML editor as a library: testlib/testlib.pro
Alternative project to compile QXmlEdit as a monolitic app: singleapp/singleapp.pro (Note: this project is not supported, it is intended for development).

Other info
----------
Site: http://qxmledit.org

