![]() |
EduArt Sensor Ring Library 3.0.1
|
💡 You can either include the EduArt Sensor Ring library in your own CMake project via the FetchContent feature or build the library from source.
The Sensor Ring library is easy to integrate in your own CMake projects. Simply add these lines to your CMakeLists.txt:
Here is an absolute minimum example of a CMakeLists.txt that includes the Sensor Ring library.
You can then simply include the Sensor Ring headers into your C++ program and compile the project.
The library is built with a standard CMake workflow which is almost identical for Windows and Linux. Use the following commands to build the library.
Linux
| Build Option | Default Value | Description |
|---|---|---|
| SENSORRING_BUILD_DOCUMENTATION | ON | Build the documentation |
| SENSORRING_BUILD_EXAMPLES | ON | Build the example programs |
| SENSORRING_BUILD_PYTHON_BINDINGS | ON | Build python bindings |
| SENSORRING_BUILD_SHARED_LIBS | ON | Build as shared library |
| SENSORRING_USE_SOCKETCAN | ON | Compile with support for Linux SocketCAN |
| SENSORRING_USE_USBTINGO | ON | Compile with support for the USBtingo USB adapter |
| CMAKE_BUILD_TYPE | Release | Choose the type of build (Debug/Release/RelWithDebInfo) |
| CMAKE_INSTALL_PREFIX | /usr/local | Install path prefix, prepended onto install directories |
Windows
| Build Option | Default Value | Description |
|---|---|---|
| SENSORRING_BUILD_DOCUMENTATION | ON | Build the documentation |
| SENSORRING_BUILD_EXAMPLES | ON | Build the example programs |
| SENSORRING_BUILD_PYTHON_BINDINGS | ON | Build python bindings |
| SENSORRING_BUILD_SHARED_LIBS | ON | Build as shared library |
| SENSORRING_USE_USBTINGO | ON | Compile with support for the USBtingo USB adapter |
| CMAKE_BUILD_TYPE | Release | Choose the type of build (Debug/Release/RelWithDebInfo) |
| CMAKE_INSTALL_PREFIX | C:\Program Files | Install path prefix, prepended onto install directories |
After building the library you can install it to make it available to all projects on your computer.
Linux
⚠️ The default installation directory of the library is /usr/local. If another location is chosen, add your custom install path to the CMAKE_PREFIX_PATH environment variable for other CMake packages to find the library. Alternatively you can set sensorring_DIR if you don't want to manipulate CMAKE_PREFIX_PATH.
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:<install-path>
Windows
⚠️ The default installation directory of the library is C:\Program Files. If another location is chosen, add your custom install path to the CMAKE_PREFIX_PATH environment variable for other CMake packages to find the library. Alternatively you can set sensorring_DIR if you don't want to manipulate CMAKE_PREFIX_PATH.
$env:CMAKE_PREFIX_PATH = "$($env:CMAKE_PREFIX_PATH);<install-path>"
Instead of installing the library directly, you can generate installable packages to distribute it to other computers. However, distributing the installable package requires that the computer on which you build the library and the computers on which you install it have matching systems.
Linux
ℹ️ Running the command on Linux generates a .tar.gz archive and a .deb package. Generated packages are located in the directories edu_lib_sensorring/release or edu_lib_sensorring/debug depending on the build type.
⚠️ The default installation directory of the library is /usr/local. If another location is chosen, add your custom install path to the CMAKE_PREFIX_PATH environment variable for other CMake packages to find the library. Alternatively you can set sensorring_DIR if you don't want to manipulate CMAKE_PREFIX_PATH.
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:<install-path>
Windows
ℹ️ Running the command on Windows generates .zip archive. Generated packages are located in the directories edu_lib_sensorring/release or edu_lib_sensorring/debug depending on the build type.
⚠️ The default installation directory of the library is C:\Program Files. If another location is chosen, add your custom install path to the CMAKE_PREFIX_PATH environment variable for other CMake packages to find the library. Alternatively you can set sensorring_DIR if you don't want to manipulate CMAKE_PREFIX_PATH.
$env:CMAKE_PREFIX_PATH = "$($env:CMAKE_PREFIX_PATH);<install-path>"