source: pacpussensors/trunk/CanGateway/CMakeLists.txt@ 67

Last change on this file since 67 was 59, checked in by DHERBOMEZ Gérald, 10 years ago

Integration of new modules:

  • GPS NMEA0183 decoder
  • Span CPT Decoder

Update of:

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