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

Last change on this file since 149 was 105, checked in by cerichar, 9 years ago

compilation OK under Windows 10 64 bits, Qt5.5, pacpus 0.2.2, boost 1.54

File size: 3.1 KB
Line 
1#########################quick start############################################
2#cmake ../ -G "CodeBlocks - Unix Makefiles"
3#make
4#make install
5#make clean
6################################################################################
7project(SpanCPTComponent)
8
9################################################################################
10add_definitions( -DCPTCOMPONENT_EXPORTS )
11add_definitions( -DPLUGINLIB_EXPORTS )
12################################################################################
13create_export(EXPORT_HDR ${PROJECT_NAME})
14pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
15add_definitions (${QT_DEFINITIONS})
16
17find_package(Qt5Network 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 CPTComponent.h
40 ../driver/AbstractSerialPort.h
41 spancpt.xml
42)
43set(PROJECT_SRCS
44 ${PLUGIN_CPP}
45 CPTComponent.cpp
46 ../driver/AbstractSerialPort.cpp
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 CPTComponent.h
69 ../driver/PosixSerialPort.h
70 ${PLUGIN_HDR}
71 )
72endif(UNIX)
73
74if(WIN32)
75set(FILES_TO_MOC
76 # add here the header files that you want to MOC
77 CPTComponent.h
78 ../driver/Win32SerialPort.h
79 ${PLUGIN_HDR}
80 )
81endif(WIN32)
82
83set(UI_FILES
84)
85
86################################################################################
87# Qt: call moc, uic
88qt_wrap_cpp(PROJECT_MOC_SRCS
89 ${FILES_TO_MOC}
90)
91
92qt_wrap_ui(PROJECT_UI_SRCS
93 ${UI_FILES}
94)
95
96################################################################################
97# BUILD and LINK
98pacpus_add_library(${PROJECT_NAME} SHARED
99 ${PROJECT_HDRS}
100 ${PROJECT_SRCS}
101 ${PROJECT_MOC_SRCS}
102 ${PROJECT_UI_SRCS}
103)
104
105
106# ========================================
107# Libraries
108# ========================================
109set(LIBS
110 optimized FileLib debug FileLib_d
111 optimized PacpusLib debug PacpusLib_d
112 optimized PacpusTools debug PacpusTools_d
113 NMEA0183LIB
114)
115if (WIN32)
116 list(APPEND LIBS
117 optimized ROAD_TIME debug ROAD_TIME_d
118 )
119endif()
120# LINK
121target_link_libraries(${PROJECT_NAME}
122 ${PACPUS_LIBRARIES}
123 ${PACPUS_DEPENDENCIES_LIB}
124 ${LIBS}
125 ${QT_LIBRARIES}
126 )
127qt5_use_modules(${PROJECT_NAME} Network)
128################################################################################
129# FOLDERS
130pacpus_folder(${PROJECT_NAME} "components")
131################################################################################
132# INSTALL
133pacpus_install(${PROJECT_NAME})
Note: See TracBrowser for help on using the repository browser.