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

Last change on this file since 25 was 11, checked in by morasjul, 11 years ago

[cmake] Added: solution folders (pacpus_folder) for MSVC and compatible dev. env.

File size: 3.1 KB
RevLine 
[1]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# ========================================
[2]36link_directories( ${PACPUS_LIB_DIR}
37 ${CanGateway_SOURCE_DIR}/driver/libs
[1]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
[4]58 structureCan.h
[1]59 ${PLUGIN_CPP}
60)
61
62if(WIN32)
63 list(APPEND PROJECT_SRCS
64 driver/VectorCanDriver.cpp
65 driver/VectorCanDriver.h
66 driver/XLVectorCanDriver.cpp
67 driver/XLVectorCanDriver.h
68 )
69endif(WIN32)
70if(UNIX)
71 list(APPEND PROJECT_SRCS
[4]72# driver/PeakCanDriver.cpp
[1]73 driver/PeakCanDriver.h
[4]74 driver/igepCanDriver.h
75 driver/igepCanDriver.cpp
[1]76 )
77endif(UNIX)
78
79# ========================================
80# Files to MOC
81# ========================================
82
83set(
84 FILES_TO_MOC
85 CanGateway.h
86 DbtRawCanReader.h
87 ${PLUGIN_H}
88)
89
90set(
91 UI_FILES
92)
93
94# ========================================
95# Call MOC
96# ========================================
97qt4_wrap_cpp(
98 PROJECT_MOC_SRCS
99 ${FILES_TO_MOC}
100)
101
102qt4_wrap_ui(
103 PROJECT_UI_SRCS
104 ${UI_FILES}
105)
106
107# ========================================
108# Build a library
109# ========================================
110pacpus_add_library(
111 ${PROJECT_NAME} SHARED
112 ${PROJECT_SRCS}
113 ${PROJECT_MOC_SRCS}
114 ${PROJECT_UI_SRCS}
115)
116
117# ========================================
118# Libraries
119# ========================================
120if(WIN32)
121 set(LIBS
122 # add your specific libraries to link here
123 vcandm32.lib
124 vxlapi.lib
125 )
126endif(WIN32)
127
128if(UNIX)
129 set(LIBS
130 # add your specific libraries to link here
[4]131 # pcan
[1]132 )
133endif(UNIX)
134
135# All the platform
136target_link_libraries(
137 ${PROJECT_NAME}
138 ${PACPUS_LIBRARIES}
139 ${QT_LIBRARIES}
140 ${PACPUS_DEPENDENCIES_LIB}
[2]141 ${LIBS}
[4]142# PacpusTools
[1]143)
[11]144pacpus_folder(${PROJECT_NAME} "components")
[1]145
146# ========================================
147# Install
148# ========================================
149pacpus_install(${PROJECT_NAME})
Note: See TracBrowser for help on using the repository browser.