msg: add a deprecated uORB msgs list to CMake

This commit is contained in:
TSC21 2019-11-22 12:48:09 +00:00 committed by Beat Küng
parent 7ca8a8dbaa
commit 16f53ec18d
2 changed files with 29 additions and 1 deletions

View File

@ -31,6 +31,9 @@
#
############################################################################
# Support IN_LIST if() operator
cmake_policy(SET CMP0057 NEW)
set(msg_files
actuator_armed.msg
actuator_controls.msg
@ -52,7 +55,7 @@ set(msg_files
debug_vect.msg
differential_pressure.msg
distance_sensor.msg
ekf2_innovations.msg
ekf2_innovations.msg # TODO: remove as soon as https://github.com/PX4/Firmware/pull/13127 is rebased over this
ekf2_timestamps.msg
ekf_gps_drift.msg
ekf_gps_position.msg
@ -151,6 +154,30 @@ set(msg_files
wind_estimate.msg
)
set(deprecated_msgs
# TODO: uncomment as soon as https://github.com/PX4/Firmware/pull/13127 is rebased over this
# ekf2_innovations.msg # 2019-11-22, Updated estimator interface and logging; replaced by 'estimator_innovations'.
)
foreach(msg IN LISTS deprecated_msgs)
if(msg IN_LIST msg_files)
get_filename_component(msg_we ${msg} NAME_WE)
list(APPEND invalid_msgs ${msg_we})
endif()
endforeach()
if(invalid_msgs)
list(LENGTH invalid_msgs invalid_msgs_size)
if(${invalid_msgs_size} GREATER 1)
foreach(msg IN LISTS invalid_msgs)
string(CONCAT invalid_msgs_cs ${invalid_msgs_cs} "'${msg}', ")
endforeach()
STRING(REGEX REPLACE ", +$" "" invalid_msgs_cs ${invalid_msgs_cs})
message(FATAL_ERROR "${invalid_msgs_cs} are listed as deprecated. Please use different names for the messages.")
else()
message(FATAL_ERROR "'${invalid_msgs}' is listed as deprecated. Please use a different name for the message.")
endif()
endif()
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)

View File

@ -45,6 +45,7 @@ rtps:
- msg: distance_sensor
id: 17
send: true
# TODO: replace with 'estimator_innovations' as https://github.com/PX4/Firmware/pull/13127 is rebased over this
- msg: ekf2_innovations
id: 18
- msg: ekf2_timestamps