Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

via-units-cpp

License C/C++ CI codecov

Units for air navigation as defined in International Civil Aviation Organization (ICAO) Annex 5.

The library defines:

Use

The C++ software has no dependencies. The C++ tests use the boost.test library.

C++

Installation

The library is header only, so the library include directory just needs to be added to the include path. Alternatively, when using cmake the environment variable ViaUnits_DIR just needs to be set to the location of the via-units-cpp directory; cmake will add it to the include path.

Note: CMakeLists.txt is setup to install python by default, so -DINSTALL_PYTHON=OFF must be passed to cmake when building for C++.

cmake can also be used to install the library to the relevant include directory on Linux/macOS. In the via-units-cpp directory, run:

cmake -DINSTALL_PYTHON=OFF .
sudo make install

Note: it will be necessary to delete the CMakeCache.txt file created by running cmake above, before running cmake on this library again.

Tests

The C++ tests can be built and run using cmake by running:

cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DINSTALL_PYTHON=OFF -DCPP_UNIT_TESTS=ON <via-units-cpp directory>
make
make test

Note: -DCMAKE_EXPORT_COMPILE_COMMANDS=1 creates a compile_commands.json file which can be copied back into the via-units-cpp directory for clangd tools.

Python

The library uses pybind11 to provide C++ Python bindings and scikit-build to build a python package using cmake.

From the parent directory of via-units-cpp, run:

pip install ./via-units-cpp

In Python code import the software as via_units, e.g.:

from via_units import Feet, Metres, NauticalMiles

See: test_units.py.

License

via-units-cpp is provided under a MIT license, see LICENSE.

About

Units for air navigation as defined in ICAO Annex 5.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages