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