1 | project(PtGreyCameras)
|
---|
2 | ################################################################################
|
---|
3 | add_definitions(-DPTGREYCAMERAS_EXPORTS)
|
---|
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 | # Find dependencies
|
---|
18 | # ========================================
|
---|
19 | find_package(OpenCV REQUIRED)
|
---|
20 | if(OpenCV_FOUND)
|
---|
21 | list(APPEND OpenCV_LIBS ${OpenCV_LIBRARIES})
|
---|
22 | list(APPEND OpenCV_INCLUDE_DIR ${OpenCV_INCLUDE_DIRS})
|
---|
23 | include_directories(${OpenCV_INCLUDE_DIR})
|
---|
24 | endif(OpenCV_FOUND)
|
---|
25 |
|
---|
26 |
|
---|
27 | # ========================================
|
---|
28 | # Compiler definitions
|
---|
29 | # ========================================
|
---|
30 | add_definitions(
|
---|
31 | ${QT_DEFINITIONS}
|
---|
32 | )
|
---|
33 | # ========================================
|
---|
34 | # Options
|
---|
35 | # ========================================
|
---|
36 | option(BUILD_PtGreyCameras "Whether or not build the PointGrey cameras" OFF)
|
---|
37 | if (BUILD_PtGreyCameras)
|
---|
38 | option(BUILD_BumbleBeeXB3 "Whether or not build the BumbleBeeXB3" OFF)
|
---|
39 | option(BUILD_FlyCapture2 "Whether or not build the FlyCapture2 based cameras" OFF)
|
---|
40 | # ========================================
|
---|
41 | # Find dependencies
|
---|
42 | # ========================================
|
---|
43 | if(BUILD_BumbleBeeXB3)
|
---|
44 | find_package(BumblebeeXB3 REQUIRED)
|
---|
45 | if(BumbleBeeXB3_FOUND)
|
---|
46 | list(APPEND OPT_LIBRARIES ${BumbleBeeXB3_LIBRARIES})
|
---|
47 | list(APPEND DBG_LIBRARIES ${BumbleBeeXB3_LIBRARIES})
|
---|
48 | list(APPEND OPT_INCLUDE_DIRS ${BumbleBeeXB3_INCLUDE_DIRS})
|
---|
49 | include_directories(${BumbleBeeXB3_INCLUDE_DIRS})
|
---|
50 | endif(BumbleBeeXB3_FOUND)
|
---|
51 | endif()
|
---|
52 | # ========================================
|
---|
53 | # Find dependencies
|
---|
54 | # ========================================
|
---|
55 | if(BUILD_FlyCapture2)
|
---|
56 | find_package(FlyCapture2 REQUIRED)
|
---|
57 | if(FlyCapture2_FOUND)
|
---|
58 | list(APPEND OPT_LIBRARIES ${FlyCapture2_LIBRARIES_OPT})
|
---|
59 | list(APPEND DBG_LIBRARIES ${FlyCapture2_LIBRARIES_OPT})
|
---|
60 | list(APPEND OPT_INCLUDE_DIRS ${FlyCapture2_INCLUDE_DIRS})
|
---|
61 | include_directories(${FlyCapture2_INCLUDE_DIRS})
|
---|
62 | endif(FlyCapture2_FOUND)
|
---|
63 | endif()
|
---|
64 | endif()
|
---|
65 |
|
---|
66 | # ========================================
|
---|
67 | # Include directories
|
---|
68 | # ========================================
|
---|
69 | include_directories(
|
---|
70 | ${PACPUS_INCLUDE_HINT}
|
---|
71 | ${QT_INCLUDE_DIR}
|
---|
72 | ${OPT_INCLUDE_DIRS}
|
---|
73 | ${OpenCV_INCLUDE_DIR}
|
---|
74 | )
|
---|
75 |
|
---|
76 | # ========================================
|
---|
77 | # Link directories
|
---|
78 | # ========================================
|
---|
79 | link_directories(
|
---|
80 | ${PACPUS_LIBRARY_HINT}
|
---|
81 | )
|
---|
82 |
|
---|
83 | message("Creating source files for the plugin(s)")
|
---|
84 | message(STATUS PLUGIN_H=${PLUGIN_H})
|
---|
85 | message(STATUS PLUGIN_CPP=${PLUGIN_CPP})
|
---|
86 |
|
---|
87 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
|
---|
88 |
|
---|
89 | # ========================================
|
---|
90 | # List of sources
|
---|
91 | # ========================================
|
---|
92 | set(
|
---|
93 | PROJECT_SRCS
|
---|
94 | PtGreyCamerasExp.h
|
---|
95 | #../../StdDbtPlayerComponents/ImageBaseStructure.h
|
---|
96 | ${PLUGIN_CPP}
|
---|
97 | )
|
---|
98 | if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND )
|
---|
99 | list(APPEND PROJECT_SRCS
|
---|
100 | BumblebeeXB3.cpp
|
---|
101 | BumblebeeXB3.h
|
---|
102 | )
|
---|
103 | endif()
|
---|
104 |
|
---|
105 | if(BUILD_PtGreyCameras AND FlyCapture2_FOUND )
|
---|
106 | list(APPEND PROJECT_SRCS
|
---|
107 | Flea3Component.cpp
|
---|
108 | Flea3Component.h
|
---|
109 | Flea3Grabber.cpp
|
---|
110 | Flea3Grabber.h
|
---|
111 | )
|
---|
112 | endif()
|
---|
113 |
|
---|
114 | # ========================================
|
---|
115 | # Files to MOC
|
---|
116 | # ========================================
|
---|
117 | set(
|
---|
118 | FILES_TO_MOC
|
---|
119 | ${PLUGIN_H}
|
---|
120 | )
|
---|
121 | if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND)
|
---|
122 | list(APPEND
|
---|
123 | FILES_TO_MOC
|
---|
124 | BumblebeeXB3.h
|
---|
125 | )
|
---|
126 | endif()
|
---|
127 |
|
---|
128 | if(BUILD_PtGreyCameras AND FlyCapture2_FOUND)
|
---|
129 | list(APPEND
|
---|
130 | FILES_TO_MOC
|
---|
131 | Flea3Component.h
|
---|
132 | #Flea3Grabber.h
|
---|
133 | )
|
---|
134 | endif()
|
---|
135 |
|
---|
136 | set(
|
---|
137 | UI_FILES
|
---|
138 | # WidgetIMU.ui
|
---|
139 |
|
---|
140 | )
|
---|
141 |
|
---|
142 | # ========================================
|
---|
143 | # Directories architecture
|
---|
144 | # ========================================
|
---|
145 | #SOURCE_GROUP(PtGreyCameras FILES ${PROJECT_SRCS} )
|
---|
146 | SOURCE_GROUP(moc FILES ${PROJECT_MOC_SRCS})
|
---|
147 |
|
---|
148 | # ========================================
|
---|
149 | # Call MOC
|
---|
150 | # ========================================
|
---|
151 | qt4_wrap_cpp(
|
---|
152 | PROJECT_MOC_SRCS
|
---|
153 | ${FILES_TO_MOC}
|
---|
154 | )
|
---|
155 |
|
---|
156 | qt4_wrap_ui(
|
---|
157 | PROJECT_UI_SRCS
|
---|
158 | ${UI_FILES}
|
---|
159 | )
|
---|
160 |
|
---|
161 | # ========================================
|
---|
162 | # Build a library
|
---|
163 | # ========================================
|
---|
164 | pacpus_add_library(
|
---|
165 | ${PROJECT_NAME} SHARED
|
---|
166 | ${PROJECT_SRCS}
|
---|
167 | ${PROJECT_MOC_SRCS}
|
---|
168 | ${PROJECT_UI_SRCS}
|
---|
169 | )
|
---|
170 | # ========================================
|
---|
171 | # Libraries
|
---|
172 | # ========================================
|
---|
173 | # All the platform
|
---|
174 | message ( "\${VAR} = ${OPT_LIBRARIES}")
|
---|
175 | target_link_libraries(
|
---|
176 | ${PROJECT_NAME}
|
---|
177 | ${PACPUS_LIBRARIES}
|
---|
178 | ${QT_LIBRARIES}
|
---|
179 | optimized ${OPT_LIBRARIES} debug ${DBG_LIBRARIES}
|
---|
180 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
181 | ${OpenCV_LIBS}
|
---|
182 | ${BumbleBeeXB3_PGR_LIBRARIES}
|
---|
183 | ${BumbleBeeXB3_TRICLOPS_LIBRARIES}
|
---|
184 | )
|
---|
185 |
|
---|
186 | # ========================================
|
---|
187 | # Install
|
---|
188 | # ========================================
|
---|
189 | pacpus_install(${PROJECT_NAME})
|
---|