blob: ae035c914c9ab6b181bfc3750e2ed0ea18defb42 (
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
|
###########################################################################
# Copyright 2015, 2016, 2017 IoT.bzh
#
# author: Fulup Ar Foll <fulup@iot.bzh>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
###########################################################################
# Add target to project dependency list
PROJECT_TARGET_ADD(low-can-binding)
# Define project Targets
fill_include_dir(${PROJECT_LIBDIR})
file(GLOB filelist "${PROJECT_LIBDIR}/*")
foreach(filename ${filelist})
if(IS_DIRECTORY ${filename})
include_directories(${filename})
STRING(REGEX REPLACE "^.*\/(.*)$" "\\1" shortname ${filename})
find_source_files(${PROJECT_LIBDIR})
add_library(${shortname} STATIC ${sources_files})
endif(IS_DIRECTORY ${filename})
endforeach()
add_library(${PROJECT_NAME} MODULE ${PROJECT_NAME}.cpp configuration.cpp configuration-generated.cpp
can/can-bus.cpp can/can-bus-dev.cpp can/can-message-set.cpp can/can-message-definition.cpp can/can-message.cpp can/can-signals.cpp can/can-decoder.cpp
diagnostic/diagnostic-message.cpp diagnostic/diagnostic-manager.cpp diagnostic/active-diagnostic-request.cpp
utils/signals.cpp utils/openxc-utils.cpp utils/timer.cpp utils/socket.cpp)
# Binder exposes a unique public entry point
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES
PREFIX ""
LINK_FLAGS ${BINDINGS_LINK_FLAG}
OUTPUT_NAME ${PROJECT_NAME}
)
# Library dependencies (include updates automatically)
TARGET_LINK_LIBRARIES(${PROJECT_NAME}
${EXTRA_LINK_LIBRARIES}
${link_libraries}
)
# installation directory
INSTALL(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${BINDINGS_INSTALL_DIR})
# WGT packaging
message(STATUS "Creation of ${PROJECT_NAME}.wgt package for AppFW")
configure_file(${PROJECT_WGT_DIR}/config.xml config.xml)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_WGT_DIR}/etc")
file(GLOB conf_files "${PROJECT_WGT_DIR}/etc/*")
foreach(filename ${conf_files})
STRING(REGEX REPLACE "^.*\/(.*)$" "\\1" shortname ${filename})
message(STATUS "Copying config file ${shortname}")
configure_file(${filename} ${shortname})
endforeach()
endif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_WGT_DIR}/etc")
add_custom_command(
OUTPUT ${PROJECT_NAME}.wgt
DEPENDS ${PROJECT_NAME} ${EXTRA_LINK_LIBRARIES} ${conf_files} ${PROJECT_WGT_DIR}/config.xml
COMMAND rm -rf package
COMMAND mkdir -p package/lib package/htdocs package/etc
COMMAND cp config.xml package/
COMMAND cp ${conf_files} package/etc
COMMAND cp ${CMAKE_CURRENT_SOURCE_DIR}/packaging/wgt/${PROJECT_ICON} package/icon.png
COMMAND cp ${PROJECT_NAME}.so package/lib
COMMAND wgtpkg-pack -f -o ${PROJECT_NAME}.wgt package
)
add_custom_target(widget ALL DEPENDS ${PROJECT_NAME}.wgt)
|