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