From 7f24d53535936e71feed3de9737e75288bd3c239 Mon Sep 17 00:00:00 2001 From: Alexis Paques Date: Wed, 25 Sep 2024 13:11:19 +0200 Subject: [PATCH] Uxrce: Add per board/target dds_topics.yaml file --- src/modules/uxrce_dds_client/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/uxrce_dds_client/CMakeLists.txt b/src/modules/uxrce_dds_client/CMakeLists.txt index 60c390892b35..e88f438644c6 100644 --- a/src/modules/uxrce_dds_client/CMakeLists.txt +++ b/src/modules/uxrce_dds_client/CMakeLists.txt @@ -113,13 +113,18 @@ else() add_dependencies(microxrceddsclient libmicroxrceddsclient_project) target_include_directories(microxrceddsclient INTERFACE ${microxrceddsclient_build_dir}/include) - + set(DDS_TOPICS_YAML ${CMAKE_CURRENT_SOURCE_DIR}/dds_topics.yaml) + if(EXISTS ${PX4_BOARD_DIR}/${PX4_BOARD_LABEL}_dds_topics.yaml) + set(DDS_TOPICS_YAML ${PX4_BOARD_DIR}/${PX4_BOARD_LABEL}_dds_topics.yaml) + elseif(EXISTS ${PX4_BOARD_DIR}/default_dds_topics.yaml) + set(DDS_TOPICS_YAML ${PX4_BOARD_DIR}/default_dds_topics.yaml) + endif() add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dds_topics.h COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/generate_dds_topics.py --topic-msg-dir ${PX4_SOURCE_DIR}/msg --client-outdir ${CMAKE_CURRENT_BINARY_DIR} - --dds-topics-file ${CMAKE_CURRENT_SOURCE_DIR}/dds_topics.yaml + --dds-topics-file ${DDS_TOPICS_YAML} --template_file ${CMAKE_CURRENT_SOURCE_DIR}/dds_topics.h.em DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/generate_dds_topics.py