/cpp-api-client

Mergin Maps C++ Client

Primary LanguageC++MIT LicenseMIT

Code Layout Linux Build Windows Build macOS Build

Mergin Maps Cpp Client

This repository contains a cpp client module for access to MerginMaps service and a command-line tool for easy access to data stored in Mergin Maps.

Join our community chat
and ask questions!

Note: Check also Mergin Maps Python Client

Command-line Tool

When the client is installed, it comes with mergin command line tool.

$ mergin --help
Usage: mergin [OPTIONS] COMMAND [ARGS]...

Options:  
  --help      Show this message and exit.
  --version   Show the version information.
  --username  Mergin username (or MERGIN_USERNAME env. variable)
  --password  Mergin password (or MERGIN_PASSWORD env. variable)
  --url       Mergin url      (defaults to app.merginmaps.com)

Commands:
  create         Create a new project on Mergin server
  download       Download last version of mergin project
  sync           Pull&Push the changes
  remove         Remove project from server.

Development

Compilation

Windows

For CI setup, see this GitHub Action

  1. Install Visual Studio (At least c++ compiler)
  2. Install Qt5 (some recent version, 5.14.x or 5.15.x)
  3. Install Cmake
  4. Compile Geodiff
 <in VS cmd>
 git clone https://github.com/MerginMaps/geodiff
 cd build-geodiff
 cmake ..\geodiff\geodiff 
 cmake --build . --config Release           
  1. Download Input
 git clone https://github.com/MerginMaps/input
 git checkout mergin_cpp
  1. Compile Client
 <in VS cmd>
 cd build-client
 cp ..\mergin-cpp-client\scripts\ci\config.pri ..\mergin-cpp-client\src\config.pri (+ modify!!)
 qmake ..\mergin-cpp-client\src\client.pro
 nmake release

Tests

For running test do:

    export TEST_MERGIN_URL=<url> # testing server
    export TEST_API_USERNAME=<username>
    export TEST_API_PASSWORD=<pwd>
    ./tests.bash <path_to>/mergin