if(CONFIG_UORB)
set_property(
TARGET nuttx
APPEND
PROPERTY NUTTX_INCLUDE_DIRECTORIES ${NUTTX_APPS_DIR}/system/uorb)
nuttx_add_library(uorb STATIC)
file(GLOB_RECURSE CSRCS "sensor/*.c" "uORB/uORB.c")
if(CONFIG_UORB_LOOP_MAX_EVENTS)
list(APPEND CSRCS "uORB/loop.c" "uORB/epoll.c")
endif()
if(CONFIG_UORB_LISTENER)
nuttx_add_application(
NAME
uorb_listener
PRIORITY
${CONFIG_UORB_PRIORITY}
STACKSIZE
${CONFIG_UORB_STACKSIZE}
MODULE
${CONFIG_UORB}
SRCS
listener.c
DEPENDS
uorb)
endif()
if(CONFIG_UORB_GENERATOR)
nuttx_add_application(
NAME
uorb_generator
PRIORITY
${CONFIG_UORB_PRIORITY}
STACKSIZE
${CONFIG_UORB_STACKSIZE}
MODULE
${CONFIG_UORB}
SRCS
generator.c
DEPENDS
uorb)
endif()
if(CONFIG_UORB_TESTS)
nuttx_add_application(
NAME
uorb_unit_test
PRIORITY
${CONFIG_UORB_PRIORITY}
STACKSIZE
${CONFIG_UORB_STACKSIZE}
MODULE
${CONFIG_UORB}
SRCS
test/unit_test.c
test/utility.c
DEPENDS
uorb)
endif()
if(CONFIG_UORB_ADVERTISE_DEMO)
nuttx_add_application(
NAME
uorb_advertise_demo
PRIORITY
${CONFIG_UORB_PRIORITY}
STACKSIZE
${CONFIG_UORB_STACKSIZE}
MODULE
${CONFIG_UORB}
SRCS
test/orb_advertise_main.c
DEPENDS
uorb)
endif()
if(CONFIG_UORB_RPMSG_TEST)
nuttx_add_application(
NAME
uorb_rpmsg_test
PRIORITY
${CONFIG_UORB_PRIORITY}
STACKSIZE
${CONFIG_UORB_STACKSIZE}
MODULE
${CONFIG_UORB}
SRCS
test/rpmsg_test.c
DEPENDS
uorb)
endif()
if(CONFIG_UORB_DOWNSAMPLING_TEST)
nuttx_add_application(
NAME
uorb_downsample
PRIORITY
${CONFIG_UORB_PRIORITY}
STACKSIZE
${CONFIG_UORB_STACKSIZE}
MODULE
${CONFIG_UORB}
SRCS
test/downsampling_test.c
DEPENDS
uorb)
endif()
target_include_directories(uorb PUBLIC .)
target_sources(uorb PRIVATE ${CSRCS})
endif()