-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
/
CMakeLists.txt
141 lines (115 loc) · 2.63 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#[[
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>.
]]
set (
CARLA_CMAKE_MINIMUM_REQUIRED_VERSION
3.27.2
)
cmake_minimum_required (
VERSION
${CARLA_CMAKE_MINIMUM_REQUIRED_VERSION}
)
cmake_policy (SET CMP0097 NEW)
cmake_policy (SET CMP0091 NEW)
cmake_policy (SET CMP0074 NEW)
cmake_policy (SET CMP0077 NEW)
cmake_policy (SET CMP0117 NEW)
if (${CMAKE_MINOR_VERSION} GREATER_EQUAL 24)
cmake_policy (SET CMP0135 NEW)
endif ()
set (CARLA_VERSION_MAJOR 0)
set (CARLA_VERSION_MINOR 10)
set (CARLA_VERSION_PATCH 0)
set (
CARLA_VERSION
${CARLA_VERSION_MAJOR}.${CARLA_VERSION_MINOR}.${CARLA_VERSION_PATCH}
)
project (
CARLA
VERSION
${CARLA_VERSION}
LANGUAGES
C
CXX
ASM
DESCRIPTION
"Open-source simulator for autonomous driving research."
HOMEPAGE_URL
https://carla.org
)
set (
CARLA_WORKSPACE_PATH
${CMAKE_CURRENT_SOURCE_DIR}
)
set (
CARLA_BUILD_PATH
${CMAKE_BINARY_DIR}
)
set (
CARLA_PACKAGE_PATH
${CARLA_BUILD_PATH}/Package
)
set (
CARLA_UNREAL_PLUGINS_PATH
${CARLA_WORKSPACE_PATH}/Unreal/CarlaUnreal/Plugins
)
set (
CARLA_LICENSE_FILE_PATH
${CARLA_WORKSPACE_PATH}/LICENSE
)
include (CheckCCompilerFlag)
include (CheckCXXCompilerFlag)
include (CheckLinkerFlag)
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)
if (BUILD_CARLA_CLIENT OR BUILD_CARLA_SERVER)
add_subdirectory (LibCarla)
endif ()
if (BUILD_OSM_WORLD_RENDERER)
add_subdirectory (osm-world-renderer)
endif ()
if (ENABLE_ROS2)
add_subdirectory (Ros2Native)
endif()
if (BUILD_PYTHON_API)
add_subdirectory (PythonAPI)
endif ()
if (BUILD_CARLA_UNREAL)
add_subdirectory (Unreal)
endif ()
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 ()