1 | #########################quick start############################################
|
---|
2 | #cmake ../ -G "CodeBlocks - Unix Makefiles"
|
---|
3 | #make
|
---|
4 | #make install
|
---|
5 | #make clean
|
---|
6 | ################################################################################
|
---|
7 | project(Sick)
|
---|
8 | set(${PROJECT_NAME}_VERSION_MAJOR 0)
|
---|
9 | set(${PROJECT_NAME}_VERSION_MINOR 1)
|
---|
10 | add_definitions( -DSICK_EXPORTS )
|
---|
11 | add_definitions( -DSICKLDMRS_EXPORTS )
|
---|
12 | add_definitions( -DSICKLMS_EXPORTS )
|
---|
13 | ################################################################################
|
---|
14 | create_export(EXPORT_HDR ${PROJECT_NAME})
|
---|
15 | pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
|
---|
16 | add_definitions (${QT_DEFINITIONS})
|
---|
17 |
|
---|
18 | find_package(Qt5Network REQUIRED)
|
---|
19 | ################################################################################
|
---|
20 | # DIRECTORIES
|
---|
21 | include_directories(
|
---|
22 | ${PROJECT_BINARY_DIR}
|
---|
23 | ${QT_INCLUDE_DIR}
|
---|
24 | ${PACPUS_INCLUDE_DIR}
|
---|
25 | ${PACPUS_INCLUDE_DIR}/Pacpus/
|
---|
26 | )
|
---|
27 |
|
---|
28 | # ========================================
|
---|
29 | # Link directories
|
---|
30 | # ========================================
|
---|
31 | link_directories(
|
---|
32 | ${PACPUS_LIB_DIR}
|
---|
33 | )
|
---|
34 |
|
---|
35 |
|
---|
36 | ################################################################################
|
---|
37 | # FILES
|
---|
38 | set(PROJECT_HDRS
|
---|
39 | ${EXPORT_HDR}
|
---|
40 | SickComponent.h
|
---|
41 | AbstractSickSensor.h
|
---|
42 | SickLDMRSSensor.h
|
---|
43 | SickLMSSensor.h
|
---|
44 | SickSocket.h
|
---|
45 | #xml/${PROJECT_NAME}.xml
|
---|
46 | #xml/${PROJECT_NAME}_d.xml
|
---|
47 | )
|
---|
48 | set(PROJECT_SRCS
|
---|
49 | ${PLUGIN_CPP}
|
---|
50 | SickComponent.cpp
|
---|
51 | AbstractSickSensor.cpp
|
---|
52 | SickLDMRSSensor.cpp
|
---|
53 | SickLMSSensor.cpp
|
---|
54 | SickSocket.cpp
|
---|
55 | )
|
---|
56 |
|
---|
57 | set(FILES_TO_MOC
|
---|
58 | ${PLUGIN_HDR}
|
---|
59 | SickComponent.h
|
---|
60 | AbstractSickSensor.h
|
---|
61 | SickLDMRSSensor.h
|
---|
62 | SickLMSSensor.h
|
---|
63 | SickSocket.h
|
---|
64 | )
|
---|
65 |
|
---|
66 | set(UI_FILES
|
---|
67 | )
|
---|
68 |
|
---|
69 | ################################################################################
|
---|
70 | # Qt: call moc, uic
|
---|
71 | qt_wrap_cpp(PROJECT_MOC_SRCS
|
---|
72 | ${FILES_TO_MOC}
|
---|
73 | )
|
---|
74 |
|
---|
75 | qt_wrap_ui(PROJECT_UI_SRCS
|
---|
76 | ${UI_FILES}
|
---|
77 | )
|
---|
78 |
|
---|
79 | ################################################################################
|
---|
80 | # BUILD and LINK
|
---|
81 | pacpus_add_library(${PROJECT_NAME} SHARED
|
---|
82 | ${PROJECT_HDRS}
|
---|
83 | ${PROJECT_SRCS}
|
---|
84 | ${PROJECT_MOC_SRCS}
|
---|
85 | ${PROJECT_UI_SRCS}
|
---|
86 | )
|
---|
87 |
|
---|
88 |
|
---|
89 | # ========================================
|
---|
90 | # Libraries
|
---|
91 | # ========================================
|
---|
92 | set(LIBS
|
---|
93 | optimized FileLib debug FileLib_d
|
---|
94 | optimized PacpusLib debug PacpusLib_d
|
---|
95 | optimized PacpusTools debug PacpusTools_d
|
---|
96 | )
|
---|
97 | if (WIN32)
|
---|
98 | list(APPEND LIBS
|
---|
99 | optimized ROAD_TIME debug ROAD_TIME_d
|
---|
100 | )
|
---|
101 | endif()
|
---|
102 | # LINK
|
---|
103 | target_link_libraries(${PROJECT_NAME}
|
---|
104 | ${PACPUS_LIBRARIES}
|
---|
105 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
106 | ${LIBS}
|
---|
107 | ${QT_LIBRARIES}
|
---|
108 | )
|
---|
109 | qt5_use_modules(${PROJECT_NAME} Network)
|
---|
110 | ################################################################################
|
---|
111 | # FOLDERS
|
---|
112 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
113 | ################################################################################
|
---|
114 | # INSTALL
|
---|
115 | pacpus_install(${PROJECT_NAME})
|
---|