Skip to content

Commit

Permalink
Adds ability to have out-of-tree uORB message definitions
Browse files Browse the repository at this point in the history
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,
<build_dir>/uORB/topics. The uORB topic sources are generated in
<build_dir>/msg/topics_sources.
  • Loading branch information
ksschwabe committed Mar 14, 2018
1 parent dacec87 commit eda10d8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions msg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit eda10d8

Please sign in to comment.