forked from se-research/OpenDaVINCI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
365 lines (324 loc) · 18.1 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
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# OpenDaVINCI - Portable middleware for distributed components.
# Copyright (C) 2015 Christian Berger
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
PROJECT (BUILD_COMPLETE_SOURCE_TREE)
###########################################################################
# Set the search path for .cmake files.
SET (CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" ${CMAKE_MODULE_PATH})
###########################################################################
# Check properties of the platform we are going to be compiled on.
SET (CXXTEST_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cxxtest")
INCLUDE (CheckPlatform)
###########################################################################
# Setting where to install the binaries.
SET(INSTALL_DIR ${CMAKE_INSTALL_PREFIX})
###########################################################################
# Display configuration.
MESSAGE("")
MESSAGE("Platform configuration for building the complete source tree:")
# First, display everything that is required to model and generate code from data structures.
IF("${ANT_EXECUTABLE}" STREQUAL "ANT_EXECUTABLE-NOTFOUND")
# As we could not find ant, we cannot build odDataStructureGenerator-latest.jar from sources.
SET(BUILD_ODDATASTRUCTUREGENERATOR 0)
IF(${HAVE_JAVA})
# Try to find the executable odDataStructureGenerator-latest.jar as fallback.
INCLUDE(FindodDataStructureGenerator)
IF(NOT ODDATASTRUCTUREGENERATOR_EXECUTABLE)
MESSAGE(FATAL_ERROR "Could not find a working Java compiler and not ant build tool either. Please install odDataStructureGenerator-latest.jar from http://opendavinci.cse.chalmers.se/www to /usr/local/bin.")
ELSE()
MESSAGE(STATUS "Found ODDATASTRUCTUREGENERATOR executable: ${ODDATASTRUCTUREGENERATOR_EXECUTABLE}")
ENDIF()
ENDIF()
ELSE()
IF(${HAVE_JAVAC})
MESSAGE(STATUS "Found working Java compiler and ant build tool: Building odDataStructureGenerator")
SET(BUILD_ODDATASTRUCTUREGENERATOR 1)
ENDIF()
ENDIF()
SET(ODDATASTRUCTUREGENERATOR_EXECUTABLE ${INSTALL_DIR}/bin/odDataStructureGenerator-latest.jar)
MESSAGE(STATUS "Using ${ODDATASTRUCTUREGENERATOR_EXECUTABLE} to generate code from data structure models.")
SET(ODCANDATASTRUCTUREGENERATOR_EXECUTABLE ${INSTALL_DIR}/bin/odCANDataStructureGenerator-latest.jar)
MESSAGE(STATUS "Using ${ODCANDATASTRUCTUREGENERATOR_EXECUTABLE} to generate code from CAN data structure models.")
# Next, if we get here, we have all the requirements to to model and generate code from data structures.
IF( NOT("${CMAKE_C_COMPILER}" STREQUAL "")
AND NOT("${CMAKE_CXX_COMPILER}" STREQUAL "") )
SET(BUILD_LIBODSIMULATION 0)
SET(BUILD_ODSIMULATION 0)
SET(BUILD_ODCOCKPIT 0)
SET(BUILD_AUTOMOTIVE_MINIATURE 0)
SET(BUILD_AUTOMOTIVE_ODCANTOOLS 0)
MESSAGE(STATUS "Found C and C++ compiler: Building opendavinci-lib")
SET(BUILD_OPENDAVINCI 1)
MESSAGE(STATUS "Found C++ compiler: Building opendavinci-odsupercomponent")
SET(BUILD_ODSUPERCOMPONENT 1)
MESSAGE(STATUS "Found C++ compiler: Building opendavinci-odtools")
SET(BUILD_ODTOOLS 1)
MESSAGE(STATUS "Found C++ compiler: Building opendavinci-automotivedata")
SET(BUILD_AUTOMOTIVEDATA 1)
MESSAGE(STATUS "Found C++ compiler: Building opendavinci-tutorials")
SET(BUILD_TUTORIALS 1)
IF (OpenCV_FOUND)
IF ( OPENGL_FOUND
AND GLUT_FOUND
AND Boost_FOUND)
MESSAGE(STATUS "Found C++ compiler, OpenCV, OpenGL, GLUT, and Boost: Building libodsimulation")
SET(BUILD_LIBODSIMULATION 1)
MESSAGE(STATUS "Found C++ compiler, OpenCV, OpenGL, GLUT, and Boost: Building odsimulation")
SET(BUILD_ODSIMULATION 1)
MESSAGE(STATUS "Found C++ compiler, OpenCV, OpenGL, GLUT, and Boost: Building automotive/miniature")
SET(BUILD_AUTOMOTIVE_MINIATURE 1)
IF (Qt4_FOUND)
IF (QWT5QT4_FOUND)
MESSAGE(STATUS "Found C++ compiler, OpenCV, OpenGL, GLUT, Boost, QT4, and Qwt: Building odcockpit")
SET(BUILD_ODCOCKPIT 1)
ENDIF()
ENDIF()
ENDIF()
ENDIF()
IF( (UNIX)
AND (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
AND (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
AND (NOT ("${ARMHF}" STREQUAL "YES"))
AND (NOT ("${i686}" STREQUAL "YES")) )
IF(POPT_FOUND)
MESSAGE(STATUS "Found popt-dev: Building automotive/odcantools")
SET(BUILD_AUTOMOTIVE_ODCANTOOLS 1)
ENDIF()
ENDIF()
ENDIF()
# Set parameters to ctest; for example, test cases are not executed on arm-hf cross compile build.
SET(CTEST_PARAMETERS "--output-on-failure") # Display output from a failing test case.
IF( (UNIX)
AND ("${ARMHF}" STREQUAL "YES") )
SET(CTEST_PARAMETERS "--show-only") # Do not run test cases on arm-hf cross compile build.
ENDIF()
MESSAGE("Test command: \"${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}\"")
# If dpkg and rpmbuild are available, .deb and .rpm packages will be
# created. Otherwise, the software is simply installed.
IF( NOT("${DPKG_EXECUTABLE}" STREQUAL "DPKG_EXECUTABLE-NOTFOUND")
AND NOT("${RPMBUILD_EXECUTABLE}" STREQUAL "RPMBUILD_EXECUTABLE-NOTFOUND") )
MESSAGE(STATUS "Enabling building .deb and .rpm packages.")
SET(MAKE_PACKAGE package)
ELSE()
# If the platform does not provide dpkg and rpmbuild, make package is
# replaced with make install.
SET(MAKE_PACKAGE install)
ENDIF()
###########################################################################
IF(NOT("${CMAKE_TOOLCHAIN_FILE}" STREQUAL ""))
SET(TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}")
ELSE()
SET(TOOLCHAIN_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/default-Toolchain.cmake")
ENDIF()
MESSAGE(STATUS "Using toolchain: ${TOOLCHAIN_FILE}")
###########################################################################
MESSAGE(STATUS "Installing artifacts to: ${INSTALL_DIR}")
MESSAGE("")
###########################################################################
# Next, all projects for a complete build of the sources tree are listed.
###########################################################################
# Build data structure generator.
IF(${BUILD_ODDATASTRUCTUREGENERATOR})
ExternalProject_Add (odDataStructureGenerator
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/odDataStructureGenerator"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odDataStructureGenerator-prefix/src/odDataStructureGenerator-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odDataStructureGenerator-prefix/src/odDataStructureGenerator-build --target ${MAKE_PACKAGE})
ENDIF()
# Next, build libopendavinci.
IF(${BUILD_OPENDAVINCI})
ExternalProject_Add (libopendavinci
DEPENDS odDataStructureGenerator
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libopendavinci"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/libopendavinci-prefix/src/libopendavinci-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/libopendavinci-prefix/src/libopendavinci-build --target ${MAKE_PACKAGE})
# Build the reference projects in odDataStructureGenerator to check validity of the code generator.
ExternalProject_Add (odDataStructureGenerator-reference
DEPENDS libopendavinci
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/odDataStructureGenerator/org.opendavinci.datamodel/test/odvd/reference"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND "")
ENDIF()
# Next, build tutorials.
IF(${BUILD_TUTORIALS})
ExternalProject_Add (tutorials
DEPENDS libopendavinci
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tutorials"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_COMMAND ""
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/tutorials-prefix/src/tutorials-build --target install)
ENDIF()
# Next, build odsupercomponent.
IF(${BUILD_ODSUPERCOMPONENT})
ExternalProject_Add (odsupercomponent
DEPENDS libopendavinci
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/odsupercomponent"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odsupercomponent-prefix/src/odsupercomponent-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odsupercomponent-prefix/src/odsupercomponent-build --target ${MAKE_PACKAGE})
ENDIF()
# Next, build odtools.
IF(${BUILD_ODTOOLS})
ExternalProject_Add (odtools
DEPENDS libopendavinci
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/odtools"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odtools-prefix/src/odtools-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odtools-prefix/src/odtools-build --target ${MAKE_PACKAGE})
ENDIF()
# Next, the project for the automotive data structures is built.
IF(${BUILD_AUTOMOTIVEDATA})
# This "external project" simply deletes the existing libautomotivedata.
ExternalProject_Add (libautomotivedata-cleanup
DEPENDS libopendavinci
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/libautomotivedata
PATCH_COMMAND ""
SOURCE_DIR ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND "")
ExternalProject_Add (libautomotivedata
DEPENDS libautomotivedata-cleanup
DOWNLOAD_COMMAND ""
UPDATE_COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ${Java_JAVA_EXECUTABLE} -jar ${ODDATASTRUCTUREGENERATOR_EXECUTABLE} --withCMake ${CMAKE_CURRENT_SOURCE_DIR}/AutomotiveData.odvd
PATCH_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libautomotivedata"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/libautomotivedata-prefix/src/libautomotivedata-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/libautomotivedata-prefix/src/libautomotivedata-build --target ${MAKE_PACKAGE})
ENDIF()
# Next, build libodsimulation.
IF(${BUILD_LIBODSIMULATION})
ExternalProject_Add (libodsimulation
DEPENDS libautomotivedata
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libodsimulation"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/libodsimulation-prefix/src/libodsimulation-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/libodsimulation-prefix/src/libodsimulation-build --target ${MAKE_PACKAGE})
ENDIF()
# Next, build odsimulation.
IF(${BUILD_ODSIMULATION})
ExternalProject_Add (odsimulation
DEPENDS libodsimulation
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/odsimulation"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odsimulation-prefix/src/odsimulation-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odsimulation-prefix/src/odsimulation-build --target ${MAKE_PACKAGE})
ENDIF()
# Next, build odcockpit.
IF(${BUILD_ODCOCKPIT})
ExternalProject_Add (odcockpit
DEPENDS libodsimulation
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/odcockpit"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odcockpit-prefix/src/odcockpit-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/odcockpit-prefix/src/odcockpit-build --target ${MAKE_PACKAGE})
ENDIF()
# Next, build automotive/odcantools.
IF(${BUILD_AUTOMOTIVE_ODCANTOOLS})
ExternalProject_Add (automotive-odCANDataStructureGenerator
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/automotive/odCANDataStructureGenerator"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/automotive-odCANDataStructureGenerator-prefix/src/automotive-odCANDataStructureGenerator-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/automotive-odCANDataStructureGenerator-prefix/src/automotive-odCANDataStructureGenerator-build --target ${MAKE_PACKAGE})
# This "external project" simply deletes the existing libcanmessagemapping.
ExternalProject_Add (automotive-libcanmessagemapping-cleanup
DEPENDS automotive-odCANDataStructureGenerator
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_CURRENT_SOURCE_DIR}/libcanmessagemapping
PATCH_COMMAND ""
SOURCE_DIR ""
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
TEST_COMMAND ""
INSTALL_COMMAND "")
ExternalProject_Add (automotive-libcanmessagemapping
DEPENDS libopendavinci libautomotivedata automotive-libcanmessagemapping-cleanup
DOWNLOAD_COMMAND ""
UPDATE_COMMAND cd ${CMAKE_CURRENT_SOURCE_DIR} && ${Java_JAVA_EXECUTABLE} -jar ${ODCANDATASTRUCTUREGENERATOR_EXECUTABLE} --withCMake ${CMAKE_CURRENT_SOURCE_DIR}/automotive/CANMessageMapping.can
PATCH_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libcanmessagemapping"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/automotive-libcanmessagemapping-prefix/src/automotive-libcanmessagemapping-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/automotive-libcanmessagemapping-prefix/src/automotive-libcanmessagemapping-build --target ${MAKE_PACKAGE})
ExternalProject_Add (automotive-odcantools
DEPENDS automotive-libcanmessagemapping
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/automotive/odcantools"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/automotive-odcantools-prefix/src/automotive-odcantools-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/automotive-odcantools-prefix/src/automotive-odcantools-build --target ${MAKE_PACKAGE})
ENDIF()
# Next, build automotive/miniature.
IF(${BUILD_AUTOMOTIVE_MINIATURE})
ExternalProject_Add (automotive-miniature
DEPENDS libodsimulation
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/automotive/miniature"
CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${INSTALL_DIR}"
CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}"
TEST_BEFORE_INSTALL 1
TEST_COMMAND ${CMAKE_CTEST_COMMAND} ${CTEST_PARAMETERS}
INSTALL_COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/automotive-miniature-prefix/src/automotive-miniature-build --target install COMMAND ${CMAKE_COMMAND} --build ${CMAKE_CURRENT_BINARY_DIR}/automotive-miniature-prefix/src/automotive-miniature-build --target ${MAKE_PACKAGE})
ENDIF()