Files
qmsgpack/doc/install.rst

107 lines
2.4 KiB
ReStructuredText
Raw Permalink Normal View History

2015-07-12 22:35:34 +03:00
Installation
------------
.. contents::
:depth: 4
qmsgpack is a pure Qt library (Qt4 and Qt5 supported), so you can build it for almost any platform Qt supports.
There are two build methods:
2015-07-12 22:35:34 +03:00
- CMake
- qmake
And two ways of using it: build separately and include to your project, or build with your project (qmake subdirs)
Build
=====
CMake
^^^^^
Get the latest qmsgpack version by grabbing the source code from GitHub:
.. code-block:: bash
$ git clone https://github.com/romixlab/qmsgpack.git
Now build and install it:
.. code-block:: bash
cd qmsgpack
mkdir build && cd build
cmake ..
make
sudo make install
There are several useful cmake options available:
.. cmdoption:: -DBUILD_TESTS=True
Build all the tests, run with ``make tests``
.. cmdoption:: -DCMAKE_INSTALL_PREFIX=/usr
Change install location to `/usr`
.. cmdoption:: -DCMAKE_BUILD_TYPE=Debug
Change build type to debug mode (default is `Release`), could be very useful if something goes wrong
.. cmdoption:: -DWITH_GUI_TYPES=True
Build with support for QtGui types (QColor)
.. cmdoption:: -DWITH_LOCATION_TYPES=True
Build with support for QtLocation types(QGeoCoordinate). Might not work, because CMake seems to be failing to find QtLocation, in this case you can try qmake instead.
2015-07-12 22:35:34 +03:00
Add options before ``..`` as follow:
.. code-block:: bash
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTS=True ..
2015-12-31 10:36:25 +03:00
Custom Qt installation
""""""""""""""""""""""
If you installed Qt with online installer, cmake will most likely not find it, in this case try adding following lines to CMakeLists.txt:
.. code-block:: cmake
set(Qt5Core_DIR "/opt/Qt5.6.0/5.6/gcc_64/lib/cmake/Qt5Core")
set(Qt5Test_DIR "/opt/Qt5.6.0/5.6/gcc_64/lib/cmake/Qt5Test")
set(Qt5_DIR "/opt/Qt5.6.0/5.6/gcc_64/lib/cmake/Qt5Core")
set(QT_QMAKE_EXECUTABLE "/opt/Qt5.6.0/5.6/gcc_64/bin/qmake")
2015-07-12 22:35:34 +03:00
qmake
^^^^^
Get the latest qmsgpack version by grabbing the source code from GitHub:
.. code-block:: bash
$ git clone https://github.com/romixlab/qmsgpack.git
Now build and install it:
.. code-block:: bash
cd qmsgpack
qmake
make
sudo make install
Also you can just open ``qmsgpack.pro`` in Qt Creator and build it from there.
Use it
======
2015-08-07 22:40:18 +03:00
Just add following lines to your .pro file:
2015-07-12 22:35:34 +03:00
.. code-block:: makefile
LIBS += -lqmsgpack
On Windows you may also set the ``INCLUDEPATH`` variable to appropriate location