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