Files
PX4-Autopilot/cmake
Benjamin Cabé 9d5d5c4dda build(cmake): allow building PX4 as a CMake subproject
Let another CMake project build PX4 with add_subdirectory(), for instance the build system of an RTOS that links the firmware image. A subproject leaves to its parent project what applies to the whole build:

- the build type and ccache, which affect every target
- the CMake cache: the board configuration is kept in normal variables, so that its CONFIG_* entries do not mix with the parent project's
- the firmware image, so the airframe metadata, packaging and size analysis targets are not created

PX4's CMake modules are prepended to the module path, so that modules of the parent project with the same name, such as kconfig or ccache, do not replace them. Standalone builds are unchanged.

Assisted-by: Claude:opus-5.5
Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2026-10-14 11:41:53 +02:00
..