project(PtGreyCameras) ################################################################################ add_definitions(-DPTGREYCAMERAS_EXPORTS) # ======================================== # Configure qt4 # ======================================== if(QT4_FOUND) set(QT_USE_QTXML true) set(QT_USE_QTNETWORK true) include(${QT_USE_FILE}) else() message(ERROR "Qt4 needed") endif() # ======================================== # Find dependencies # ======================================== find_package(OpenCV REQUIRED) if(OpenCV_FOUND) list(APPEND OpenCV_LIBS ${OpenCV_LIBRARIES}) list(APPEND OpenCV_INCLUDE_DIR ${OpenCV_INCLUDE_DIRS}) include_directories(${OpenCV_INCLUDE_DIR}) endif(OpenCV_FOUND) # ======================================== # Compiler definitions # ======================================== add_definitions( ${QT_DEFINITIONS} ) # ======================================== # Options # ======================================== option(BUILD_PtGreyCameras "Whether or not build the PointGrey cameras" OFF) if (BUILD_PtGreyCameras) option(BUILD_BumbleBeeXB3 "Whether or not build the BumbleBeeXB3" OFF) option(BUILD_FlyCapture2 "Whether or not build the FlyCapture2 based cameras" OFF) # ======================================== # Find dependencies # ======================================== if(BUILD_BumbleBeeXB3) find_package(BumblebeeXB3 REQUIRED) if(BumbleBeeXB3_FOUND) list(APPEND OPT_LIBRARIES ${BumbleBeeXB3_LIBRARIES}) list(APPEND DBG_LIBRARIES ${BumbleBeeXB3_LIBRARIES}) list(APPEND OPT_INCLUDE_DIRS ${BumbleBeeXB3_INCLUDE_DIRS}) include_directories(${BumbleBeeXB3_INCLUDE_DIRS}) endif(BumbleBeeXB3_FOUND) endif() # ======================================== # Find dependencies # ======================================== if(BUILD_FlyCapture2) find_package(FlyCapture2 REQUIRED) if(FlyCapture2_FOUND) list(APPEND OPT_LIBRARIES ${FlyCapture2_LIBRARIES_OPT}) list(APPEND DBG_LIBRARIES ${FlyCapture2_LIBRARIES_OPT}) list(APPEND OPT_INCLUDE_DIRS ${FlyCapture2_INCLUDE_DIRS}) include_directories(${FlyCapture2_INCLUDE_DIRS}) endif(FlyCapture2_FOUND) endif() endif() # ======================================== # Include directories # ======================================== include_directories( ${PACPUS_INCLUDE_HINT} ${QT_INCLUDE_DIR} ${OPT_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIR} ) # ======================================== # Link directories # ======================================== link_directories( ${PACPUS_LIBRARY_HINT} ) message("Creating source files for the plugin(s)") message(STATUS PLUGIN_H=${PLUGIN_H}) message(STATUS PLUGIN_CPP=${PLUGIN_CPP}) pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} ) # ======================================== # List of sources # ======================================== set( PROJECT_SRCS PtGreyCamerasExp.h #../../StdDbtPlayerComponents/ImageBaseStructure.h ${PLUGIN_CPP} ) if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND ) list(APPEND PROJECT_SRCS BumblebeeXB3.cpp BumblebeeXB3.h ) endif() if(BUILD_PtGreyCameras AND FlyCapture2_FOUND ) list(APPEND PROJECT_SRCS Flea3Component.cpp Flea3Component.h Flea3Grabber.cpp Flea3Grabber.h ) endif() # ======================================== # Files to MOC # ======================================== set( FILES_TO_MOC ${PLUGIN_H} ) if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND) list(APPEND FILES_TO_MOC BumblebeeXB3.h ) endif() if(BUILD_PtGreyCameras AND FlyCapture2_FOUND) list(APPEND FILES_TO_MOC Flea3Component.h #Flea3Grabber.h ) endif() set( UI_FILES # WidgetIMU.ui ) # ======================================== # Directories architecture # ======================================== #SOURCE_GROUP(PtGreyCameras FILES ${PROJECT_SRCS} ) SOURCE_GROUP(moc FILES ${PROJECT_MOC_SRCS}) # ======================================== # Call MOC # ======================================== qt4_wrap_cpp( PROJECT_MOC_SRCS ${FILES_TO_MOC} ) qt4_wrap_ui( PROJECT_UI_SRCS ${UI_FILES} ) # ======================================== # Build a library # ======================================== pacpus_add_library( ${PROJECT_NAME} SHARED ${PROJECT_SRCS} ${PROJECT_MOC_SRCS} ${PROJECT_UI_SRCS} ) # ======================================== # Libraries # ======================================== # All the platform message ( "\${VAR} = ${OPT_LIBRARIES}") target_link_libraries( ${PROJECT_NAME} ${PACPUS_LIBRARIES} ${QT_LIBRARIES} optimized ${OPT_LIBRARIES} debug ${DBG_LIBRARIES} ${PACPUS_DEPENDENCIES_LIB} ${OpenCV_LIBS} ${BumbleBeeXB3_PGR_LIBRARIES} ${BumbleBeeXB3_TRICLOPS_LIBRARIES} ) # ======================================== # Install # ======================================== pacpus_install(${PROJECT_NAME})