[21] | 1 | project(PacpusSocket)
|
---|
| 2 | ################################################################################
|
---|
[39] | 3 | add_definitions(-DPACPUSSOCKET_EXPORTS)
|
---|
[21] | 4 |
|
---|
| 5 | # ========================================
|
---|
| 6 | # Configure qt4
|
---|
| 7 | # ========================================
|
---|
| 8 | if(QT4_FOUND)
|
---|
[85] | 9 | set(QT_USE_QTXML true)
|
---|
| 10 | set(QT_USE_QTNETWORK true)
|
---|
| 11 | include(${QT_USE_FILE})
|
---|
[21] | 12 | else()
|
---|
[85] | 13 | message(ERROR "Qt4 needed")
|
---|
[21] | 14 | endif()
|
---|
| 15 |
|
---|
| 16 | # ========================================
|
---|
| 17 | # Compiler definitions
|
---|
| 18 | # ========================================
|
---|
| 19 | add_definitions(
|
---|
[85] | 20 | ${QT_DEFINITIONS}
|
---|
[21] | 21 | )
|
---|
| 22 |
|
---|
| 23 | # ========================================
|
---|
| 24 | # Include directories
|
---|
| 25 | # ========================================
|
---|
| 26 | include_directories(
|
---|
[85] | 27 | ${PROJECT_BINARY_DIR}
|
---|
| 28 | ${QT_INCLUDE_DIR}
|
---|
[21] | 29 | )
|
---|
| 30 |
|
---|
| 31 | # ========================================
|
---|
| 32 | # Link directories
|
---|
| 33 | # ========================================
|
---|
| 34 | link_directories(
|
---|
| 35 | )
|
---|
| 36 |
|
---|
| 37 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
|
---|
| 38 |
|
---|
| 39 | # ========================================
|
---|
| 40 | # List of sources
|
---|
| 41 | # ========================================
|
---|
| 42 | set(
|
---|
| 43 | PROJECT_SRCS
|
---|
[85] | 44 | PacpusSocketAirplug.cpp
|
---|
| 45 | PacpusSocketAirplug.h
|
---|
| 46 | PacpusUDPSocket.cpp
|
---|
| 47 | PacpusUDPSocket.h
|
---|
[21] | 48 | ${PLUGIN_CPP}
|
---|
| 49 | )
|
---|
| 50 |
|
---|
| 51 | # ========================================
|
---|
| 52 | # Files to MOC
|
---|
| 53 | # ========================================
|
---|
| 54 | set(
|
---|
| 55 | FILES_TO_MOC
|
---|
[85] | 56 | PacpusSocketAirplug.h
|
---|
| 57 | PacpusUDPSocket.h
|
---|
[21] | 58 | ${PLUGIN_H}
|
---|
| 59 | )
|
---|
| 60 |
|
---|
| 61 | set(
|
---|
| 62 | UI_FILES
|
---|
| 63 |
|
---|
| 64 | )
|
---|
| 65 |
|
---|
| 66 | # ========================================
|
---|
| 67 | # Call MOC
|
---|
| 68 | # ========================================
|
---|
| 69 | qt4_wrap_cpp(
|
---|
| 70 | PROJECT_MOC_SRCS
|
---|
| 71 | ${FILES_TO_MOC}
|
---|
| 72 | )
|
---|
| 73 |
|
---|
| 74 | qt4_wrap_ui(
|
---|
| 75 | PROJECT_UI_SRCS
|
---|
| 76 | ${UI_FILES}
|
---|
| 77 | )
|
---|
| 78 |
|
---|
| 79 | # ========================================
|
---|
| 80 | # Build a library
|
---|
| 81 | # ========================================
|
---|
| 82 | pacpus_add_library(
|
---|
| 83 | ${PROJECT_NAME} SHARED
|
---|
| 84 | ${PROJECT_SRCS}
|
---|
| 85 | ${PROJECT_MOC_SRCS}
|
---|
| 86 | ${PROJECT_UI_SRCS}
|
---|
| 87 | )
|
---|
| 88 |
|
---|
| 89 | # ========================================
|
---|
| 90 | # Libraries
|
---|
| 91 | # ========================================
|
---|
| 92 | # All the platform
|
---|
| 93 | target_link_libraries(
|
---|
| 94 | ${PROJECT_NAME}
|
---|
| 95 | ${PACPUS_LIBRARIES}
|
---|
| 96 | ${QT_LIBRARIES}
|
---|
| 97 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
| 98 | )
|
---|
| 99 |
|
---|
| 100 | # ========================================
|
---|
| 101 | # Install
|
---|
| 102 | # ========================================
|
---|
[85] | 103 | pacpus_install(${PROJECT_NAME}) |
---|