1 | project(ProducerConsumerExample)
|
---|
2 |
|
---|
3 | # ========================================
|
---|
4 | # Basic Definitions
|
---|
5 | # ========================================
|
---|
6 | set(${PROJECT_NAME}_VERSION_MAJOR 0)
|
---|
7 | set(${PROJECT_NAME}_VERSION_MINOR 1)
|
---|
8 |
|
---|
9 | create_export(EXPORT_HDR ${PROJECT_NAME})
|
---|
10 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME})
|
---|
11 |
|
---|
12 | # ========================================
|
---|
13 | # Compiler definitions
|
---|
14 | # ========================================
|
---|
15 | add_definitions(${QT_DEFINITIONS})
|
---|
16 |
|
---|
17 | # ========================================
|
---|
18 | # Include directories
|
---|
19 | # ========================================
|
---|
20 | include_directories(
|
---|
21 | ${PACPUSCITYVIP_INCLUDE_DIR}
|
---|
22 | ${PROJECT_BINARY_DIR}
|
---|
23 | ${QT_INCLUDE_DIR}
|
---|
24 | )
|
---|
25 |
|
---|
26 | # ========================================
|
---|
27 | # Link directories
|
---|
28 | # ========================================
|
---|
29 | set(SRC_BINARY_DIR "${PROJECT_BINARY_DIR}/../../src")
|
---|
30 | get_filename_component(SRC_BINARY_DIR "${SRC_BINARY_DIR}" ABSOLUTE)
|
---|
31 | #message("\${SRC_BINARY_DIR} = ${SRC_BINARY_DIR}")
|
---|
32 | link_directories(
|
---|
33 | ${SRC_BINARY_DIR}/PacpusLib
|
---|
34 | ${SRC_BINARY_DIR}/PacpusTools
|
---|
35 | ${SRC_BINARY_DIR}/RoadTime
|
---|
36 | )
|
---|
37 |
|
---|
38 | # ========================================
|
---|
39 | # List of sources
|
---|
40 | # ========================================
|
---|
41 | set(PROJECT_HDRS
|
---|
42 | ProducerExample.h
|
---|
43 | ConsumerExample.h
|
---|
44 | ${PROJECT_NAME}.xml
|
---|
45 | )
|
---|
46 | set(PROJECT_SRCS
|
---|
47 | ${PLUGIN_CPP}
|
---|
48 | ProducerExample.cpp
|
---|
49 | ConsumerExample.cpp
|
---|
50 | )
|
---|
51 |
|
---|
52 | # ========================================
|
---|
53 | # Files to MOC
|
---|
54 | # ========================================
|
---|
55 | set(FILES_TO_MOC
|
---|
56 | ${PLUGIN_H}
|
---|
57 | ProducerExample.h
|
---|
58 | ConsumerExample.h
|
---|
59 | )
|
---|
60 |
|
---|
61 | set(UI_FILES
|
---|
62 | )
|
---|
63 |
|
---|
64 | # ========================================
|
---|
65 | # Call MOC
|
---|
66 | # ========================================
|
---|
67 | qt_wrap_cpp(
|
---|
68 | PROJECT_MOC_SRCS
|
---|
69 | "${FILES_TO_MOC}"
|
---|
70 | )
|
---|
71 |
|
---|
72 | qt_wrap_ui(
|
---|
73 | PROJECT_UI_SRCS
|
---|
74 | "${UI_FILES}"
|
---|
75 | )
|
---|
76 |
|
---|
77 | # ========================================
|
---|
78 | # Build a library
|
---|
79 | # ========================================
|
---|
80 | pacpus_add_library(
|
---|
81 | ${PROJECT_NAME} SHARED
|
---|
82 | ${PROJECT_HDRS}
|
---|
83 | ${PROJECT_SRCS}
|
---|
84 | ${PROJECT_MOC_SRCS}
|
---|
85 | ${PROJECT_UI_SRCS}
|
---|
86 | )
|
---|
87 | list(APPEND PACPUS_LIBRARIES
|
---|
88 | optimized PacpusLib debug PacpusLib_d
|
---|
89 | )
|
---|
90 | if(WIN32)
|
---|
91 | list(APPEND PACPUS_LIBRARIES
|
---|
92 | optimized road_time debug road_time_d
|
---|
93 | )
|
---|
94 | endif()
|
---|
95 | #message("\${PACPUS_LIBRARIES} = ${PACPUS_LIBRARIES}")
|
---|
96 | #message("\${PACPUS_DEPENDENCIES_LIB} = ${PACPUS_DEPENDENCIES_LIB}")
|
---|
97 |
|
---|
98 | # ========================================
|
---|
99 | # Libraries
|
---|
100 | # ========================================
|
---|
101 | # All the platform
|
---|
102 | target_link_libraries(${PROJECT_NAME}
|
---|
103 | ${PACPUS_LIBRARIES}
|
---|
104 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
105 | ${QT_LIBRARIES}
|
---|
106 | #${OpenCV_LIBRARIES}
|
---|
107 | )
|
---|
108 |
|
---|
109 | # ========================================
|
---|
110 | # Install
|
---|
111 | # ========================================
|
---|
112 | pacpus_install(${PROJECT_NAME})
|
---|
113 |
|
---|
114 | # Installation of the headers
|
---|
115 | #install(DIRECTORY ${PACPUSCITYVIP_INCLUDE_DIR} DESTINATION "${PACPUS_ROOT}")
|
---|
116 |
|
---|
117 | # ========================================
|
---|
118 | # Folder
|
---|
119 | # ========================================
|
---|
120 | pacpus_folder(${PROJECT_NAME} "examples")
|
---|