From 51952108931470d994c934b96e03e4e128f139e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Mon, 11 Dec 2017 12:01:09 +0100 Subject: [PATCH] CMakeLists.txt: add custom target uorb_graph to generate the graph JSON files Use like this: make px4fmu-v2_default uorb_graph --- CMakeLists.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80d1164f82..f9d0386c78 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -413,6 +413,27 @@ if (all_posix_cmake_targets) ) endif() + +#============================================================================= +# uORB graph generation: add a custom target 'uorb_graph' +# +set(uorb_graph_config ${BOARD}) + +set(graph_module_list "") +foreach(module ${config_module_list}) + set(graph_module_list "${graph_module_list}" "--src-path" "src/${module}") +endforeach() + +add_custom_command(OUTPUT ${uorb_graph_config} + COMMAND ${PYTHON_EXECUTABLE} ${PX4_SOURCE_DIR}/Tools/uorb_graph/create.py + ${module_list} + --exclude-path src/examples + --file ${PX4_SOURCE_DIR}/Tools/uorb_graph/graph_${uorb_graph_config} + WORKING_DIRECTORY ${PX4_SOURCE_DIR} + COMMENT "Generating uORB graph" +) +add_custom_target(uorb_graph DEPENDS ${uorb_graph_config}) + #============================================================================= # packaging #