1 ###########################################################################
2 # Copyright 2015, 2016, 2017 IoT.bzh
4 # author: Fulup Ar Foll <fulup@iot.bzh>
5 # contrib: Romain Forlot <romain.forlot@iot.bzh>
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 ###########################################################################
20 # Add target to project dependency list
22 PROJECT_TARGET_ADD(low-can)
24 if(WITH_FEATURE_ISOTP)
26 utils/socketcan-isotp.cpp
31 if(WITH_FEATURE_J1939)
33 can/message/j1939-message.cpp
34 utils/socketcan-j1939/socketcan-j1939.cpp
35 utils/socketcan-j1939/socketcan-j1939-data.cpp
36 utils/socketcan-j1939/socketcan-j1939-addressclaiming.cpp
41 binding/low-can-hat.cpp
42 binding/low-can-subscription.cpp
43 binding/application.cpp
48 can/message-definition.cpp
49 can/message/message.cpp
50 can/message/can-message.cpp
52 diagnostic/diagnostic-message.cpp
53 diagnostic/diagnostic-manager.cpp
54 diagnostic/active-diagnostic-request.cpp
56 utils/openxc-utils.cpp
59 #utils/socketcan-raw.cpp
60 utils/socketcan-bcm.cpp
62 utils/config-parser.cpp
65 add_library(${TARGET_NAME} SHARED ${SOURCES_LIB} ${SOURCES_J1939} ${SOURCES_ISOTP})
67 # Binder exposes a unique public entry point
68 SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
70 IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/lib${TARGET_NAME}.so
73 TARGET_LINK_LIBRARIES(${TARGET_NAME}
81 PROJECT_TARGET_ADD(low-can-binding)
83 # Define project Targets
85 binding/low-can-cb.cpp
88 add_library(${TARGET_NAME} MODULE ${SOURCES})
90 set(OPENAPI_DEF "binding/low-can-apidef" CACHE STRING "name and path to the JSON API definition without extension")
91 # Binder exposes a unique public entry point
92 SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES
95 LINK_FLAGS ${BINDINGS_LINK_FLAG}
96 INSTALL_RPATH "$ORIGIN"
97 OUTPUT_NAME ${TARGET_NAME}
100 # Library dependencies (include updates automatically)
101 TARGET_LINK_LIBRARIES(${TARGET_NAME}
103 openxc-message-format