carla/CMakeLists.txt

132 lines
2.6 KiB
CMake
Raw Permalink Normal View History

#[[
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
3.27.2
2024-03-13 08:04:27 +08:00
)
2024-02-05 18:52:25 +08:00
cmake_policy (SET CMP0097 NEW)
2024-02-28 22:56:26 +08:00
cmake_policy (SET CMP0091 NEW)
cmake_policy (SET CMP0074 NEW)
cmake_policy (SET CMP0077 NEW)
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 10)
set (CARLA_VERSION_PATCH 0)
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}
)
2023-11-23 07:50:55 +08:00
project (
CARLA
VERSION
${CARLA_VERSION}
LANGUAGES
C
CXX
ASM # This is required by some dependencies, such as LibPNG.
DESCRIPTION
"Open-source simulator for autonomous driving research."
HOMEPAGE_URL
https://carla.org
)
set (
CARLA_WORKSPACE_PATH
${CMAKE_CURRENT_SOURCE_DIR}
)
set (
CARLA_PACKAGE_PATH
${CMAKE_BINARY_DIR}/Package
)
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
set (
CARLA_LICENSE_FILE_PATH
${CARLA_WORKSPACE_PATH}/LICENSE
)
include (CheckCCompilerFlag)
include (CheckCXXCompilerFlag)
include (CheckLinkerFlag)
2024-03-18 21:09:38 +08:00
include (${CARLA_WORKSPACE_PATH}/CMake/Util.cmake)
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 ()
if (BUILD_OSM_WORLD_RENDERER)
2024-02-05 18:52:25 +08:00
add_subdirectory (osm-world-renderer)
endif ()
if (ENABLE_ROS2)
add_subdirectory (Ros2Native)
endif()
if (BUILD_PYTHON_API)
2024-02-05 18:52:25 +08:00
add_subdirectory (PythonAPI)
2024-02-01 07:46:04 +08:00
endif ()
if (BUILD_CARLA_UNREAL)
add_subdirectory (Unreal)
endif ()
2024-03-19 03:20:02 +08:00
if (BUILD_EXAMPLES)
add_subdirectory (Examples)
endif ()
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}
)
if (CMAKE_EXPORT_COMPILE_COMMANDS)
configure_file (
${CARLA_WORKSPACE_PATH}/.clangd.in
${CARLA_WORKSPACE_PATH}/.clangd
)
endif ()