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

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

I/O for DbtPlyVtgManager, add classes to compile, fixed DbtPlyCPT by adding type Pose3D from previous version

File size: 3.3 KB
RevLine 
[99]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 structure_gps.h
42)
43set(PROJECT_SRCS
44 ${PLUGIN_CPP}
45 gpsComponent.cpp
[105]46
[99]47)
48
49if(WIN32)
50set(PROJECT_SRCS
51 ${PROJECT_SRCS}
52 ../driver/Win32SerialPort.cpp
53 ../driver/Win32SerialPort.h
54)
55endif(WIN32)
56
57if(UNIX)
58set(PROJECT_SRCS
59 ${PROJECT_SRCS}
60 ../driver/PosixSerialPort.cpp
61 ../driver/PosixSerialPort.h
62 )
63endif(UNIX)
64
65if(UNIX)
66set(FILES_TO_MOC
67 # add here the header files that you want to MOC
68 gpsComponent.h
69 GpsFrames.h
70 ../driver/PosixSerialPort.h
71 ${PLUGIN_HDR}
72 )
73endif(UNIX)
74
75if(WIN32)
76set(FILES_TO_MOC
77 # add here the header files that you want to MOC
78 gpsComponent.h
79 ../driver/Win32SerialPort.h
80 ${PLUGIN_HDR}
81 )
82endif(WIN32)
83
84set(UI_FILES
85)
86
87################################################################################
88# Qt: call moc, uic
89qt_wrap_cpp(PROJECT_MOC_SRCS
90 ${FILES_TO_MOC}
91)
92
93qt_wrap_ui(PROJECT_UI_SRCS
94 ${UI_FILES}
95)
96
97################################################################################
98# BUILD and LINK
99pacpus_add_library(${PROJECT_NAME} SHARED
100 ${PROJECT_HDRS}
101 ${PROJECT_SRCS}
102 ${PROJECT_MOC_SRCS}
103 ${PROJECT_UI_SRCS}
104)
105
106
107# ========================================
108# Libraries
109# ========================================
110set(LIBS
111 optimized FileLib debug FileLib_d
112 optimized PacpusLib debug PacpusLib_d
113 optimized PacpusTools debug PacpusTools_d
[109]114 optimized NMEA0183LIB debug NMEA0183LIB_d
[99]115)
116if (WIN32)
117 list(APPEND LIBS
118 optimized ROAD_TIME debug ROAD_TIME_d
119 )
120endif()
121# LINK
122target_link_libraries(${PROJECT_NAME}
123 ${PACPUS_LIBRARIES}
124 ${PACPUS_DEPENDENCIES_LIB}
125 ${LIBS}
126 ${QT_LIBRARIES}
127 )
128qt5_use_modules(${PROJECT_NAME} Network)
129################################################################################
130# FOLDERS
131pacpus_folder(${PROJECT_NAME} "components")
132################################################################################
133# INSTALL
134pacpus_install(${PROJECT_NAME})
[109]135
136# install headers
137install(
138 DIRECTORY
139 ${Gps_SOURCE_DIR}
140 DESTINATION
141 ${PACPUS_INSTALL_DIR}/include
142 FILES_MATCHING PATTERN "*.h"
143)
144# if WIN32 install driver dependencies
Note: See TracBrowser for help on using the repository browser.