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

Last change on this file since 58 was 49, checked in by phudelai, 11 years ago

bug fixed

File size: 3.4 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 )
71endif(WIN32)
72if(UNIX)
73 list(APPEND PROJECT_SRCS
74# driver/PeakCanDriver.cpp
75 driver/PeakCanDriver.h
76 driver/igepCanDriver.h
77 driver/igepCanDriver.cpp
78 )
79endif(UNIX)
80
81# ========================================
82# Files to MOC
83# ========================================
84
85set(
86 FILES_TO_MOC
87 CanGateway.h
88 DbtRawCanReader.h
89 ${PLUGIN_H}
90)
91
92set(
93 UI_FILES
94)
95
96# ========================================
97# Call MOC
98# ========================================
99qt4_wrap_cpp(
100 PROJECT_MOC_SRCS
101 ${FILES_TO_MOC}
102)
103
104qt4_wrap_ui(
105 PROJECT_UI_SRCS
106 ${UI_FILES}
107)
108
109# ========================================
110# Build a library
111# ========================================
112pacpus_add_library(
113 ${PROJECT_NAME} SHARED
114 ${PROJECT_SRCS}
115 ${PROJECT_MOC_SRCS}
116 ${PROJECT_UI_SRCS}
117)
118
119# ========================================
120# Libraries
121# ========================================
122if(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 )
129endif(WIN32)
130
131if(UNIX)
132 set(LIBS
133 # add your specific libraries to link here
134 # pcan
135 )
136endif(UNIX)
137
138# All the platform
139target_link_libraries(
140 ${PROJECT_NAME}
141 ${PACPUS_LIBRARIES}
142 ${QT_LIBRARIES}
143 ${PACPUS_DEPENDENCIES_LIB}
144 ${LIBS}
145# optimized PacpusTools debug PacpusTools_d
146)
147pacpus_folder(${PROJECT_NAME} "components")
148
149# ========================================
150# Install
151# ========================================
152# install plugin
153pacpus_install(${PROJECT_NAME})
154# install headers
155install(
156 DIRECTORY
157 ${CanGateway_SOURCE_DIR}
158 DESTINATION
159 ${PACPUS_INSTALL_DIR}/include
160)
161# if WIN32 install driver dependencies
Note: See TracBrowser for help on using the repository browser.