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