1 | #########################quick start############################################
|
---|
2 | # cmake ../ -G "CodeBlocks - Unix Makefiles"
|
---|
3 | # make
|
---|
4 | # make install
|
---|
5 | # make clean
|
---|
6 | # sudo apt-get install libopencv-dev
|
---|
7 | ################################################################################
|
---|
8 | project(PtGreyCameras)
|
---|
9 | set(${PROJECT_NAME}_VERSION_MAJOR 0)
|
---|
10 | set(${PROJECT_NAME}_VERSION_MINOR 1)
|
---|
11 | # Create a DLL
|
---|
12 | add_definitions(-DCVWEBCAM_COMPONENT_EXPORTS)
|
---|
13 | add_definitions( -DVIDEO_EXPORTS )
|
---|
14 |
|
---|
15 | #include(FindOpenCV.cmake)
|
---|
16 | find_package(OpenCV REQUIRED)
|
---|
17 |
|
---|
18 | # Check for OpenCV
|
---|
19 | if(NOT OpenCV_FOUND)
|
---|
20 | message(FATAL_ERROR "Project ${PROJECT_NAME} requires OpenCV library")
|
---|
21 | endif()
|
---|
22 | ################################################################################
|
---|
23 | create_export(EXPORT_HDR ${PROJECT_NAME})
|
---|
24 | pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
|
---|
25 | add_definitions (${QT_DEFINITIONS})
|
---|
26 | # ========================================
|
---|
27 | # Options
|
---|
28 | # ========================================
|
---|
29 | option(BUILD_PtGreyCameras "Whether or not build the PointGrey cameras" OFF)
|
---|
30 | if (BUILD_PtGreyCameras)
|
---|
31 | option(BUILD_BumbleBeeXB3 "Whether or not build the BumbleBeeXB3" OFF)
|
---|
32 | option(BUILD_FlyCapture2 "Whether or not build the FlyCapture2 based cameras" OFF)
|
---|
33 | # ========================================
|
---|
34 | # Find dependencies
|
---|
35 | # ========================================
|
---|
36 | if(BUILD_BumbleBeeXB3)
|
---|
37 | find_package(BumblebeeXB3 REQUIRED)
|
---|
38 | if(BumbleBeeXB3_FOUND)
|
---|
39 | list(APPEND OPT_LIBRARIES ${BumbleBeeXB3_LIBRARIES})
|
---|
40 | list(APPEND DBG_LIBRARIES ${BumbleBeeXB3_LIBRARIES})
|
---|
41 | list(APPEND OPT_INCLUDE_DIRS ${BumbleBeeXB3_INCLUDE_DIRS})
|
---|
42 | include_directories(${BumbleBeeXB3_INCLUDE_DIRS})
|
---|
43 | endif(BumbleBeeXB3_FOUND)
|
---|
44 | endif()
|
---|
45 | # ========================================
|
---|
46 | # Find dependencies
|
---|
47 | # ========================================
|
---|
48 | if(BUILD_FlyCapture2)
|
---|
49 | find_package(FlyCapture2 REQUIRED)
|
---|
50 | if(FlyCapture2_FOUND)
|
---|
51 | list(APPEND OPT_LIBRARIES ${FlyCapture2_LIBRARIES_OPT})
|
---|
52 | list(APPEND DBG_LIBRARIES ${FlyCapture2_LIBRARIES_OPT})
|
---|
53 | list(APPEND OPT_INCLUDE_DIRS ${FlyCapture2_INCLUDE_DIRS})
|
---|
54 | include_directories(${FlyCapture2_INCLUDE_DIRS})
|
---|
55 | endif(FlyCapture2_FOUND)
|
---|
56 | endif()
|
---|
57 | endif()
|
---|
58 | find_package(Qt5Network REQUIRED)
|
---|
59 | ################################################################################
|
---|
60 | # DIRECTORIES
|
---|
61 | include_directories(
|
---|
62 | ${PROJECT_BINARY_DIR}
|
---|
63 | ${QT_INCLUDE_DIR}
|
---|
64 | ${PACPUS_INCLUDE_DIR}
|
---|
65 | ${PACPUS_INCLUDE_DIR}/Pacpus/
|
---|
66 | )
|
---|
67 |
|
---|
68 | # ========================================
|
---|
69 | # Link directories
|
---|
70 | # ========================================
|
---|
71 | link_directories(
|
---|
72 | ${PACPUS_LIB_DIR}
|
---|
73 | )
|
---|
74 |
|
---|
75 | ################################################################################
|
---|
76 | # FILES
|
---|
77 | set(PROJECT_HDRS
|
---|
78 | ${EXPORT_HDR}
|
---|
79 | PtGreyCamerasExp.h
|
---|
80 | #../../StdDbtPlayerComponents/ImageBaseStructure.h
|
---|
81 | )
|
---|
82 | set(PROJECT_SRCS
|
---|
83 | ${PLUGIN_CPP}
|
---|
84 | )
|
---|
85 |
|
---|
86 | if(OpenCV_FOUND)
|
---|
87 | list(APPEND OpenCV_LIBS ${OpenCV_LIBRARIES})
|
---|
88 | list(APPEND OpenCV_INCLUDE_DIR ${OpenCV_INCLUDE_DIRS})
|
---|
89 | include_directories(${OpenCV_INCLUDE_DIR})
|
---|
90 | endif(OpenCV_FOUND)
|
---|
91 |
|
---|
92 | if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND )
|
---|
93 | list(APPEND PROJECT_SRCS
|
---|
94 | BumblebeeXB3.cpp
|
---|
95 | BumblebeeXB3.h
|
---|
96 | )
|
---|
97 | endif()
|
---|
98 |
|
---|
99 | if(BUILD_PtGreyCameras AND FlyCapture2_FOUND )
|
---|
100 | list(APPEND PROJECT_SRCS
|
---|
101 | Flea3Component.cpp
|
---|
102 | Flea3Component.h
|
---|
103 | Flea3Grabber.cpp
|
---|
104 | Flea3Grabber.h
|
---|
105 | )
|
---|
106 | endif()
|
---|
107 |
|
---|
108 | set(FILES_TO_MOC
|
---|
109 | ${PLUGIN_HDR}
|
---|
110 | )
|
---|
111 | if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND)
|
---|
112 | list(APPEND
|
---|
113 | FILES_TO_MOC
|
---|
114 | BumblebeeXB3.h
|
---|
115 | )
|
---|
116 | endif()
|
---|
117 |
|
---|
118 | if(BUILD_PtGreyCameras AND FlyCapture2_FOUND)
|
---|
119 | list(APPEND
|
---|
120 | FILES_TO_MOC
|
---|
121 | Flea3Component.h
|
---|
122 | Flea3Grabber.h
|
---|
123 | )
|
---|
124 | endif()
|
---|
125 |
|
---|
126 | set(UI_FILES
|
---|
127 | )
|
---|
128 |
|
---|
129 | ################################################################################
|
---|
130 | # Qt: call moc, uic
|
---|
131 | qt_wrap_cpp(PROJECT_MOC_SRCS
|
---|
132 | ${FILES_TO_MOC}
|
---|
133 | )
|
---|
134 |
|
---|
135 | qt_wrap_ui(PROJECT_UI_SRCS
|
---|
136 | ${UI_FILES}
|
---|
137 | )
|
---|
138 |
|
---|
139 | ################################################################################
|
---|
140 | # BUILD and LINK
|
---|
141 | pacpus_add_library(${PROJECT_NAME} SHARED
|
---|
142 | ${PROJECT_HDRS}
|
---|
143 | ${PROJECT_SRCS}
|
---|
144 | ${PROJECT_MOC_SRCS}
|
---|
145 | ${PROJECT_UI_SRCS}
|
---|
146 | )
|
---|
147 |
|
---|
148 |
|
---|
149 | # ========================================
|
---|
150 | # Libraries
|
---|
151 | # ========================================
|
---|
152 | set(LIBS
|
---|
153 | optimized FileLib debug FileLib_d
|
---|
154 | optimized PacpusLib debug PacpusLib_d
|
---|
155 | optimized PacpusTools debug PacpusTools_d
|
---|
156 | )
|
---|
157 | if (WIN32)
|
---|
158 | list(APPEND LIBS
|
---|
159 | optimized ROAD_TIME debug ROAD_TIME_d
|
---|
160 | )
|
---|
161 | endif()
|
---|
162 | # LINK
|
---|
163 | target_link_libraries(${PROJECT_NAME}
|
---|
164 | ${PACPUS_LIBRARIES}
|
---|
165 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
166 | ${LIBS}
|
---|
167 | ${QT_LIBRARIES}
|
---|
168 | ${OpenCV_LIBS}
|
---|
169 | )
|
---|
170 | qt5_use_modules(${PROJECT_NAME} Network)
|
---|
171 | ################################################################################
|
---|
172 | # FOLDERS
|
---|
173 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
174 | ################################################################################
|
---|
175 | # INSTALL
|
---|
176 | pacpus_install(${PROJECT_NAME})
|
---|