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

Last change on this file since 148 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
RevLine 
[99]1#########################quick start############################################
2#cmake ../ -G "CodeBlocks - Unix Makefiles"
3#make
4#make install
5#make clean
6################################################################################
[59]7project(SpanCPTComponent)
8
9################################################################################
10add_definitions( -DCPTCOMPONENT_EXPORTS )
11add_definitions( -DPLUGINLIB_EXPORTS )
[99]12################################################################################
13create_export(EXPORT_HDR ${PROJECT_NAME})
14pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
15add_definitions (${QT_DEFINITIONS})
[59]16
[99]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/
[59]25)
26
27# ========================================
28# Link directories
29# ========================================
30link_directories(
31 ${PACPUS_LIB_DIR}
32)
33
34
[99]35################################################################################
36# FILES
37set(PROJECT_HDRS
38 ${EXPORT_HDR}
39 CPTComponent.h
[59]40 ../driver/AbstractSerialPort.h
[100]41 spancpt.xml
[99]42)
43set(PROJECT_SRCS
[59]44 ${PLUGIN_CPP}
[99]45 CPTComponent.cpp
46 ../driver/AbstractSerialPort.cpp
[59]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
[99]70 ${PLUGIN_HDR}
[59]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
[99]79 ${PLUGIN_HDR}
[59]80 )
81endif(WIN32)
82
[99]83set(UI_FILES
[59]84)
85
[99]86################################################################################
87# Qt: call moc, uic
88qt_wrap_cpp(PROJECT_MOC_SRCS
[59]89 ${FILES_TO_MOC}
90)
91
[99]92qt_wrap_ui(PROJECT_UI_SRCS
[59]93 ${UI_FILES}
94)
95
[99]96################################################################################
97# BUILD and LINK
98pacpus_add_library(${PROJECT_NAME} SHARED
99 ${PROJECT_HDRS}
[59]100 ${PROJECT_SRCS}
101 ${PROJECT_MOC_SRCS}
102 ${PROJECT_UI_SRCS}
103)
104
[99]105
[59]106# ========================================
107# Libraries
108# ========================================
[99]109set(LIBS
110 optimized FileLib debug FileLib_d
111 optimized PacpusLib debug PacpusLib_d
112 optimized PacpusTools debug PacpusTools_d
[105]113 NMEA0183LIB
[99]114)
115if (WIN32)
116 list(APPEND LIBS
117 optimized ROAD_TIME debug ROAD_TIME_d
[59]118 )
[99]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
[59]130pacpus_folder(${PROJECT_NAME} "components")
[99]131################################################################################
132# INSTALL
133pacpus_install(${PROJECT_NAME})
Note: See TracBrowser for help on using the repository browser.