For operating systems where no binary is provided, or if you want the latest development version, you will have to build it from source. The code should be compilable on any system with ISO C++17. It's tested on Ubuntu, macOS, and Windows. Less frequently, someone will build on FreeBSD, OpenBSD, Solaris, etc. Clang/LLVM, GNU C++, and MSVC are regularly exercised via automation.
You can grab a release from the GPSBabel download page, but if you're going to be doing any development, you'll find that working from the GPSBabel Github repo is easier. Checkouts via Git, HTTPS, SSH, and Subversion are supported.
There are external requirements for bulding.
- Qt
Qt version 5.12 or newer is required for all builds. MacOS and Windows users can download binaries from Qt Downloads Fedora or CentOS users may need to 'dnf install qt5-qtbase-devel'. When in doubt, 'dnf search qt' or 'dnf search qt5' may help you find the correct package name. Ubuntu users may need to 'apt-get install qt5-default'. Package names and versions in Linux frequently change, so you may need to ask your Linux vendor for help or look in tools/Docker* for inspiration for our automated builds that use Docker.
- libusb 1.0
is needed to communicate with use with older USB Garmins. For macOS, we use an included copy. Fedora users may need to 'yum install libusb-devel'. Ubuntu users may need to 'apt install libusb-dev' or look in tools/Docker* for inspiration from our automated Docker builds.
Parts of GPSBabel have been public since 2002, with some of the original design and original code came from 2001. It was originally in C89, not C++ and while we strongly encourage modern C++ code where we can use it, we've not gone back to those older formats - some of which we don't have the hardware to test and have fallen out of touch with original authors - and rewritten them in Modern C++ style. There are this void*'s everywhere, C String use, gross buffer abuse, and other things that look more like a C program from the 80's than a C++ program of modern date. Code that's earned it's own wings can continue to fly with us as long as it passes the tests we have. We've additionally not enforced style rules as strongly across modules as we could have. Fixing both of these is a goal for us in 2020.
Qt provides a lovely IDE (Integrated Development Evironment) with an
editor and debugger. Its use is strongly encouraged for those new to C++.
Once you have Qt correctly installed, just opening either the
GPSBabel.pro
or gui/app.pro
files from
the OS file launcher (e.g. a double click in macOS while seeing it in Finder)
or from a File->Open in an already-running instance of Qt Creator is the fastest and easiest way for most
people to get to development because it handles things like build dependencies
changing and class and method compilation.
A path of low resistance for some users is to use the Qt build files (*.pro) and compiler chain, but use the command line. If you type qmake in our working directory, it will build a "native" Build file (Makefile, XCode, Visual Studio) which you can use for development.
The GNU Build System (configure) is no longer supported and has been removed. For command line builds please use qmake.
The use of cmake is experimental. The implementation is not complete. It is untested by continuous integration. It is not recommended for production use.
Those familiar with the command line may be more comfortable using qmake from the command line. In most cases, the code is as simple to build as running:
qmake && make
Two build methods are supported with MSVC tools.
To create a visual studio project that can be built with msbuild:
qmake -tp vc
|
To create a Makefile that can be built with nmake:
qmake
|
There are additional flags that can be passed to qmake to customize your build of GPSBabel.
- WITH_LIBUSB=no|pkgconfig|system*|included*|custom
note that libusb is NOT used on windows.
- no
build without libusb-1.0. functionality will be limited.
- pkgconfig
build with libusb-1.0 found by pkg-config.
- system
build with libusb-1.0 found on system library path and under libusb-1.0 on system include path (default, linux, openbsd).
- included
build with libusb-1.0 included with gpsbabel (default, macOS only).
- custom
build with user supplied libusb-1.0. LIBS and INCLUDEPATH may need to be set, e.g. LIBS+=... INCLUDEPATH+=...
- WITH_SHAPELIB=no|pkgconfig|included*|custom
- no
build without shapelib. functionality will be limited.
- pkgconfig
build with shapelib found by pkg-config.
- included
build with shapelib included with gpsbabel (default).
- custom
build with user supplied shapelib. LIBS and INCLUDEPATH may need to be set, e.g. LIBS+=... INCLUDEPATH+=...
- WITH_ZLIB=no|pkgconfig|included*|custom
- no
build without zlib. functionality will be limited.
- pkgconfig
build with zlib found by pkg-config.
- included
build with zlib included with gpsbabel (default).
- custom
build with user supplied zlib. LIBS and INCLUDEPATH may need to be set, e.g. LIBS+=... INCLUDEPATH+=...
- CONFIG+=disable-mappreview
This options disables the map preview feature. With the feature disabled QtWebEngine and QtWebEngineWdigets are not used. Note that QtWebKit and QtWebKitWidgets are not longer supported.
- DOCVERSION=...
string appended to documentation location for www.gpsbabel.org. The default value is the version string, e.g. "1.7.0". This is used by the gpsbabel.org target, you are unlikely to need it unless you are maintaining www.gpsbabel.org.
- WEB=DIR
Path where the documentation will be stored for www.gpsbabel.org. This is used by the gpsbabel.org target, you are unlikely to need it unless you are maintaining www.gpsbabel.org. The default location is "../babelweb"
Additional makefile targets are available for special purposes.
- check
Run the basic test suite.
- check-vtesto
Run valgrind memcheck.
- gpsbabel
Build the command line tool.
- gpsbabel.hmtl
Create the html documentation.
- gpsbabel.org
Create documentation for use on www.gpsbabel.org.
- gpsbabel.pdf
Create the pdf documentation.
- gui
Build the graphical user interface.
- unix-gui
Build the graphical user interface and collect the components for distribution. On Linux the gpsbabel generated components will be under gui/GPSBabelFE, any dynamically linked required libraries are not included. On macOS an app bundle will be created at gui/GPSBabelFE.app and an apple disk image will be created at gui/GPSBabelFE.dmg.
On non-macOS unix builds by default we now compile in the gpsbabel generated translation files, i.e. gpsbabelfe_*.qm, gpsbabel_*.qm, as well as gmapbase.html. When compiled in these files do not need to be distributed. These are used by the GUI. Additional translation files from Qt will also be used if they are found. They may be in a package such as qttranslations5-l10n or qt5-qttranslations.