carla/LibCarla/CMakeLists.txt

324 lines
8.6 KiB
CMake
Raw Normal View History

2024-02-05 18:52:25 +08:00
set (LIBCARLA_SOURCE_PATH ${CARLA_WORKSPACE_PATH}/LibCarla/source)
set (LIBCARLA_THIRD_PARTY_SOURCE_PATH ${LIBCARLA_SOURCE_PATH}/third-party)
2024-02-13 16:23:52 +08:00
set (CARLA_PYTHON_VERSION_MAJOR 3)
set (CARLA_PYTHON_VERSION_MINOR 8)
2024-02-23 00:39:48 +08:00
carla_two_step_configure_file (
2024-02-05 18:52:25 +08:00
${LIBCARLA_SOURCE_PATH}/carla/Version.h
2024-02-23 00:39:48 +08:00
${LIBCARLA_SOURCE_PATH}/carla/Version.h.in
2024-02-05 18:52:25 +08:00
)
2024-02-23 00:39:48 +08:00
set (CARLA_RTTI_DEFINITIONS)
if (ENABLE_RTTI)
else ()
list (
APPEND
CARLA_RTTI_DEFINITIONS
BOOST_TYPE_INDEX_FORCE_NO_RTTI_COMPATIBILITY
)
endif ()
2024-02-05 18:52:25 +08:00
if (BUILD_CARLA_SERVER)
2024-03-08 00:11:15 +08:00
project (
carla-server
LANGUAGES CXX
VERSION ${CARLA_VERSION}
)
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
file (
GLOB
LIBCARLA_SERVER_SOURCES
${LIBCARLA_SOURCE_PATH}/carla/Buffer.cpp
${LIBCARLA_SOURCE_PATH}/carla/Exception.cpp
${LIBCARLA_SOURCE_PATH}/carla/geom/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/opendrive/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/opendrive/parser/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/element/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/general/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/object/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/signal/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/rpc/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/sensor/s11n/SensorHeaderSerializer.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/tcp/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/multigpu/*.cpp
)
if (ENABLE_ROS2)
2024-02-05 18:52:25 +08:00
file (
2024-03-08 00:11:15 +08:00
GLOB
LIBCARLA_SERVER_SOURCES_ROS2
${LIBCARLA_SOURCE_PATH}/carla/ros2/*.cpp
2024-02-05 18:52:25 +08:00
)
2024-03-08 00:11:15 +08:00
list (
APPEND
LIBCARLA_SERVER_SOURCES
${LIBCARLA_SERVER_SOURCES_ROS2}
2024-02-05 18:52:25 +08:00
)
2024-03-08 00:11:15 +08:00
endif ()
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
file (
GLOB
LIBCARLA_SERVER_SOURCES_THIRD_PARTY
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/moodycamel/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.cpp
)
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
file (
GLOB
LIBCARLA_SERVER_HEADERS
${LIBCARLA_SOURCE_PATH}/carla/*.h
${LIBCARLA_SOURCE_PATH}/carla/geom/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/parser/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/element/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/general/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/object/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/signal/*.h
${LIBCARLA_SOURCE_PATH}/carla/rpc/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/s11n/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/low_level/*.h
${LIBCARLA_SOURCE_PATH}/carla/multigpu/*.h
${LIBCARLA_SOURCE_PATH}/compiler/*.h
)
if (ENABLE_ROS2)
2024-02-05 18:52:25 +08:00
file (
2024-03-08 00:11:15 +08:00
GLOB
LIBCARLA_SERVER_HEADERS_ROS2
${LIBCARLA_SOURCE_PATH}/carla/ros2/*.h
)
2024-03-08 00:11:15 +08:00
list (
APPEND
LIBCARLA_SERVER_HEADERS
${LIBCARLA_SERVER_HEADERS_ROS2}
2024-02-05 18:52:25 +08:00
)
2024-03-08 00:11:15 +08:00
endif ()
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
file (
GLOB
LIBCARLA_SERVER_HEADERS_THIRD_PARTY
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/moodycamel/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.hpp
)
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
add_library (
carla-server
${LIBCARLA_SERVER_HEADERS}
${LIBCARLA_SERVER_SOURCES}
${LIBCARLA_SERVER_HEADERS_THIRD_PARTY}
${LIBCARLA_SERVER_SOURCES_THIRD_PARTY}
)
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
target_link_libraries (
carla-server PUBLIC
Boost::asio
Boost::geometry
Boost::algorithm
Boost::assert
Boost::gil
RecastNavigation::Recast
RecastNavigation::Detour
RecastNavigation::DetourCrowd
png_static
zlibstatic
rpc
)
target_include_directories (
carla-server PUBLIC
${LIBCARLA_SOURCE_PATH}
)
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
target_compile_definitions (
carla-server PUBLIC
${CARLA_COMMON_DEFINITIONS}
${CARLA_EXCEPTION_DEFINITIONS}
${CARLA_RTTI_DEFINITIONS}
)
2024-02-05 18:52:25 +08:00
endif ()
if (BUILD_CARLA_CLIENT)
2024-03-08 00:11:15 +08:00
project (
carla-client
LANGUAGES CXX
VERSION ${CARLA_VERSION}
)
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
file (
GLOB
LIBCARLA_CLIENT_HEADERS
${LIBCARLA_SOURCE_PATH}/carla/*.h
${LIBCARLA_SOURCE_PATH}/carla/client/*.h
${LIBCARLA_SOURCE_PATH}/carla/client/detail/*.h
${LIBCARLA_SOURCE_PATH}/carla/geom/*.h
${LIBCARLA_SOURCE_PATH}/carla/image/*.h
${LIBCARLA_SOURCE_PATH}/carla/nav/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/*.h
${LIBCARLA_SOURCE_PATH}/carla/opendrive/parser/*.h
${LIBCARLA_SOURCE_PATH}/carla/pointcloud/*.h
${LIBCARLA_SOURCE_PATH}/carla/profiler/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/element/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/general/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/object/*.h
${LIBCARLA_SOURCE_PATH}/carla/road/signal/*.h
${LIBCARLA_SOURCE_PATH}/carla/rpc/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/data/*.h
${LIBCARLA_SOURCE_PATH}/carla/sensor/s11n/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/tcp/*.h
${LIBCARLA_SOURCE_PATH}/carla/streaming/low_level/*.h
${LIBCARLA_SOURCE_PATH}/carla/multigpu/*.h
${LIBCARLA_SOURCE_PATH}/carla/trafficmanager/*.h
${LIBCARLA_SOURCE_PATH}/compiler/*.h
)
if (ENABLE_ROS2)
2024-02-05 18:52:25 +08:00
file (
2024-03-08 00:11:15 +08:00
GLOB
LIBCARLA_CLIENT_HEADERS_ROS2
${LIBCARLA_SOURCE_PATH}/carla/ros2/*.h
2024-02-05 18:52:25 +08:00
)
2024-03-08 00:11:15 +08:00
list (
APPEND
LIBCARLA_CLIENT_HEADERS
${LIBCARLA_CLIENT_HEADERS_ROS2}
)
endif ()
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
if (ENABLE_RSS)
2024-02-05 18:52:25 +08:00
file (
2024-03-08 00:11:15 +08:00
GLOB
LIBCARLA_CLIENT_HEADERS_RSS
${LIBCARLA_SOURCE_PATH}/carla/rss/*.h
)
list (
APPEND
LIBCARLA_CLIENT_HEADERS
${LIBCARLA_CLIENT_HEADERS_RSS}
2024-02-05 18:52:25 +08:00
)
2024-03-08 00:11:15 +08:00
endif ()
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
file (
GLOB
LIBCARLA_CLIENT_HEADERS_THIRD_PARTY
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/moodycamel/*.h
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.hpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.h
)
file (
GLOB
LIBCARLA_CLIENT_SOURCES
${LIBCARLA_SOURCE_PATH}/carla/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/client/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/client/detail/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/geom/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/image/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/nav/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/opendrive/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/opendrive/parser/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/pointcloud/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/element/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/general/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/object/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/road/signal/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/rpc/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/sensor/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/sensor/data/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/sensor/s11n/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/detail/tcp/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/streaming/low_level/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/multigpu/*.cpp
${LIBCARLA_SOURCE_PATH}/carla/trafficmanager/*.cpp
)
if (ENABLE_ROS2)
2024-02-05 18:52:25 +08:00
file (
2024-03-08 00:11:15 +08:00
GLOB
LIBCARLA_CLIENT_SOURCES_ROS2
${LIBCARLA_SOURCE_PATH}/carla/ros2/*.cpp
2024-02-05 18:52:25 +08:00
)
2024-03-08 00:11:15 +08:00
list (
APPEND
LIBCARLA_CLIENT_SOURCES
${LIBCARLA_CLIENT_SOURCES_ROS2}
)
endif ()
if (ENABLE_RSS)
file (
2024-03-08 00:11:15 +08:00
GLOB
LIBCARLA_CLIENT_SOURCES_RSS
${LIBCARLA_SOURCE_PATH}/carla/rss/*.cpp
)
list (
2024-03-08 00:11:15 +08:00
APPEND
LIBCARLA_CLIENT_SOURCES
${LIBCARLA_CLIENT_SOURCES_RSS}
)
2024-03-08 00:11:15 +08:00
endif ()
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
file (
GLOB
LIBCARLA_CLIENT_SOURCES_THIRD_PARTY
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/odrSpiral/*.cpp
${LIBCARLA_THIRD_PARTY_SOURCE_PATH}/pugixml/*.cpp
)
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
add_library (
carla-client
${LIBCARLA_CLIENT_HEADERS}
${LIBCARLA_CLIENT_SOURCES}
${LIBCARLA_CLIENT_HEADERS_THIRD_PARTY}
${LIBCARLA_CLIENT_SOURCES_THIRD_PARTY}
)
2024-03-08 00:11:15 +08:00
target_link_libraries (
carla-client PUBLIC
Boost::asio
Boost::algorithm
Boost::geometry
Boost::assert
Boost::gil
RecastNavigation::Recast
RecastNavigation::Detour
RecastNavigation::DetourCrowd
png_static
zlibstatic
rpc
)
target_include_directories (
carla-client PUBLIC
${LIBCARLA_SOURCE_PATH}
)
2024-02-05 18:52:25 +08:00
2024-03-08 00:11:15 +08:00
target_compile_definitions (
carla-client PUBLIC
${CARLA_COMMON_DEFINITIONS}
${CARLA_RTTI_DEFINITIONS}
)
2024-02-05 18:52:25 +08:00
2024-02-22 23:49:15 +08:00
endif ()