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

Last change on this file since 110 was 105, checked in by cerichar, 9 years ago

compilation OK under Windows 10 64 bits, Qt5.5, pacpus 0.2.2, boost 1.54

File size: 3.8 KB
Line 
1project(CanGateway)
2################################################################################
3
4add_definitions( -DCANGATEWAY_EXPORTS )
5add_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# ========================================
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 ${CanGateway_SOURCE_DIR}/driver/libs/kvaser/MS
40)
41
42
43pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
44
45# ========================================
46# List of sources
47# ========================================
48set(
49 PROJECT_SRCS
50 CanFrameBase.h
51 CanDecoderBase.cpp
52 CanDecoderBase.h
53 CanGateway.cpp
54 CanGateway.h
55 CanSubscription.cpp
56 CanSubscription.h
57 Win32CanInterface.cpp
58 Win32CanInterface.h
59 DbtRawCanReader.h
60 DbtRawCanReader.cpp
61 structureCan.h
62 driver/KVaserCanDriver.cpp
63 driver/KVaserCanDriver.h
64 ${PLUGIN_CPP}
65)
66
67if(WIN32)
68 list(APPEND PROJECT_SRCS
69 # Works only on Windows XP
70 #driver/VectorCanDriver.cpp
71 #driver/VectorCanDriver.h
72
73 driver/XLVectorCanDriver.cpp
74 driver/XLVectorCanDriver.h
75 driver/PeakCanDriverWin.h
76 driver/PeakCanDriverWin.cpp
77 )
78endif(WIN32)
79if(UNIX)
80 list(APPEND PROJECT_SRCS
81# driver/PeakCanDriver.cpp
82 driver/PeakCanDriver.h
83 driver/igepCanDriver.h
84 driver/igepCanDriver.cpp
85 )
86endif(UNIX)
87
88# ========================================
89# Files to MOC
90# ========================================
91
92set(
93 FILES_TO_MOC
94 CanGateway.h
95 DbtRawCanReader.h
96 ${PLUGIN_H}
97)
98
99set(
100 UI_FILES
101)
102
103# ========================================
104# Call MOC
105# ========================================
106qt_wrap_cpp(
107 PROJECT_MOC_SRCS
108 ${FILES_TO_MOC}
109)
110
111qt_wrap_ui(
112 PROJECT_UI_SRCS
113 ${UI_FILES}
114)
115
116# ========================================
117# Build a library
118# ========================================
119pacpus_add_library(
120 ${PROJECT_NAME} SHARED
121 ${PROJECT_SRCS}
122 ${PROJECT_MOC_SRCS}
123 ${PROJECT_UI_SRCS}
124)
125
126# ========================================
127# Libraries
128# ========================================
129if(WIN32)
130 set(LIBS
131 # add your specific libraries to link here
132
133 # Works only on Windows XP
134 #optimized vcandm32.lib debug vcandm32.lib
135 optimized vxlapi.lib debug vxlapi.lib
136 optimized PCANBasic.lib debug PCANBasic.lib
137 optimized canlib32.lib debug canlib32.lib
138 )
139endif(WIN32)
140
141if(UNIX)
142 set(LIBS
143 # add your specific libraries to link here
144 # pcan
145 canlib
146 )
147endif(UNIX)
148
149# All the platform
150target_link_libraries(
151 ${PROJECT_NAME}
152 ${PACPUS_LIBRARIES}
153 ${QT_LIBRARIES}
154 ${PACPUS_DEPENDENCIES_LIB}
155 ${LIBS}
156 #optimized PacpusTools debug PacpusTools_d
157)
158pacpus_folder(${PROJECT_NAME} "components")
159
160# ========================================
161# Install
162# ========================================
163# install plugin
164pacpus_install(${PROJECT_NAME})
165# install headers
166install(
167 DIRECTORY
168 ${CanGateway_SOURCE_DIR}
169 DESTINATION
170 ${PACPUS_INSTALL_DIR}/include
171 FILES_MATCHING PATTERN "*.h"
172)
173# if WIN32 install driver dependencies
Note: See TracBrowser for help on using the repository browser.