summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/esmini-use-pkgconfig.patch
blob: 7f7dafbc55b20dd9fee73556ef25290c790400b7 (plain)
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
Find dependencies via pkg-config.

---
 CMakeLists.txt                                | 72 +++----------------
 .../Applications/esmini/main.cpp              |  2 +
 EnvironmentSimulator/CMakeLists.txt           |  3 -
 .../Modules/Controllers/ControllerSumo.cpp    |  1 -
 .../Modules/RoadManager/CMakeLists.txt        |  7 +-
 .../Modules/ScenarioEngine/CMakeLists.txt     | 17 +----
 6 files changed, 16 insertions(+), 86 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index aec4cf55..c9689b44 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,8 @@ else()
         FATAL_ERROR)
 endif()
 
+include(FindPkgConfig)
+
 # ############################# Project generate options ###########################################################
 
 project(
@@ -138,75 +140,26 @@ set_special_build_flags()
 include(${CMAKE_CURRENT_SOURCE_DIR}/support/cmake/utils/get_subdirectories.cmake)
 include(${CMAKE_CURRENT_SOURCE_DIR}/support/cmake/utils/set_folder.cmake)
 
-# ############################### Downloading cloud packages #########################################################
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/support/cmake/cloud/set_cloud_links.cmake)
-set_cloud_links()
-
-include(${CMAKE_CURRENT_SOURCE_DIR}/support/cmake/cloud/download.cmake)
-
-message(STATUS "Downloading dependencies...")
-
-download(
-    osg
-    ${EXTERNALS_OSG_PATH}
-    ${EXTERNALS_OSG_OS_SPECIFIC_PATH}
-    "${OSG_PACKAGE_URL}")
-
-download(
-    osi
-    ${EXTERNALS_OSI_PATH}
-    ${EXTERNALS_OSI_OS_SPECIFIC_PATH}
-    "${OSI_PACKAGE_URL}")
-
-download(
-    sumo
-    ${EXTERNALS_SUMO_PATH}
-    ${EXTERNALS_SUMO_OS_SPECIFIC_PATH}
-    "${SUMO_PACKAGE_URL}")
-
-download(
-    implot
-    ${EXTERNALS_IMPLOT_PATH}
-    ${EXTERNALS_IMPLOT_OS_SPECIFIC_PATH}
-    "${IMPLOT_PACKAGE_URL}")
-
-download(
-    models
-    ${RESOURCES_PATH}
-    ${MODELS_PATH}
-    "${MODELS_PACKAGE_URL}")
-
-if(NOT
-   (APPLE
-    OR MINGW))
-    download(
-        googletest
-        ${EXTERNALS_GOOGLETEST_PATH}
-        ${EXTERNALS_GOOGLETEST_OS_SPECIFIC_PATH}
-        ${GTEST_PACKAGE_URL})
-endif()
-
 # ############################### Loading external packages ##########################################################
 
 if(USE_GTEST)
-    include(${CMAKE_CURRENT_SOURCE_DIR}/support/cmake/external/gtest.cmake)
-    set_gtest_libs()
+    find_package(GTest REQUIRED)
 endif()
 
 if(USE_OSG)
-    include(${CMAKE_CURRENT_SOURCE_DIR}/support/cmake/external/osg.cmake)
-    set_osg_libs()
+  pkg_check_modules(OSG REQUIRED openscenegraph osgdb_jpeg osgdb_osg
+                                 osgdb_serializers_osg
+                                 osgdb_serializers_osgsim)
 endif()
 
 if(USE_OSI)
-    include(${CMAKE_CURRENT_SOURCE_DIR}/support/cmake/external/osi.cmake)
-    set_osi_libs()
+    find_package(open_simulation_interface REQUIRED)
+    set(EXTERNALS_OSI_INCLUDES "${OPEN_SIMULATION_INTERFACE_INCLUDE_DIRS}")
+    set(OSI_LIBRARIES open_simulation_interface::open_simulation_interface)
 endif()
 
 if(USE_SUMO)
-    include(${CMAKE_CURRENT_SOURCE_DIR}/support/cmake/external/sumo.cmake)
-    set_sumo_libs()
+    set ( SUMO_LIBRARIES sumocpp tracicpp )
 endif()
 
 if(USE_IMPLOT)
@@ -229,10 +182,7 @@ if(NOT
 endif()
 
 # Add variables to global scope, e.g. when esmini is used as submodule
-set(EXTERNALS_PUGIXML_PATH
-    ${EXTERNALS_PUGIXML_PATH}
-    CACHE INTERNAL
-          "")
+find_package(pugixml)
 set(EXTERNALS_EXPR_PATH
     ${EXTERNALS_EXPR_PATH}
     CACHE INTERNAL
diff --git a/EnvironmentSimulator/Applications/esmini/main.cpp b/EnvironmentSimulator/Applications/esmini/main.cpp
index 84f38c7f..943c42c8 100644
--- a/EnvironmentSimulator/Applications/esmini/main.cpp
+++ b/EnvironmentSimulator/Applications/esmini/main.cpp
@@ -13,7 +13,9 @@
 #include "playerbase.hpp"
 #include "CommonMini.cpp"
 #include "OSCParameterDistribution.hpp"
+#if _USE_IMPLOT
 #include "Plot.hpp"
+#endif
 #include <osgViewer/ViewerEventHandlers>
 #include <signal.h>
 
diff --git a/EnvironmentSimulator/CMakeLists.txt b/EnvironmentSimulator/CMakeLists.txt
index 87e1dd98..3db513a0 100644
--- a/EnvironmentSimulator/CMakeLists.txt
+++ b/EnvironmentSimulator/CMakeLists.txt
@@ -57,9 +57,6 @@ set_folder(
 set_folder(
     ScenarioEngine
     ${ModulesFolder})
-set_folder(
-    Externals
-    ${ModulesFolder})
 set_folder(
     RoadManager
     ${ModulesFolder})
diff --git a/EnvironmentSimulator/Modules/Controllers/ControllerSumo.cpp b/EnvironmentSimulator/Modules/Controllers/ControllerSumo.cpp
index 92b40c90..764d2d3b 100644
--- a/EnvironmentSimulator/Modules/Controllers/ControllerSumo.cpp
+++ b/EnvironmentSimulator/Modules/Controllers/ControllerSumo.cpp
@@ -16,7 +16,6 @@
 #include "ScenarioGateway.hpp"
 #include "pugixml.hpp"
 
-#include <utils/geom/PositionVector.h>
 #include <libsumo/Simulation.h>
 #include <libsumo/Vehicle.h>
 #include <libsumo/TraCIDefs.h>
diff --git a/EnvironmentSimulator/Modules/RoadManager/CMakeLists.txt b/EnvironmentSimulator/Modules/RoadManager/CMakeLists.txt
index afb77338..b8beba48 100644
--- a/EnvironmentSimulator/Modules/RoadManager/CMakeLists.txt
+++ b/EnvironmentSimulator/Modules/RoadManager/CMakeLists.txt
@@ -20,9 +20,6 @@ set(SOURCES
     odrSpiral.cpp
     LaneIndependentRouter.cpp)
 
-set(SRC_ADDITIONAL
-    ${EXTERNALS_PUGIXML_PATH}/pugixml.cpp)
-
 source_group(
     "External Libraries"
     FILES ${SRC_ADDITIONAL})
@@ -44,6 +41,7 @@ add_library(
 target_link_libraries(
     ${TARGET}
     PRIVATE CommonMini
+            pugixml
             # project_options
 )
 
@@ -54,8 +52,7 @@ target_include_directories(
 target_include_directories(
     ${TARGET}
     SYSTEM
-    PUBLIC ${EXTERNALS_PUGIXML_PATH}
-           ${ROAD_MANAGER_PATH})
+    PUBLIC ${ROAD_MANAGER_PATH})
 
 disable_static_analysis(${TARGET})
 disable_iwyu(${TARGET})
diff --git a/EnvironmentSimulator/Modules/ScenarioEngine/CMakeLists.txt b/EnvironmentSimulator/Modules/ScenarioEngine/CMakeLists.txt
index 5089dfc1..4b95a071 100644
--- a/EnvironmentSimulator/Modules/ScenarioEngine/CMakeLists.txt
+++ b/EnvironmentSimulator/Modules/ScenarioEngine/CMakeLists.txt
@@ -3,9 +3,6 @@
 set(TARGET
     ScenarioEngine)
 
-set(EXTERNAL_TARGET
-    Externals)
-
 # ############################### Loading desired rules ##############################################################
 
 include(${CMAKE_SOURCE_DIR}/support/cmake/rule/disable_static_analysis.cmake)
@@ -40,26 +37,15 @@ endif(
     NOT
     USE_OSI)
 
-set(SRC_ADDITIONAL
-    ${EXTERNALS_PUGIXML_PATH}/pugixml.cpp)
-
 source_group(
     OSCTypeDefs
     FILES ${SRC_OSCTYPEDEFS})
 source_group(
     "Source Files"
     FILES ${SRC_SOURCEFILES})
-source_group(
-    "External Libraries"
-    FILES ${SRC_ADDITIONAL})
 
 # ############################### Creating library ###################################################################
 
-add_library(
-    ${EXTERNAL_TARGET}
-    STATIC
-    ${SRC_ADDITIONAL})
-
 add_library(
     ${TARGET}
     STATIC
@@ -68,7 +54,7 @@ add_library(
 
 target_link_libraries(
     ${TARGET}
-    PRIVATE project_options)
+    PRIVATE project_options pugixml)
 
 target_include_directories(
     ${TARGET}
@@ -84,7 +70,6 @@ target_include_directories(
     PUBLIC ${ROAD_MANAGER_PATH}
            ${EXTERNALS_OSI_INCLUDES}
            ${EXTERNALS_SUMO_INCLUDES}
-           ${EXTERNALS_PUGIXML_PATH}
            ${EXTERNALS_EXPR_PATH})
 
 target_link_libraries(
-- 
2.45.1