A general purpose math library based on Eigen. It is currently a header-only library.
| Dependency | Version | Description |
|---|---|---|
| CMake | >= 3.21 | CMake Build Tool |
| cmakebox | >= 0.0.1 | CMake Functions and Utilities |
| cppbox | >= 0.1.0 | C++ Package |
| Eigen3 | >= 3.4.0 | Linear Algebra Package |
There are several ways to include mathbox within your project:
- [Preferred] Via
FetchContentallowing package to be built as a submodule. - Via
find_package, requiring package to be installed to the system, locally, or to a catkin workspace.
It is recommended to leverage the functionality of cmakebox by including the following lines in the CMakeLists.txt (replace X.Y.Z with version):
set(CMAKEBOX_VERSION "0.0.1")
FetchContent_Declare(
cmakebox
GIT_REPOSITORY [email protected]:willat343/cmakebox.git
GIT_TAG v${CMAKEBOX_VERSION}
)
FetchContent_MakeAvailable(cmakebox)
list(APPEND CMAKE_MODULE_PATH "${cmakebox_SOURCE_DIR}/cmake")
include(CMakeBox)
set(MATHBOX_VERSION "X.Y.Z")
import_dependency(
mathbox
TARGET mathbox::mathbox
VERSION ${MATHBOX_VERSION}
GIT_REPOSITORY [email protected]:willat343/mathbox
GIT_TAG v${MATHBOX_VERSION}
)Without relying on cmakebox, this can be achieved with (replace X.Y.Z with version):
set(MATHBOX_VERSION "X.Y.Z")
FetchContent_Declare(
mathbox
GIT_REPOSITORY [email protected]:willat343/mathbox
GIT_TAG v${MATHBOX_VERSION}
)
FetchContent_MakeAvailable(mathbox)git clone [email protected]:willat343/mathbox.git
cd mathboxFor system install:
cmake -S . -B buildFor local install:
cmake -S . -B build -DCMAKE_INSTALL_DIR=$HOME/.localcmake --build build -jsudo cmake --build build --target installInclude with the following lines in the CMakeLists.txt:
find_package(mathbox REQUIRED)
target_link_libraries(<target> PUBLIC mathbox::mathbox)sudo cmake --build build --target uninstallA package.xml is supplied to facilitate an isolated installation within a catkin workspace (e.g. for ROS applications).
cd /path/to/catkin_ws/src
git clone [email protected]:willat343/mathbox.gitcd /path/to/catkin_ws
catkin build mathboxTo use the package in a downstream project, one should add to their package.xml:
<depend>mathbox</depend>One can then include mathbox package by includeing in the CMakeLists.txt:
find_package(mathbox REQUIRED)
target_link_libraries(<target> PUBLIC mathbox::mathbox)cd /path/to/catkin_ws
catkin clean mathboxDocumentation must be turned on by setting the -DBUILD_DOCUMENTATION=ON cmake argument.
To view the HTML documentation, open the build/docs/html/index.html file.
To view the LaTeX documentation, build it with:
cd build/docs/latex
makeThen open the file refman.pdf.
Tests must be turned on by setting the -DBUILD_TESTS=ON cmake argument.
They can then be run with ctest:
ctest --test-dir testFor more explicit output, the test executables can be run directly from the build directory.