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

Last change on this file since 2 was 2, checked in by DHERBOMEZ Gérald, 11 years ago

correction of minor bugs (include and link). Build on Windows OK.

File size: 3.0 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( ${PACPUS_LIB_DIR}
37 ${CanGateway_SOURCE_DIR}/driver/libs
38)
39
40pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
41
42# ========================================
43# List of sources
44# ========================================
45set(
46 PROJECT_SRCS
47 CanFrameBase.h
48 CanDecoderBase.cpp
49 CanDecoderBase.h
50 CanGateway.cpp
51 CanGateway.h
52 CanSubscription.cpp
53 CanSubscription.h
54 Win32CanInterface.cpp
55 Win32CanInterface.h
56 DbtRawCanReader.h
57 DbtRawCanReader.cpp
58 ${PLUGIN_CPP}
59)
60
61if(WIN32)
62 list(APPEND PROJECT_SRCS
63 driver/VectorCanDriver.cpp
64 driver/VectorCanDriver.h
65 driver/XLVectorCanDriver.cpp
66 driver/XLVectorCanDriver.h
67 )
68endif(WIN32)
69if(UNIX)
70 list(APPEND PROJECT_SRCS
71 driver/PeakCanDriver.cpp
72 driver/PeakCanDriver.h
73 )
74endif(UNIX)
75
76# ========================================
77# Files to MOC
78# ========================================
79
80set(
81 FILES_TO_MOC
82 CanGateway.h
83 DbtRawCanReader.h
84 ${PLUGIN_H}
85)
86
87set(
88 UI_FILES
89)
90
91# ========================================
92# Call MOC
93# ========================================
94qt4_wrap_cpp(
95 PROJECT_MOC_SRCS
96 ${FILES_TO_MOC}
97)
98
99qt4_wrap_ui(
100 PROJECT_UI_SRCS
101 ${UI_FILES}
102)
103
104# ========================================
105# Build a library
106# ========================================
107pacpus_add_library(
108 ${PROJECT_NAME} SHARED
109 ${PROJECT_SRCS}
110 ${PROJECT_MOC_SRCS}
111 ${PROJECT_UI_SRCS}
112)
113
114# ========================================
115# Libraries
116# ========================================
117if(WIN32)
118 set(LIBS
119 # add your specific libraries to link here
120 vcandm32.lib
121 vxlapi.lib
122 )
123endif(WIN32)
124
125if(UNIX)
126 set(LIBS
127 # add your specific libraries to link here
128 pcan
129 )
130endif(UNIX)
131
132# All the platform
133target_link_libraries(
134 ${PROJECT_NAME}
135 ${PACPUS_LIBRARIES}
136 ${QT_LIBRARIES}
137 ${PACPUS_DEPENDENCIES_LIB}
138 ${LIBS}
139 PacpusTools
140)
141
142# ========================================
143# Install
144# ========================================
145pacpus_install(${PROJECT_NAME})
146
Note: See TracBrowser for help on using the repository browser.