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