1 | #########################quick start############################################
|
---|
2 | #cmake ../ -G "CodeBlocks - Unix Makefiles"
|
---|
3 | #make
|
---|
4 | #make install
|
---|
5 | #make clean
|
---|
6 | ################################################################################
|
---|
7 | project(Alasca)
|
---|
8 | set(${PROJECT_NAME}_VERSION_MAJOR 0)
|
---|
9 | set(${PROJECT_NAME}_VERSION_MINOR 1)
|
---|
10 | add_definitions( -DALASCAXT_EXPORTS )
|
---|
11 | add_definitions( -DALASCAXT_EXPORTS )
|
---|
12 |
|
---|
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 | AlascaComponent.h
|
---|
41 | AlascaSocket.h
|
---|
42 | #xml/${PROJECT_NAME}.xml
|
---|
43 | #xml/${PROJECT_NAME}_d.xml
|
---|
44 | )
|
---|
45 | set(PROJECT_SRCS
|
---|
46 | ${PLUGIN_CPP}
|
---|
47 | AlascaComponent.cpp
|
---|
48 | AlascaSocket.cpp
|
---|
49 | )
|
---|
50 |
|
---|
51 | set(FILES_TO_MOC
|
---|
52 | ${PLUGIN_HDR}
|
---|
53 | AlascaComponent.h
|
---|
54 | AlascaSocket.h
|
---|
55 | )
|
---|
56 |
|
---|
57 | set(UI_FILES
|
---|
58 | )
|
---|
59 |
|
---|
60 | ################################################################################
|
---|
61 | # Qt: call moc, uic
|
---|
62 | qt_wrap_cpp(PROJECT_MOC_SRCS
|
---|
63 | ${FILES_TO_MOC}
|
---|
64 | )
|
---|
65 |
|
---|
66 | qt_wrap_ui(PROJECT_UI_SRCS
|
---|
67 | ${UI_FILES}
|
---|
68 | )
|
---|
69 |
|
---|
70 | ################################################################################
|
---|
71 | # BUILD and LINK
|
---|
72 | pacpus_add_library(${PROJECT_NAME} SHARED
|
---|
73 | ${PROJECT_HDRS}
|
---|
74 | ${PROJECT_SRCS}
|
---|
75 | ${PROJECT_MOC_SRCS}
|
---|
76 | ${PROJECT_UI_SRCS}
|
---|
77 | )
|
---|
78 |
|
---|
79 |
|
---|
80 | # ========================================
|
---|
81 | # Libraries
|
---|
82 | # ========================================
|
---|
83 | set(LIBS
|
---|
84 | optimized FileLib debug FileLib_d
|
---|
85 | optimized PacpusLib debug PacpusLib_d
|
---|
86 | optimized PacpusTools debug PacpusTools_d
|
---|
87 | )
|
---|
88 | if (WIN32)
|
---|
89 | list(APPEND LIBS
|
---|
90 | optimized ROAD_TIME debug ROAD_TIME_d
|
---|
91 | )
|
---|
92 | endif()
|
---|
93 | # LINK
|
---|
94 | target_link_libraries(${PROJECT_NAME}
|
---|
95 | ${PACPUS_LIBRARIES}
|
---|
96 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
97 | ${LIBS}
|
---|
98 | ${QT_LIBRARIES}
|
---|
99 | )
|
---|
100 | qt5_use_modules(${PROJECT_NAME} Network)
|
---|
101 | ################################################################################
|
---|
102 | # FOLDERS
|
---|
103 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
104 | ################################################################################
|
---|
105 | # INSTALL
|
---|
106 | pacpus_install(${PROJECT_NAME})
|
---|