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