From 2a5a7b3a1e8f5a8a4015dc4f2df8e10e52c8eeab Mon Sep 17 00:00:00 2001 From: Karl Schwabe Date: Tue, 13 Mar 2018 23:40:38 +0100 Subject: [PATCH] Adds ability to have out-of-tree uORB message definitions If the EXTERNAL_MODULES_LOCATION variable has been set, and the EXTERNAL_MODULES_LOCATION/msg/ directory exists containing a CMakeLists.txt file with the following format: set(config_msg_list_external message1.msg message2.msg message3.msg ... PARENT_SCOPE ) then the messages defined in config_msg_list_external are added to the msg_files list in Firmware/msg/CMakeLists.txt and are used to generate uORB message headers. The generate uORB message headers are generated in the same location as the normal uORB message headers in the build directory, namely, /uORB/topics. The uORB topic sources are generated in /msg/topics_sources. --- msg/CMakeLists.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/msg/CMakeLists.txt b/msg/CMakeLists.txt index 851c781fa4..c88372dad3 100644 --- a/msg/CMakeLists.txt +++ b/msg/CMakeLists.txt @@ -128,6 +128,18 @@ set(msg_files wind_estimate.msg ) +if(NOT EXTERNAL_MODULES_LOCATION STREQUAL "") + # Check that the msg directory and the CMakeLists.txt file exists + if(EXISTS ${EXTERNAL_MODULES_LOCATION}/msg/CMakeLists.txt) + add_subdirectory(${EXTERNAL_MODULES_LOCATION}/msg external_msg) + + # Add each of the external message files to the global msg_files list + foreach(external_msg_file ${config_msg_list_external}) + list(APPEND msg_files ${EXTERNAL_MODULES_LOCATION}/msg/${external_msg_file}) + endforeach() + endif() +endif() + px4_add_git_submodule(TARGET git_gencpp PATH tools/gencpp) px4_add_git_submodule(TARGET git_genmsg PATH tools/genmsg)