1 | project(CanGateway)
|
---|
2 | ################################################################################
|
---|
3 |
|
---|
4 | add_definitions( -DCANGATEWAY_EXPORTS )
|
---|
5 | add_definitions( -DDBTRAWCANREADER_EXPORTS )
|
---|
6 |
|
---|
7 | # ========================================
|
---|
8 | # Configure qt4
|
---|
9 | # ========================================
|
---|
10 | if(QT4_FOUND)
|
---|
11 | set(QT_USE_QTXML true)
|
---|
12 | set(QT_USE_QTNETWORK true)
|
---|
13 | include(${QT_USE_FILE})
|
---|
14 | else()
|
---|
15 | message(ERROR "Qt4 needed")
|
---|
16 | endif()
|
---|
17 |
|
---|
18 | # ========================================
|
---|
19 | # Compiler definitions
|
---|
20 | # ========================================
|
---|
21 | add_definitions(
|
---|
22 | ${QT_DEFINITIONS}
|
---|
23 | )
|
---|
24 |
|
---|
25 | # ========================================
|
---|
26 | # Include directories
|
---|
27 | # ========================================
|
---|
28 | include_directories(
|
---|
29 | ${PROJECT_BINARY_DIR}
|
---|
30 | ${QT_INCLUDE_DIR}
|
---|
31 | )
|
---|
32 |
|
---|
33 | # ========================================
|
---|
34 | # Link directories
|
---|
35 | # ========================================
|
---|
36 | link_directories(
|
---|
37 | ${PACPUS_LIB_DIR}
|
---|
38 | ${CanGateway_SOURCE_DIR}/driver/libs
|
---|
39 | )
|
---|
40 |
|
---|
41 |
|
---|
42 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
|
---|
43 |
|
---|
44 | # ========================================
|
---|
45 | # List of sources
|
---|
46 | # ========================================
|
---|
47 | set(
|
---|
48 | PROJECT_SRCS
|
---|
49 | CanFrameBase.h
|
---|
50 | CanDecoderBase.cpp
|
---|
51 | CanDecoderBase.h
|
---|
52 | CanGateway.cpp
|
---|
53 | CanGateway.h
|
---|
54 | CanSubscription.cpp
|
---|
55 | CanSubscription.h
|
---|
56 | Win32CanInterface.cpp
|
---|
57 | Win32CanInterface.h
|
---|
58 | DbtRawCanReader.h
|
---|
59 | DbtRawCanReader.cpp
|
---|
60 | structureCan.h
|
---|
61 | ${PLUGIN_CPP}
|
---|
62 | )
|
---|
63 |
|
---|
64 | if(WIN32)
|
---|
65 | list(APPEND PROJECT_SRCS
|
---|
66 | driver/VectorCanDriver.cpp
|
---|
67 | driver/VectorCanDriver.h
|
---|
68 | driver/XLVectorCanDriver.cpp
|
---|
69 | driver/XLVectorCanDriver.h
|
---|
70 | )
|
---|
71 | endif(WIN32)
|
---|
72 | if(UNIX)
|
---|
73 | list(APPEND PROJECT_SRCS
|
---|
74 | # driver/PeakCanDriver.cpp
|
---|
75 | driver/PeakCanDriver.h
|
---|
76 | driver/igepCanDriver.h
|
---|
77 | driver/igepCanDriver.cpp
|
---|
78 | )
|
---|
79 | endif(UNIX)
|
---|
80 |
|
---|
81 | # ========================================
|
---|
82 | # Files to MOC
|
---|
83 | # ========================================
|
---|
84 |
|
---|
85 | set(
|
---|
86 | FILES_TO_MOC
|
---|
87 | CanGateway.h
|
---|
88 | DbtRawCanReader.h
|
---|
89 | ${PLUGIN_H}
|
---|
90 | )
|
---|
91 |
|
---|
92 | set(
|
---|
93 | UI_FILES
|
---|
94 | )
|
---|
95 |
|
---|
96 | # ========================================
|
---|
97 | # Call MOC
|
---|
98 | # ========================================
|
---|
99 | qt4_wrap_cpp(
|
---|
100 | PROJECT_MOC_SRCS
|
---|
101 | ${FILES_TO_MOC}
|
---|
102 | )
|
---|
103 |
|
---|
104 | qt4_wrap_ui(
|
---|
105 | PROJECT_UI_SRCS
|
---|
106 | ${UI_FILES}
|
---|
107 | )
|
---|
108 |
|
---|
109 | # ========================================
|
---|
110 | # Build a library
|
---|
111 | # ========================================
|
---|
112 | pacpus_add_library(
|
---|
113 | ${PROJECT_NAME} SHARED
|
---|
114 | ${PROJECT_SRCS}
|
---|
115 | ${PROJECT_MOC_SRCS}
|
---|
116 | ${PROJECT_UI_SRCS}
|
---|
117 | )
|
---|
118 |
|
---|
119 | # ========================================
|
---|
120 | # Libraries
|
---|
121 | # ========================================
|
---|
122 | if(WIN32)
|
---|
123 | set(LIBS
|
---|
124 | # add your specific libraries to link here
|
---|
125 |
|
---|
126 | optimized vcandm32.lib debug vcandm32.lib
|
---|
127 | optimized vxlapi.lib debug vxlapi.lib
|
---|
128 | )
|
---|
129 | endif(WIN32)
|
---|
130 |
|
---|
131 | if(UNIX)
|
---|
132 | set(LIBS
|
---|
133 | # add your specific libraries to link here
|
---|
134 | # pcan
|
---|
135 | )
|
---|
136 | endif(UNIX)
|
---|
137 |
|
---|
138 | # All the platform
|
---|
139 | target_link_libraries(
|
---|
140 | ${PROJECT_NAME}
|
---|
141 | ${PACPUS_LIBRARIES}
|
---|
142 | ${QT_LIBRARIES}
|
---|
143 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
144 | ${LIBS}
|
---|
145 | # optimized PacpusTools debug PacpusTools_d
|
---|
146 | )
|
---|
147 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
148 |
|
---|
149 | # ========================================
|
---|
150 | # Install
|
---|
151 | # ========================================
|
---|
152 | # install plugin
|
---|
153 | pacpus_install(${PROJECT_NAME})
|
---|
154 | # install headers
|
---|
155 | install(
|
---|
156 | DIRECTORY
|
---|
157 | ${CanGateway_SOURCE_DIR}
|
---|
158 | DESTINATION
|
---|
159 | ${PACPUS_INSTALL_DIR}/include
|
---|
160 | )
|
---|
161 | # if WIN32 install driver dependencies
|
---|