File tree Expand file tree Collapse file tree 4 files changed +29
-28
lines changed Expand file tree Collapse file tree 4 files changed +29
-28
lines changed Original file line number Diff line number Diff line change @@ -32,28 +32,6 @@ option(WITH_TRANSFUSION "Build Artery with transfusion feature" OFF)
32
32
option (WITH_SCENARIOS "Build Artery with scenarios" ON )
33
33
option (VSCODE_LAUNCH_INTEGRATION "Generate VS Code configuration for debugging Artery (requires debug build)" OFF )
34
34
35
- #################################
36
- # Resolving conflicting options #
37
- #################################
38
-
39
- if (NOT WITH_INET )
40
- # SimuLTE extends INET network (see src/artery/lte/World.ned)
41
- if (WITH_SIMULTE )
42
- message (ERROR "SimuLTE requires INET framework integration (WITH_INET must be set to ON)" )
43
- endif ()
44
-
45
- # Components below use INET classes
46
- if (WITH_OTS )
47
- message (ERROR "OpenTrafficSim requires INET framework integration (WITH_INET must be set to ON)" )
48
- endif ()
49
- if (WITH_TESTBED )
50
- message (ERROR "Testbed requires INET framework integration (WITH_INET must be set to ON)" )
51
- endif ()
52
- if (WITH_ENVMOD )
53
- message (ERROR "Environment model requires INET framework integration (WITH_INET must be set to ON)" )
54
- endif ()
55
- endif ()
56
-
57
35
##############################
58
36
# Artery build configuration #
59
37
##############################
@@ -128,7 +106,7 @@ endmacro()
128
106
add_subdirectory (src/traci )
129
107
add_subdirectory (src/artery )
130
108
131
- add_artery_subdirectory (src/ots DEPENDENCIES ZEROMQ SWITCH WITH_OTS )
109
+ add_artery_subdirectory (src/ots REQUIRES INET DEPENDENCIES ZEROMQ SWITCH WITH_OTS )
132
110
133
111
# scenarios directory is part of repository but omitted for Docker build context
134
112
if (WITH_SCENARIOS )
Original file line number Diff line number Diff line change 1
1
function (add_artery_subdirectory directory )
2
+ # include target subdirectory with certain artery
3
+ # extension (feature), if the following conditions match:
4
+ # 1) variable with id matching SWITCH is set to true (feature turned on)
5
+ # 2) packages that are listed in DEPENDENCIES are found
6
+ # 3) targets that are listed in REQUIRES are declared (used for extern modules)
7
+
8
+ # If condition 1) is not met, then subdirectory is not added and
9
+ # debug message is issued. If either 2) or 3) fails, then this function raises error.
10
+
2
11
set (one_value_args SWITCH )
3
- set (multi_value_args DEPENDENCIES )
12
+ set (multi_value_args DEPENDENCIES;REQUIRES )
4
13
cmake_parse_arguments (args "" "${one_value_args} " "${multi_value_args} " ${ARGN} )
5
14
6
15
if (args_UNPARSED_ARGUMENTS )
@@ -17,7 +26,16 @@ function(add_artery_subdirectory directory)
17
26
if (NOT DEFINED ${_dep_var} OR NOT ${_dep_var} )
18
27
message (
19
28
FATAL_ERROR
20
- "add_artery_subdirectory: required dependency '${dependency} ' for '${directory} ' not found: variable '${_dep_var} ' is not defined"
29
+ "add_artery_subdirectory: dependency '${dependency} ' for '${directory} ' was not found: variable '${_dep_var} ' is not defined"
30
+ )
31
+ endif ()
32
+ endforeach ()
33
+
34
+ foreach (required_target IN LISTS args_REQUIRES )
35
+ if (NOT TARGET ${required_target} )
36
+ message (
37
+ FATAL_ERROR
38
+ "add_artery_subdirectory: required target '${required_target} ' for '${directory} ' was not found"
21
39
)
22
40
endif ()
23
41
endforeach ()
Original file line number Diff line number Diff line change @@ -72,9 +72,15 @@ if(WITH_INET)
72
72
endif ()
73
73
74
74
if (WITH_SIMULTE )
75
+ message (STATUS "Enable SimuLTE integration" )
76
+ if (NOT TARGET INET )
77
+ message (FATAL_ERROR "SimuLTE requires INET" )
78
+ endif ()
79
+
75
80
check_git_submodule (PATH simulte REQUIRED_FILES src/package.ned )
76
81
find_path (SimuLTE_DIR NAMES src/package.ned PATHS simulte DOC "SimuLTE root directory" )
77
82
mark_as_advanced (SimuLTE_DIR )
83
+
78
84
add_opp_target (TARGET lte ROOT_DIR ${SimuLTE_DIR} )
79
85
target_link_libraries (lte PUBLIC INET )
80
86
else ()
Original file line number Diff line number Diff line change @@ -43,16 +43,15 @@ add_artery_subdirectory(inet SWITCH WITH_INET)
43
43
add_artery_subdirectory (storyboard SWITCH WITH_STORYBOARD )
44
44
45
45
add_artery_subdirectory (transfusion DEPENDENCIES Protobuf SWITCH WITH_TRANSFUSION )
46
- add_artery_subdirectory (testbed DEPENDENCIES SEA_V2X Protobuf SWITCH WITH_TESTBED )
46
+ add_artery_subdirectory (testbed REQUIRES INET DEPENDENCIES SEA_V2X Protobuf SWITCH WITH_TESTBED )
47
47
48
48
if (TARGET lte )
49
49
# SimuLTE is a non-integral feature: add it to "artery" but not "core"
50
- message (STATUS "Enable SimuLTE integration" )
51
50
target_link_libraries (artery INTERFACE lte )
52
51
endif ()
53
52
53
+ add_artery_subdirectory (envmod REQUIRES INET SWITCH WITH_ENVMOD )
54
54
if (WITH_ENVMOD )
55
- add_subdirectory (envmod )
56
55
set_property (SOURCE application/VehicleMiddleware.cc APPEND PROPERTY COMPILE_DEFINITIONS "WITH_ENVMOD" )
57
56
endif ()
58
57
You can’t perform that action at this time.
0 commit comments