This project uses CMake (minimum version 3.2), you can download it here or install it with apt-get.
sudo apt-get install cmake
Make sure to update git submodules before you build:
git submodule update --init
To build on Ubuntu or Debian you will need a C++ toolchain with support for C++14. GCC 4.9.2 (or higher) and Clang 3.4 (or higher) are known to work.
You will also need to install development packages for libcurl, x11, and opengl. On Ubuntu 16.04 or Debian Stretch all the required packages can be installed with
sudo apt-get install make g++ pkg-config libcurl4-openssl-dev \
libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libgl1-mesa-dev
The demo application uses the Nextzen vector tile service, so you will need a Nextzen API key to build and run the demo.
-
Visit https://developers.nextzen.org/ to get an API key.
-
Setup an environment variable (
NEXTZEN_API_KEY
) to point to your API key.export NEXTZEN_API_KEY=YOUR_API_KEY
There are two ways to build the tangram-es library and demo application on Linux:
To build the executable demo application:
make linux
You can optionally use make -j
to parallelize the build and append a BUILD_TYPE
variable to choose the build type, for example BUILD_TYPE=Debug
.
Then run it from the output folder:
cd build/linux/bin/ && ./tangram
You can open a different YAML scene file by dragging and dropping it into the window, or passing it as an argument:
cd build/linux/bin/ && ./tangram -f /path/to/your/scene.yaml
Tangram-es can optionally be built with system-installed font and GLFW libraries. You can install these libraries with:
sudo apt-get install libglfw3-dev libicu-dev libfreetype6-dev libharfbuzz-dev
Then compile with the following options:
make linux CMAKE_OPTIONS="-DUSE_SYSTEM_GLFW_LIBS=1 -DUSE_SYSTEM_FONT_LIBS=1"
You can also run and debug from CLion.
After cloning and updating your git submodules, open CLion and Import Project from Sources. Select the root of this repo. Choose Open Project. Do not overwrite CMakeLists.txt.
CLion will automatically set everything up, all you have to do is wait a minute for the project to get initialized. Then, select the tangram run configuration and hit run/debug.