2024-03-09 03:31:22 +08:00
|
|
|
#[[
|
|
|
|
|
|
|
|
Copyright (c) 2024 Computer Vision Center (CVC) at the Universitat Autonoma
|
|
|
|
de Barcelona (UAB).
|
|
|
|
|
|
|
|
This work is licensed under the terms of the MIT license.
|
|
|
|
For a copy, see <https://opensource.org/licenses/MIT>.
|
|
|
|
|
|
|
|
]]
|
|
|
|
|
2024-03-13 08:04:27 +08:00
|
|
|
cmake_minimum_required (
|
|
|
|
VERSION
|
2024-04-02 16:20:46 +08:00
|
|
|
3.27.2
|
2024-03-13 08:04:27 +08:00
|
|
|
)
|
2024-02-05 18:52:25 +08:00
|
|
|
|
2024-01-25 23:24:20 +08:00
|
|
|
cmake_policy (SET CMP0097 NEW)
|
2024-02-28 22:56:26 +08:00
|
|
|
cmake_policy (SET CMP0091 NEW)
|
2024-03-20 18:34:44 +08:00
|
|
|
cmake_policy (SET CMP0074 NEW)
|
|
|
|
cmake_policy (SET CMP0077 NEW)
|
2024-04-09 22:32:09 +08:00
|
|
|
cmake_policy (SET CMP0117 NEW)
|
2024-03-05 00:52:54 +08:00
|
|
|
if (${CMAKE_MINOR_VERSION} GREATER_EQUAL 24)
|
|
|
|
cmake_policy (SET CMP0135 NEW)
|
|
|
|
endif ()
|
2018-07-04 17:59:59 +08:00
|
|
|
|
2023-11-22 00:32:55 +08:00
|
|
|
set (CARLA_VERSION_MAJOR 0)
|
|
|
|
set (CARLA_VERSION_MINOR 9)
|
2024-02-05 18:52:25 +08:00
|
|
|
set (CARLA_VERSION_PATCH 15)
|
2023-11-23 07:50:55 +08:00
|
|
|
|
2024-02-05 18:52:25 +08:00
|
|
|
set (
|
|
|
|
CARLA_VERSION
|
|
|
|
${CARLA_VERSION_MAJOR}.${CARLA_VERSION_MINOR}.${CARLA_VERSION_PATCH}
|
|
|
|
)
|
2024-01-25 23:24:20 +08:00
|
|
|
|
2023-11-23 07:50:55 +08:00
|
|
|
project (
|
2024-02-07 04:47:29 +08:00
|
|
|
CARLA
|
2024-03-12 20:04:01 +08:00
|
|
|
VERSION
|
|
|
|
${CARLA_VERSION}
|
2024-02-20 23:34:31 +08:00
|
|
|
LANGUAGES
|
|
|
|
C
|
|
|
|
CXX
|
|
|
|
ASM # This is required by some dependencies, such as LibPNG.
|
2024-03-12 20:04:01 +08:00
|
|
|
DESCRIPTION
|
|
|
|
"Open-source simulator for autonomous driving research."
|
|
|
|
HOMEPAGE_URL
|
|
|
|
https://carla.org
|
2024-01-25 23:24:20 +08:00
|
|
|
)
|
|
|
|
|
2024-02-20 23:34:31 +08:00
|
|
|
set (
|
|
|
|
CARLA_WORKSPACE_PATH
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
2024-02-07 04:47:29 +08:00
|
|
|
)
|
|
|
|
|
2024-04-02 18:05:55 +08:00
|
|
|
set (
|
|
|
|
CARLA_PACKAGE_PATH
|
|
|
|
${CMAKE_BINARY_DIR}/Package
|
|
|
|
)
|
|
|
|
|
2024-02-20 23:34:31 +08:00
|
|
|
set (
|
|
|
|
CARLA_UNREAL_PLUGINS_PATH
|
2024-03-04 20:33:51 +08:00
|
|
|
${CARLA_WORKSPACE_PATH}/Unreal/CarlaUnreal/Plugins
|
2024-02-05 18:52:25 +08:00
|
|
|
)
|
2024-02-01 07:46:04 +08:00
|
|
|
|
2024-04-09 22:32:09 +08:00
|
|
|
set (
|
|
|
|
CARLA_LICENSE_FILE_PATH
|
|
|
|
${CARLA_WORKSPACE_PATH}/LICENSE
|
|
|
|
)
|
|
|
|
|
2024-02-20 23:34:31 +08:00
|
|
|
include (CheckCCompilerFlag)
|
|
|
|
include (CheckCXXCompilerFlag)
|
2024-03-09 03:31:22 +08:00
|
|
|
include (CheckLinkerFlag)
|
2024-03-18 21:09:38 +08:00
|
|
|
include (${CARLA_WORKSPACE_PATH}/CMake/Util.cmake)
|
2024-04-09 22:32:09 +08:00
|
|
|
include (${CARLA_WORKSPACE_PATH}/CMake/Options.cmake)
|
|
|
|
include (${CARLA_WORKSPACE_PATH}/CMake/Common.cmake)
|
|
|
|
include (${CARLA_WORKSPACE_PATH}/CMake/Dependencies.cmake)
|
2024-03-18 21:09:38 +08:00
|
|
|
|
2024-02-05 18:52:25 +08:00
|
|
|
if (BUILD_CARLA_CLIENT OR BUILD_CARLA_SERVER)
|
|
|
|
add_subdirectory (LibCarla)
|
2023-11-23 00:29:27 +08:00
|
|
|
endif ()
|
2023-11-16 04:54:26 +08:00
|
|
|
|
2023-11-17 03:55:25 +08:00
|
|
|
if (BUILD_OSM_WORLD_RENDERER)
|
2024-02-05 18:52:25 +08:00
|
|
|
add_subdirectory (osm-world-renderer)
|
2024-01-25 23:24:20 +08:00
|
|
|
endif ()
|
|
|
|
|
2024-03-14 23:27:10 +08:00
|
|
|
if (ENABLE_ROS2)
|
|
|
|
add_subdirectory (Ros2Native)
|
|
|
|
endif()
|
|
|
|
|
2024-01-25 23:24:20 +08:00
|
|
|
if (BUILD_PYTHON_API)
|
2024-02-05 18:52:25 +08:00
|
|
|
add_subdirectory (PythonAPI)
|
2024-02-01 07:46:04 +08:00
|
|
|
endif ()
|
2024-02-20 23:34:31 +08:00
|
|
|
|
2024-03-11 04:42:58 +08:00
|
|
|
if (BUILD_CARLA_UNREAL)
|
2024-03-04 20:10:00 +08:00
|
|
|
add_subdirectory (Unreal)
|
|
|
|
endif ()
|
2024-03-19 03:20:02 +08:00
|
|
|
|
|
|
|
if (BUILD_EXAMPLES)
|
|
|
|
add_subdirectory (Examples)
|
|
|
|
endif ()
|
2024-05-15 23:50:06 +08:00
|
|
|
|
|
|
|
carla_add_custom_target (
|
|
|
|
carla-help
|
|
|
|
"Display this message."
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E cat "${CMAKE_CURRENT_BINARY_DIR}/Help.md"
|
|
|
|
)
|
|
|
|
|
|
|
|
carla_get_option_docs (CARLA_OPTION_DOCS)
|
|
|
|
carla_get_target_docs (CARLA_TARGET_DOCS)
|
|
|
|
set (CARLA_CMAKE_HELP_MESSAGE)
|
|
|
|
string (
|
|
|
|
APPEND
|
|
|
|
CARLA_CMAKE_HELP_MESSAGE
|
|
|
|
"# CARLA - CMake Help\n"
|
|
|
|
"## CMake Targets\n"
|
|
|
|
"${CARLA_TARGET_DOCS}\n"
|
|
|
|
"## CMake Options\n"
|
|
|
|
"${CARLA_OPTION_DOCS}\n"
|
|
|
|
)
|
|
|
|
|
|
|
|
file (
|
|
|
|
WRITE
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/Help.md
|
|
|
|
${CARLA_CMAKE_HELP_MESSAGE}
|
|
|
|
)
|