From 60850fa528e914ecaaad50e3301a371f668e37d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Thu, 26 Nov 2020 13:47:47 +0100 Subject: [PATCH] metadata: add extract_events target This will collect the events from the whole source tree --- Makefile | 7 +++++-- cmake/metadata.cmake | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 569223b43d..846f0c7cff 100644 --- a/Makefile +++ b/Makefile @@ -320,7 +320,7 @@ coverity_scan: px4_sitl_default # Documentation # -------------------------------------------------------------------- -.PHONY: parameters_metadata airframe_metadata module_documentation px4_metadata doxygen +.PHONY: parameters_metadata airframe_metadata module_documentation extract_events px4_metadata doxygen parameters_metadata: @$(MAKE) --no-print-directory px4_sitl_default metadata_parameters ver_gen @@ -331,7 +331,10 @@ airframe_metadata: module_documentation: @$(MAKE) --no-print-directory px4_sitl_default metadata_module_documentation -px4_metadata: parameters_metadata airframe_metadata module_documentation +extract_events: + @$(MAKE) --no-print-directory px4_sitl_default metadata_extract_events ver_gen + +px4_metadata: parameters_metadata airframe_metadata module_documentation extract_events doxygen: @mkdir -p "$(SRC_DIR)"/build/doxygen diff --git a/cmake/metadata.cmake b/cmake/metadata.cmake index 81d1364d99..dc8ecd1725 100644 --- a/cmake/metadata.cmake +++ b/cmake/metadata.cmake @@ -79,9 +79,27 @@ add_custom_target(metadata_module_documentation USES_TERMINAL ) +set(events_src_path "${PX4_SOURCE_DIR}/src/lib/events") +add_custom_target(metadata_extract_events + COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/px_process_events.py + --src-path ${PX4_SOURCE_DIR}/src + --json ${PX4_BINARY_DIR}/events/px4_full.json #--verbose + COMMAND ${PYTHON_EXECUTABLE} ${events_src_path}/libevents/scripts/combine.py + ${PX4_BINARY_DIR}/events/px4_full.json + ${events_src_path}/libevents/events/common.json + --output ${PX4_BINARY_DIR}/events/all_events_full.json + COMMAND ${PYTHON_EXECUTABLE} ${events_src_path}/libevents/scripts/validate.py + ${PX4_BINARY_DIR}/events/all_events_full.json + COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/compress.py + ${PX4_BINARY_DIR}/events/all_events_full.json + COMMENT "Extracting events from full source" + USES_TERMINAL +) + add_custom_target(all_metadata DEPENDS metadata_airframes metadata_parameters metadata_module_documentation + metadata_extract_events )