- Table of Contents
- Build options
- Standalone (CMake package)
- Integration into an existing project (Git Submodule)
- Documentation
You can choose to install the library as a CMake Package or embed it into your project as a git submodule.
Clone the libVDA5050++ Project
git clone git@git.openlogisticsfoundation.org:silicon-economy/libraries/vda5050/libvda5050pp.git
Checkout dev branch in "libvda5050pp" folder if you want to continue with development, otherwise skip this step and continue with master branch
git checkout dev
The libVDA505++ comes with some extra components
(see extra/ directory). These components can be enabled/disabled at will.
The default configuration is achieved by running the following command inside of the libVDA5050++ project root:
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-10 \
-DBUILD_DOCS=ON \ # enable documentation
-DBUILD_TESTING=ON # enable testingIf paho was installed in a non-default location, you need to
specify it's install path with -DCMAKE_PREFIX_PATH=<path>.
Optionally setup a custom install path with -DCMAKE_INSTALL_PREFIX=<path>.
Available extra components can be enabled via:
- MQTTConnector (needs JSON_MODEL):
-DUSE_EXTRA_MQTT_CONNECTOR=ON - JSON_MODEL:
-DUSE_EXTRA_JSON_MODEL=ON - LoggerUtils:
-DUSE_EXTRA_LOGGER_UTILS=ON
cmake --build build --target allRun the following command from inside of the build/ directory:
ctest(may need to be run as privileged user)
cmake --build build --target installcmake --build build --target mkdocsview it by running mkdocs serve inside of the build/ directory.
Once installed, you can locate the library via
CMake's find_package command:
find_package(libvda5050++ "1.0" REQUIRED COMPONENTS
# uncomment the desired components
# since mqtt_connector depends on json_model, make sure to import put json_model before
# json_model
# mqtt_connector
# logger_utils
)All exported targets are prefixed with the libvda5050++::
namespace:
libvda5050++::vda5050++the main librarylibvda5050++::mqtt_connectorextra componentlibvda5050++::json_modelextra componentlibvda5050++::logger_utilsextra component
Your CMakeLists.txt may contain the following lines:
find_package(libvda5050++ "1.0" REQUIRED COMPONENTS
json_model
mqtt_connector
)
add_executable(MY_APP main.cpp)
target_link_libraries(MY_APP PUBLIC
libvda5050++::vda5050++
libvda5050++::mqtt_connector
)In this tutorial we assume you have a third party folder for third party software you use in your project. If you have another file structure replace the third_party folder in the commands with your file structure.
To add the libVDA5050++ as a submodule to your project execute the following command. Notice that your project must already be a git project!
git submodule add git@git.openlogisticsfoundation.org:silicon-economy/libraries/vda5050/libvda5050pp.git third_partyTo download the added submodule to your project execute the following command:
git submodule update --init --recursiveFor more information about git submodules visit the official Git Submodule Documentation.
To Process how to integrate the submodule to your Cmake Project is described in the Quick Start Guide
The libVDA505++ comes with some extra components
(see extra/ directory). These components can be enabled/disabled at will.
To enable some extra targets, you need to add a selection of the following
lines to your top-level CMakeLists.txt before the add_subdirectory
command in the next step.
set(USE_EXTRA_MQTT_CONNECTOR ON) # enable mqtt_connector target
set(USE_EXTRA_JSON_MODEL ON) # enable json_model target
set(USE_EXTRA_LOGGER_UTILS ON) # enable logger_utils targetAdd the following cmake commands to your top-level CMakeLists.txt:
With CMake, you can directly include the libvda5050++ directory like this:
## Add libvda5050++ subdirectory
add_subdirectory(third_party/libvda5050pp)To link the library with your AGV project, you can depend on the vda5050++ target:
target_link_libraries(${PROJECT_NAME} PUBLIC
vda5050++
)NOTE: When including the library as a CMake subdirectory, all targets are not prefixed with libvda5050++::.
If you can not include the project via CMake, you can still build it directly.
To build libVDA5050++ together with your project, you need to add the libvda5050pp/include and libvda5050pp/third_party/SimplePTN/include folder to your include path. All sources in libvda5050pp/src have to be built. For the main sources, the only library used is the STL (c++17).
Note: the project requires c++17 language features.
For viewing the documentation inside your browser, it's necessary to install mkdocs.
Inside of the project root folder run:
mkdocs serveYou can now view the documentation in your browser.
To recompile the diagrams, run docs/diagrams/generate.sh
Install mkdocs and doxygen, then run the mkdocs build target inside of the build folder:
cmake --build build --target mkdocsMake sure the build was configured with BUILD_DOCS=ON.
See Configuring the build.
PROJECT_ROOT/build/site now contains the documentation. After building, the documentation can be served by running the following command inside the build folder:
mkdocs serveYou can now view the documentation in your browser.