This file describes how to build and install Marble

The most recent version of this file can be found at:

https://marble.kde.org/sources.php

Please refer to the online version above if possible.

NOTE: This file describes how to build Marble as a stand-alone
      application.  If you are building Marble as part of the KDE-EDU
      module, then you should instead read the file INSTALL in the top
      level directory of this module and ignore this one.  This is
      most likely ../INSTALL.


Prerequisites for building Marble are:
 - Qt 5.3 or newer
 - Cmake version 2.8.12 or newer
 - (optional): KDE Frameworks 5.7 or newer (KF5) from the KDE repositories.
 - other dependencies are optional

A checkout of Marble. You can check out Marble using GIT via the command:

git clone git://anongit.kde.org/marble ~/marble/sources


You can build and install Marble in two different ways:

1. As a Qt-only application.
2. As a KF5-based application, using KDE Frameworks 5 classes.

Choose one of them and read below for how to do it.

NOTE: If you wish to build Marble with debug info include the argument
      -DCMAKE_BUILD_TYPE=debug in the cmake command below.

1. Build Marble as a Qt only application.

1.1 Create a build directory

Create a build directory parallel to the source directory.  Suppose
that the source directory is named 'marble'. Then create a new
directory called 'marble-build'.


1.2 Configure the build tree

Go into the build directory and type

  cmake -DWITH_KF5=FALSE ../marble

By default, marble is installed into /usr/local.  If you want to
install it into any other directory, add
-DCMAKE_INSTALL_PREFIX=/path/to/install/into like in this example:

  cmake -DWITH_KF5=FALSE -DCMAKE_INSTALL_PREFIX=~/apps ../marble

If you have no write permission to the installation directory of cmake
(because you have a system installed cmake) you need to add another
parameter -DPACKAGE_ROOT_PREFIX=~/apps to the cmake command:

  cmake -DWITH_KF5=FALSE -DCMAKE_INSTALL_PREFIX=~/apps \
        -DPACKAGE_ROOT_PREFIX=~/apps ../marble

To modify the position of the data directory at compile time, see the notes
at 3.1 .


1.3 Build marble

Also in the build directory, type:

  make


1.4 Install marble

Finally, also from the build directory, type:

  make install

and start Marble either from the menu or via the command line:

  marble-qt


2. Build Marble as a KF5-based application.

2.1 Create a build directory

This is the same step as for a Qt-only build:

Create a build directory parallel to the source directory.  Suppose
that the source directory is named 'marble'. Then create a new
directory called 'marble-build'.

2.2 Configure the build tree

Go into the build directory and type

  cmake ../marble

From now on the steps are the same as for a Qt-only build.

2.3 Build marble

  make

2.4 Install marble

  make install

and start Marble either from the menu or via the command line:

  marble


3 Adjust Marble's search path for the maps and data

There are several ways to adjust the path where Marble is
drawing it's data from:

3.1 At Compiletime

Use the cmake option -DMARBLE_DATA_PATH to specify the
built-in system path that Marble gathers its data from:

Example:
  cmake -DWITH_KF5=FALSE -DMARBLE_DATA_PATH /mnt1/marble/data ~/marble

3.2 "At Runtime"

There are two solutions to adjust the data path for a
precompiled Marble binary:

a) Enter a key and a value

marbleDataPath="/smb/marble/data"

to the config file "marblerc" or
"~/.config/KDE/Marble\ Desktop\ Globe.conf" and (re)start the
application.

b) Start Marble using the command line option --marbleDataPath:

marble --marbleDataPath ~/marble/data
