source: pacpussensors/trunk/SpanCPTComponent/CMakeLists.txt@ 82

Last change on this file since 82 was 59, checked in by DHERBOMEZ Gérald, 10 years ago

Integration of new modules:

  • GPS NMEA0183 decoder
  • Span CPT Decoder

Update of:

File size: 3.0 KB
RevLine 
[59]1project(SpanCPTComponent)
2
3################################################################################
4add_definitions( -DCPTCOMPONENT_EXPORTS )
5add_definitions( -DPLUGINLIB_EXPORTS )
6
7
8# ========================================
9# Configure qt4
10# ========================================
11if(QT4_FOUND)
12 set(QT_USE_QTXML true)
13 set(QT_USE_QTNETWORK true)
14 include(${QT_USE_FILE})
15else()
16 message(ERROR "Qt4 needed")
17endif()
18
19# ========================================
20# Compiler definitions
21# ========================================
22add_definitions(
23 ${QT_DEFINITIONS}
24)
25
26# ========================================
27# Include directories
28# ========================================
29include_directories(
30 ${PROJECT_BINARY_DIR}
31 ${QT_INCLUDE_DIR}
32)
33
34# ========================================
35# Link directories
36# ========================================
37link_directories(
38 ${PACPUS_LIB_DIR}
39)
40
41
42pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
43
44# ========================================
45# List of sources
46# ========================================
47set(
48 PROJECT_SRCS
49 CPTComponent.h
50 CPTComponent.cpp
51 ../driver/AbstractSerialPort.h
52 ../driver/AbstractSerialPort.cpp
53 ${PLUGIN_CPP}
54)
55
56if(WIN32)
57set(PROJECT_SRCS
58 ${PROJECT_SRCS}
59 ../driver/Win32SerialPort.cpp
60 ../driver/Win32SerialPort.h
61)
62endif(WIN32)
63
64if(UNIX)
65set(PROJECT_SRCS
66 ${PROJECT_SRCS}
67 ../driver/PosixSerialPort.cpp
68 ../driver/PosixSerialPort.h
69 )
70endif(UNIX)
71
72
73# ========================================
74# Files to MOC
75# ========================================
76
77if(UNIX)
78set(FILES_TO_MOC
79 # add here the header files that you want to MOC
80 CPTComponent.h
81 ../driver/PosixSerialPort.h
82 ${PLUGIN_H}
83 )
84endif(UNIX)
85
86if(WIN32)
87set(FILES_TO_MOC
88 # add here the header files that you want to MOC
89 CPTComponent.h
90 ../driver/Win32SerialPort.h
91 ${PLUGIN_H}
92 )
93endif(WIN32)
94
95set(
96 UI_FILES
97)
98
99# ========================================
100# Call MOC
101# ========================================
102qt4_wrap_cpp(
103 PROJECT_MOC_SRCS
104 ${FILES_TO_MOC}
105)
106
107qt4_wrap_ui(
108 PROJECT_UI_SRCS
109 ${UI_FILES}
110)
111
112# ========================================
113# Build a library
114# ========================================
115pacpus_add_library(
116 ${PROJECT_NAME} SHARED
117 ${PROJECT_SRCS}
118 ${PROJECT_MOC_SRCS}
119 ${PROJECT_UI_SRCS}
120)
121
122# ========================================
123# Libraries
124# ========================================
125if(WIN32)
126 set(LIBS
127 # add your specific libraries to link here
128 optimized NMEA0183LIB debug NMEA0183LIB_d
129 optimized PacpusTools debug PacpusTools_d
130 )
131endif(WIN32)
132
133if(UNIX)
134 set(LIBS
135 # add your specific libraries to link here
136
137 )
138endif(UNIX)
139
140# All the platform
141target_link_libraries(
142 ${PROJECT_NAME}
143 ${PACPUS_LIBRARIES}
144 ${QT_LIBRARIES}
145 ${PACPUS_DEPENDENCIES_LIB}
146 ${LIBS}
147# optimized PacpusTools debug PacpusTools_d
148)
149pacpus_folder(${PROJECT_NAME} "components")
150
151# ========================================
152# Install
153# ========================================
154pacpus_install(${PROJECT_NAME})
155
Note: See TracBrowser for help on using the repository browser.