Creating the build tree.
cmake -B build
- MDFU_MAX_COMMAND_DATA_LENGTH: Defines the maximum MDFU command data length that is supported. This must be at least the same size as the MDFU client reported size.
- MDFU_MAX_RESPONSE_DATA_LENGTH: Defines the maximumd MDFU response data length that is supported.
- MDFU_LOG_TRANSPORT_FRAME: When defined and verbose level for logging is set to debug, the frames on the transport layer will be logged. Do not use for non-buffered mac layers or loggers since the logging can take some time depending on how this is implemented so the host might be late to receive the next frame after logging the sent frame.
- LINUX_SUBSYSTEM_I2C: Include Linux I2C target device, default ON.
- LINUX_SUBSYSTEM_SPI: Include Linux SPI target device, default ON.
- LINUX_SUBSYSTEM_SERIAL: Include Linux serial target device, default ON.
- WINDOWS_SUBSYSTEM_SERIAL: Include Windows serial target device, default OFF.
- LINUX_SUBSYSTEM_NETWORK: Include Linux network target device, default ON.
Example for creating the build tree and configuring maximum MDFU command data size.
cmake -B build -D MDFU_MAX_COMMAND_DATA_LENGTH=1024
Creating a build for Win32 serial devices only:
cmake -B build -D LINUX_SUBSYSTEM_I2C=OFF -D LINUX_SUBSYSTEM_SPI=OFF -D LINUX_SUBSYSTEM_NETWORK=OFF -D LINUX_SUBSYSTEM_SERIAL=OFF -D WINDOWS_SUBSYSTEM_SERIAL=ON
Building by invocing native build tools through cmake
cmake --build build
or by using native tools e.g. for make project
cd build
make
Build cmdfu
utility only (needed for Windows build which doesn't yet support tests):
cmake --build build --target cmdfu
cd .\build\apps\cmdfu\cmdfu
./cmdfu
The install script will put the application into the system folders which are included in the search path.
cd ./build
make install
Create a package after building as a separate step.
cd build
cpack
The source and debian package will be available in the ./build directory.
Build and packaging in one step.
cmake --build build --target package