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

Last change on this file since 137 was 112, checked in by DHERBOMEZ Gérald, 9 years ago

Bug fix to build GPS plugin in debug

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