Repository navigation
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
76 lines (62 loc) · 2.67 KB
/
Copy pathCMakeLists.txt
File metadata and controls
76 lines (62 loc) · 2.67 KB
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
cmake_minimum_required(VERSION 3.16)
project(VDSim
VERSION 0.1.0
DESCRIPTION "Vehicle Dynamics Simulation Platform"
LANGUAGES CXX
)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
option(VDSIM_BUILD_TESTS "Build unit/integration tests" ON)
option(VDSIM_BUILD_EXAMPLES "Build CLI examples" ON)
option(VDSIM_BUILD_PYTHON "Build Python bindings" OFF)
option(VDSIM_BUILD_CARLA_PLUGIN "Build CARLA integration" ON)
option(VDSIM_BUILD_COSIM "Build UDP co-simulation server" ON)
# GUI v3 is a deferred (node-stack) component. Its whole test group is outside
# the canonical `validation` preset; see the `excluded:` lines in
# docs/VALIDATION.md. Exclusion is per component, not per target, so future
# GUI v3 tests attach to this same switch (07_p0_demo.md 6.4(2)).
option(VDSIM_BUILD_GUI_V3_TESTS "Register the GUI v3 test group" OFF)
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU")
add_compile_options(-Wall -Wextra -Wpedantic -Wno-unused-parameter)
endif()
if(MSVC)
# Read sources as UTF-8 regardless of the system code page (e.g. cp949 on a
# Korean Windows), so UTF-8 comments/strings aren't misread — also silences
# the spdlog C4819 warnings.
add_compile_options(/utf-8)
endif()
# M_PI et al. are POSIX/GNU extensions: glibc/libc++ expose them by default but
# MSVC only with _USE_MATH_DEFINES before <cmath>. Define it everywhere (no-op
# on GCC/Clang) so the core's trig constants compile on Windows.
add_compile_definitions(_USE_MATH_DEFINES)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_subdirectory(third_party)
add_subdirectory(core)
if(VDSIM_BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
if(VDSIM_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(VDSIM_BUILD_PYTHON)
add_subdirectory(python)
endif()
if(VDSIM_BUILD_CARLA_PLUGIN)
add_subdirectory(carla_integration)
endif()
if(VDSIM_BUILD_COSIM)
add_subdirectory(cosim)
endif()
message(STATUS "VDSim version : ${PROJECT_VERSION}")
message(STATUS "Build type : ${CMAKE_BUILD_TYPE}")
message(STATUS "C++ compiler : ${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}")
message(STATUS "Build tests : ${VDSIM_BUILD_TESTS}")
message(STATUS "Build examples : ${VDSIM_BUILD_EXAMPLES}")
message(STATUS "Build Python : ${VDSIM_BUILD_PYTHON}")
message(STATUS "Build CARLA plugin : ${VDSIM_BUILD_CARLA_PLUGIN}")
message(STATUS "GUI v3 tests : ${VDSIM_BUILD_GUI_V3_TESTS}")