source: pacpussensors/trunk/PtGreyCameras/CMakeLists.txt@ 87

Last change on this file since 87 was 64, checked in by phudelai, 10 years ago

Programme détection d'obstacles amélioré

File size: 4.9 KB
RevLine 
[48]1project(PtGreyCameras)
2################################################################################
3add_definitions(-DPTGREYCAMERAS_EXPORTS)
4
5# ========================================
6# Configure qt4
7# ========================================
8if(QT4_FOUND)
9 set(QT_USE_QTXML true)
10 set(QT_USE_QTNETWORK true)
11 include(${QT_USE_FILE})
12else()
13 message(ERROR "Qt4 needed")
14endif()
15
16# ========================================
17# Find dependencies
18# ========================================
19find_package(OpenCV REQUIRED)
20if(OpenCV_FOUND)
21 list(APPEND OpenCV_LIBS ${OpenCV_LIBRARIES})
22 list(APPEND OpenCV_INCLUDE_DIR ${OpenCV_INCLUDE_DIRS})
23 include_directories(${OpenCV_INCLUDE_DIR})
24endif(OpenCV_FOUND)
25
26
27# ========================================
28# Compiler definitions
29# ========================================
30add_definitions(
31 ${QT_DEFINITIONS}
32)
33# ========================================
34# Options
35# ========================================
36option(BUILD_PtGreyCameras "Whether or not build the PointGrey cameras" OFF)
37if (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()
64endif()
65
66# ========================================
67# Include directories
68# ========================================
69include_directories(
70 ${PACPUS_INCLUDE_HINT}
71 ${QT_INCLUDE_DIR}
72 ${OPT_INCLUDE_DIRS}
73 ${OpenCV_INCLUDE_DIR}
74)
75
76# ========================================
77# Link directories
78# ========================================
79link_directories(
80 ${PACPUS_LIBRARY_HINT}
81)
82
83message("Creating source files for the plugin(s)")
84message(STATUS PLUGIN_H=${PLUGIN_H})
85message(STATUS PLUGIN_CPP=${PLUGIN_CPP})
86
87pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
88
89# ========================================
90# List of sources
91# ========================================
92set(
93 PROJECT_SRCS
94 PtGreyCamerasExp.h
95 #../../StdDbtPlayerComponents/ImageBaseStructure.h
96 ${PLUGIN_CPP}
97)
98if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND )
99 list(APPEND PROJECT_SRCS
100 BumblebeeXB3.cpp
101 BumblebeeXB3.h
102 )
103endif()
104
105if(BUILD_PtGreyCameras AND FlyCapture2_FOUND )
106 list(APPEND PROJECT_SRCS
107 Flea3Component.cpp
108 Flea3Component.h
[51]109 Flea3Grabber.cpp
110 Flea3Grabber.h
[48]111 )
112endif()
113
114# ========================================
115# Files to MOC
116# ========================================
117set(
118 FILES_TO_MOC
119 ${PLUGIN_H}
120)
121if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND)
122 list(APPEND
123 FILES_TO_MOC
124 BumblebeeXB3.h
125 )
126endif()
127
128if(BUILD_PtGreyCameras AND FlyCapture2_FOUND)
129 list(APPEND
130 FILES_TO_MOC
131 Flea3Component.h
[64]132 Flea3Grabber.h
[48]133 )
134endif()
135
136set(
137 UI_FILES
138# WidgetIMU.ui
139
140)
141
142# ========================================
143# Directories architecture
144# ========================================
145#SOURCE_GROUP(PtGreyCameras FILES ${PROJECT_SRCS} )
146SOURCE_GROUP(moc FILES ${PROJECT_MOC_SRCS})
147
148# ========================================
149# Call MOC
150# ========================================
151qt4_wrap_cpp(
152 PROJECT_MOC_SRCS
153 ${FILES_TO_MOC}
154)
155
156qt4_wrap_ui(
157 PROJECT_UI_SRCS
158 ${UI_FILES}
159)
160
161# ========================================
162# Build a library
163# ========================================
164pacpus_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
174message ( "\${VAR} = ${OPT_LIBRARIES}")
175target_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# ========================================
189pacpus_install(${PROJECT_NAME})
Note: See TracBrowser for help on using the repository browser.