source: pacpussensors/trunk/Flea3/CMakeLists.txt@ 46

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

Flea 3 plugin added

File size: 4.8 KB
Line 
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
109 )
110endif()
111
112# ========================================
113# Files to MOC
114# ========================================
115set(
116 FILES_TO_MOC
117 ${PLUGIN_H}
118)
119if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND)
120 list(APPEND
121 FILES_TO_MOC
122 BumblebeeXB3.h
123 )
124endif()
125
126if(BUILD_PtGreyCameras AND FlyCapture2_FOUND)
127 list(APPEND
128 FILES_TO_MOC
129 Flea3Component.h
130 )
131endif()
132
133set(
134 UI_FILES
135# WidgetIMU.ui
136
137)
138
139# ========================================
140# Directories architecture
141# ========================================
142#SOURCE_GROUP(PtGreyCameras FILES ${PROJECT_SRCS} )
143SOURCE_GROUP(moc FILES ${PROJECT_MOC_SRCS})
144
145# ========================================
146# Call MOC
147# ========================================
148qt4_wrap_cpp(
149 PROJECT_MOC_SRCS
150 ${FILES_TO_MOC}
151)
152
153qt4_wrap_ui(
154 PROJECT_UI_SRCS
155 ${UI_FILES}
156)
157
158# ========================================
159# Build a library
160# ========================================
161pacpus_add_library(
162 ${PROJECT_NAME} SHARED
163 ${PROJECT_SRCS}
164 ${PROJECT_MOC_SRCS}
165 ${PROJECT_UI_SRCS}
166)
167# ========================================
168# Libraries
169# ========================================
170# All the platform
171message ( "\${VAR} = ${OPT_LIBRARIES}")
172target_link_libraries(
173 ${PROJECT_NAME}
174 ${PACPUS_LIBRARIES}
175 ${QT_LIBRARIES}
176 optimized ${OPT_LIBRARIES} debug ${DBG_LIBRARIES}
177 ${PACPUS_DEPENDENCIES_LIB}
178 ${OpenCV_LIBS}
179 ${BumbleBeeXB3_PGR_LIBRARIES}
180 ${BumbleBeeXB3_TRICLOPS_LIBRARIES}
181
182)
183
184# ========================================
185# Install
186# ========================================
187pacpus_install(${PROJECT_NAME})
Note: See TracBrowser for help on using the repository browser.