Add Ros2 demo flags for cmake

This commit is contained in:
PabloVD 2024-05-21 13:30:13 +02:00 committed by Blyron
parent 678e8b48c0
commit e1cfe639fc
3 changed files with 22 additions and 16 deletions

View File

@ -56,6 +56,12 @@ carla_option (
OFF
)
carla_option (
ENABLE_ROS2_DEMO
"Enable ROS2 demo."
OFF
)
carla_option (
ENABLE_OSM2ODR
"Enable OSM2ODR."

View File

@ -100,6 +100,10 @@ if (BUILD_CARLA_SERVER)
set (CARLA_ROS2_DEFINITIONS WITH_ROS2)
endif ()
if (ENABLE_ROS2_DEMO)
set (CARLA_ROS2_DEFINITIONS ${CARLA_ROS2_DEFINITIONS} WITH_ROS2_DEMO)
endif ()
file (
GLOB
LIBCARLA_SERVER_HEADERS_THIRD_PARTY

View File

@ -57,6 +57,10 @@ if (ENABLE_ROS2)
set (LAUNCH_ARGS ${LAUNCH_ARGS} --ros2)
endif()
if (ENABLE_ROS2_DEMO)
set (LAUNCH_ARGS ${LAUNCH_ARGS} --ros2-demo)
endif()
if (WIN32)
set (EXE_EXT .exe)
set (UE_SYSTEM_NAME Win64)
@ -161,6 +165,14 @@ if (ENABLE_ROS2)
)
endif()
if (ENABLE_ROS2_DEMO)
list (
APPEND
CARLA_UNREAL_OPTIONS
"ROS2_DEMO"
)
endif()
if (ENABLE_OSM2ODR)
list (
APPEND
@ -482,22 +494,6 @@ carla_add_custom_target (
VERBATIM
)
if (ENABLE_ROS2)
carla_add_custom_target (
launch-ros2-demo
COMMENT
"Launching Carla Unreal..."
COMMAND
${UNREAL_EDITOR_PATH}
${CARLA_UE_PROJECT_PATH}
-${CARLA_UNREAL_RHI}
--ros2-demo
${LAUNCH_ARGS}
USES_TERMINAL
VERBATIM
)
endif()
add_dependencies (
launch
carla-unreal-editor