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 | ${EXPORT_HDR}
|
---|
46 | )
|
---|
47 | set(PROJECT_SRCS
|
---|
48 | ${PLUGIN_CPP}
|
---|
49 | ProducerExample.cpp
|
---|
50 | ConsumerExample.cpp
|
---|
51 | )
|
---|
52 |
|
---|
53 | # ========================================
|
---|
54 | # Files to MOC
|
---|
55 | # ========================================
|
---|
56 | set(FILES_TO_MOC
|
---|
57 | ${PLUGIN_H}
|
---|
58 | ProducerExample.h
|
---|
59 | ConsumerExample.h
|
---|
60 | )
|
---|
61 |
|
---|
62 | set(UI_FILES
|
---|
63 | )
|
---|
64 |
|
---|
65 | # ========================================
|
---|
66 | # Call MOC
|
---|
67 | # ========================================
|
---|
68 | qt_wrap_cpp(
|
---|
69 | PROJECT_MOC_SRCS
|
---|
70 | ${FILES_TO_MOC}
|
---|
71 | )
|
---|
72 |
|
---|
73 | qt_wrap_ui(
|
---|
74 | PROJECT_UI_SRCS
|
---|
75 | ${UI_FILES}
|
---|
76 | )
|
---|
77 |
|
---|
78 | # ========================================
|
---|
79 | # Build a library
|
---|
80 | # ========================================
|
---|
81 | pacpus_add_library(
|
---|
82 | ${PROJECT_NAME} SHARED
|
---|
83 | ${PROJECT_HDRS}
|
---|
84 | ${PROJECT_SRCS}
|
---|
85 | ${PROJECT_MOC_SRCS}
|
---|
86 | ${PROJECT_UI_SRCS}
|
---|
87 | )
|
---|
88 | list(APPEND PACPUS_LIBRARIES
|
---|
89 | optimized PacpusLib debug PacpusLib_d
|
---|
90 | )
|
---|
91 | if(WIN32)
|
---|
92 | list(APPEND PACPUS_LIBRARIES
|
---|
93 | optimized road_time debug road_time_d
|
---|
94 | )
|
---|
95 | endif()
|
---|
96 | #message("\${PACPUS_LIBRARIES} = ${PACPUS_LIBRARIES}")
|
---|
97 | #message("\${PACPUS_DEPENDENCIES_LIB} = ${PACPUS_DEPENDENCIES_LIB}")
|
---|
98 |
|
---|
99 | # ========================================
|
---|
100 | # Libraries
|
---|
101 | # ========================================
|
---|
102 | # All the platform
|
---|
103 | target_link_libraries(${PROJECT_NAME}
|
---|
104 | ${PACPUS_LIBRARIES}
|
---|
105 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
106 | ${QT_LIBRARIES}
|
---|
107 | #${OpenCV_LIBRARIES}
|
---|
108 | )
|
---|
109 |
|
---|
110 | # ========================================
|
---|
111 | # Install
|
---|
112 | # ========================================
|
---|
113 | pacpus_install(${PROJECT_NAME})
|
---|
114 |
|
---|
115 | # Installation of the headers
|
---|
116 | #install(DIRECTORY ${PACPUSCITYVIP_INCLUDE_DIR} DESTINATION "${PACPUS_ROOT}")
|
---|
117 |
|
---|
118 | # ========================================
|
---|
119 | # Folder
|
---|
120 | # ========================================
|
---|
121 | pacpus_folder(${PROJECT_NAME} "examples")
|
---|