source: pacpussensors/trunk/Gps/CMakeLists.txt@ 99

Last change on this file since 99 was 99, checked in by nguyenhu, 9 years ago

compilation under linux with 0.2.X framework

File size: 3.4 KB
Line 
1#########################quick start############################################
2#cmake ../ -G "CodeBlocks - Unix Makefiles"
3#make
4#make install
5#make clean
6################################################################################
7project(Gps)
8set(${PROJECT_NAME}_VERSION_MAJOR 0)
9set(${PROJECT_NAME}_VERSION_MINOR 1)
10add_definitions( -DGPS_EXPORTS )
11################################################################################
12create_export(EXPORT_HDR ${PROJECT_NAME})
13pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
14add_definitions (${QT_DEFINITIONS})
15
16find_package(Qt5Network REQUIRED)
17find_package(Qt5Widgets REQUIRED)
18################################################################################
19# DIRECTORIES
20include_directories(
21 ${PROJECT_BINARY_DIR}
22 ${QT_INCLUDE_DIR}
23 ${PACPUS_INCLUDE_DIR}
24 ${PACPUS_INCLUDE_DIR}/Pacpus/
25)
26
27# ========================================
28# Link directories
29# ========================================
30link_directories(
31 ${PACPUS_LIB_DIR}
32)
33
34
35################################################################################
36# FILES
37set(PROJECT_HDRS
38 ${EXPORT_HDR}
39 gpsComponent.h
40 GpsFrames.h
41 SeptentrioSocket.h
42 SbfFrames.h
43 structure_gps.h
44 xml/gps_nmea.xml
45)
46set(PROJECT_SRCS
47 ${PLUGIN_CPP}
48 gpsComponent.cpp
49 SeptentrioSocket.cpp
50 ui/polarxmainwindow.cpp
51)
52
53if(WIN32)
54set(PROJECT_SRCS
55 ${PROJECT_SRCS}
56 ../driver/Win32SerialPort.cpp
57 ../driver/Win32SerialPort.h
58)
59endif(WIN32)
60
61if(UNIX)
62set(PROJECT_SRCS
63 ${PROJECT_SRCS}
64 ../driver/PosixSerialPort.cpp
65 ../driver/PosixSerialPort.h
66 )
67endif(UNIX)
68
69if(UNIX)
70set(FILES_TO_MOC
71 # add here the header files that you want to MOC
72 gpsComponent.h
73 GpsFrames.h
74 #SeptentrioComponent.h
75 SeptentrioSocket.h
76 ../driver/PosixSerialPort.h
77 ui/polarxmainwindow.hpp
78 ${PLUGIN_HDR}
79 )
80endif(UNIX)
81
82if(WIN32)
83set(FILES_TO_MOC
84 # add here the header files that you want to MOC
85 gpsComponent.h
86 # SeptentrioComponent.h
87 # SeptentrioSocket.h
88 ../driver/Win32SerialPort.h
89 # ui/polarxmainwindow.hpp
90 ${PLUGIN_HDR}
91 )
92endif(WIN32)
93
94set(UI_FILES
95)
96
97################################################################################
98# Qt: call moc, uic
99qt_wrap_cpp(PROJECT_MOC_SRCS
100 ${FILES_TO_MOC}
101)
102
103qt_wrap_ui(PROJECT_UI_SRCS
104 ${UI_FILES}
105)
106
107################################################################################
108# BUILD and LINK
109pacpus_add_library(${PROJECT_NAME} SHARED
110 ${PROJECT_HDRS}
111 ${PROJECT_SRCS}
112 ${PROJECT_MOC_SRCS}
113 ${PROJECT_UI_SRCS}
114)
115
116
117# ========================================
118# Libraries
119# ========================================
120set(LIBS
121 optimized FileLib debug FileLib_d
122 optimized PacpusLib debug PacpusLib_d
123 optimized PacpusTools debug PacpusTools_d
124 optimized NMEA0183LIB debug NMEA0183LIB_d
125)
126if (WIN32)
127 list(APPEND LIBS
128 optimized ROAD_TIME debug ROAD_TIME_d
129 )
130endif()
131# LINK
132target_link_libraries(${PROJECT_NAME}
133 ${PACPUS_LIBRARIES}
134 ${PACPUS_DEPENDENCIES_LIB}
135 ${LIBS}
136 ${QT_LIBRARIES}
137 )
138qt5_use_modules(${PROJECT_NAME} Network)
139################################################################################
140# FOLDERS
141pacpus_folder(${PROJECT_NAME} "components")
142################################################################################
143# INSTALL
144pacpus_install(${PROJECT_NAME})
Note: See TracBrowser for help on using the repository browser.