Changeset 99 in pacpussensors for trunk/PtGreyCameras


Ignore:
Timestamp:
Oct 15, 2015, 2:47:01 PM (9 years ago)
Author:
nguyenhu
Message:

compilation under linux with 0.2.X framework

Location:
trunk/PtGreyCameras
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/PtGreyCameras/CMakeLists.txt

    r64 r99  
     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################################################################################
    18project(PtGreyCameras)
     9set(${PROJECT_NAME}_VERSION_MAJOR 0)
     10set(${PROJECT_NAME}_VERSION_MINOR 1)
     11# Create a DLL
     12add_definitions(-DCVWEBCAM_COMPONENT_EXPORTS)
     13add_definitions( -DVIDEO_EXPORTS )
     14
     15#include(FindOpenCV.cmake)
     16find_package(OpenCV REQUIRED)
     17
     18# Check for OpenCV
     19if(NOT OpenCV_FOUND)
     20    message(FATAL_ERROR "Project ${PROJECT_NAME} requires OpenCV library")
     21endif()
    222################################################################################
    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 )
     23create_export(EXPORT_HDR ${PROJECT_NAME})
     24pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
     25add_definitions (${QT_DEFINITIONS})
    3326# ========================================
    3427# Options
     
    6356        endif()
    6457endif()
    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} 
     58find_package(Qt5Network REQUIRED)
     59################################################################################
     60# DIRECTORIES
     61include_directories(
     62    ${PROJECT_BINARY_DIR}
     63    ${QT_INCLUDE_DIR}
     64    ${PACPUS_INCLUDE_DIR}
     65    ${PACPUS_INCLUDE_DIR}/Pacpus/
    7466)
    7567
     
    7769# Link directories
    7870# ========================================
    79 link_directories(
    80   ${PACPUS_LIBRARY_HINT}
     71link_directories( 
     72        ${PACPUS_LIB_DIR}
    8173)
    8274
    83 message("Creating source files for the plugin(s)")
    84 message(STATUS PLUGIN_H=${PLUGIN_H})
    85 message(STATUS PLUGIN_CPP=${PLUGIN_CPP})
     75################################################################################
     76# FILES
     77set(PROJECT_HDRS
     78    ${EXPORT_HDR}
     79    PtGreyCamerasExp.h
     80    #../../StdDbtPlayerComponents/ImageBaseStructure.h
     81)
     82set(PROJECT_SRCS
     83    ${PLUGIN_CPP}
     84)
    8685
    87 pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
     86if(OpenCV_FOUND)
     87    list(APPEND OpenCV_LIBS ${OpenCV_LIBRARIES})
     88    list(APPEND OpenCV_INCLUDE_DIR ${OpenCV_INCLUDE_DIRS})
     89    include_directories(${OpenCV_INCLUDE_DIR})
     90endif(OpenCV_FOUND)
    8891
    89 # ========================================
    90 # List of sources
    91 # ========================================
    92 set(
    93         PROJECT_SRCS
    94         PtGreyCamerasExp.h
    95         #../../StdDbtPlayerComponents/ImageBaseStructure.h
    96         ${PLUGIN_CPP}
    97 )
    9892if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND )
    9993        list(APPEND PROJECT_SRCS
     
    112106endif()
    113107
    114 # ========================================
    115 # Files to MOC
    116 # ========================================
    117 set(
    118         FILES_TO_MOC
    119         ${PLUGIN_H}
     108set(FILES_TO_MOC
     109    ${PLUGIN_HDR}
    120110)
    121111if(BUILD_PtGreyCameras AND BumbleBeeXB3_FOUND)
     
    134124endif()
    135125
    136 set(
    137     UI_FILES
    138 #    WidgetIMU.ui
    139 
     126set(UI_FILES
    140127)
    141128
    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
     129################################################################################
     130# Qt: call moc, uic
     131qt_wrap_cpp(PROJECT_MOC_SRCS
    153132    ${FILES_TO_MOC}
    154133)
    155134
    156 qt4_wrap_ui(
    157     PROJECT_UI_SRCS
     135qt_wrap_ui(PROJECT_UI_SRCS
    158136    ${UI_FILES}
    159137)
    160138
    161 # ========================================
    162 # Build a library
    163 # ========================================
    164 pacpus_add_library(
    165     ${PROJECT_NAME} SHARED
     139################################################################################
     140# BUILD and LINK
     141pacpus_add_library(${PROJECT_NAME} SHARED
     142    ${PROJECT_HDRS}
    166143    ${PROJECT_SRCS}
    167144    ${PROJECT_MOC_SRCS}
    168145    ${PROJECT_UI_SRCS}
    169146)
     147
     148
    170149# ========================================
    171150# Libraries
    172151# ========================================
    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}     
     152set(LIBS
     153    optimized FileLib debug FileLib_d
     154    optimized PacpusLib debug PacpusLib_d
     155    optimized PacpusTools debug PacpusTools_d
    184156)
    185 
    186 # ========================================
    187 # Install
    188 # ========================================
    189 pacpus_install(${PROJECT_NAME})
     157if (WIN32)
     158    list(APPEND LIBS
     159        optimized ROAD_TIME debug ROAD_TIME_d
     160    )
     161endif()
     162# LINK
     163target_link_libraries(${PROJECT_NAME}
     164                      ${PACPUS_LIBRARIES}
     165                      ${PACPUS_DEPENDENCIES_LIB}
     166                      ${LIBS}
     167                      ${QT_LIBRARIES}
     168                      ${OpenCV_LIBS}
     169                     )
     170qt5_use_modules(${PROJECT_NAME} Network)
     171################################################################################
     172# FOLDERS
     173pacpus_folder(${PROJECT_NAME} "components")
     174################################################################################
     175# INSTALL
     176pacpus_install(${PROJECT_NAME})
  • trunk/PtGreyCameras/Flea3Grabber.h

    r64 r99  
    55//  author:     Danilo Alves de Lima
    66//              Copyright Heudiasyc UMR UTC/CNRS 6599
    7 // 
     7//
    88//  version:    $Id: $
    99//
    10 //  purpose:   
     10//  purpose:
    1111*********************************************************************/
    1212
     
    3131#include <string>
    3232#include <vector>
    33 #include "../../../Pacpussensors/trunk/StdDbtPlayerComponents/ImageBaseStructure.h"
     33#include "../StdDbtPlayerComponents/ImageBaseStructure.h"
    3434
    3535namespace pacpus {
     
    5858        unsigned int cam_trigger_mode;          // Trigger mode
    5959        unsigned int cam_trigger_enable;        // Trigger enable (1 on // 0 off)
    60         unsigned int cam_trigger_parameter;     
     60        unsigned int cam_trigger_parameter;
    6161        unsigned int cam_trigger_polarity;      // Trigger polarity (0 low // 1 high)
    6262        unsigned int cam_trigger_source;        // Source (GPIO)
     
    8585        //----------------------------------------------------------------------------------------------------------------
    8686        bool showdebug;                                         // Show frame acquired
    87                
    88         int mMaxImageOutputSize;                        // Size of the input image data in the memory   
    89        
     87
     88        int mMaxImageOutputSize;                        // Size of the input image data in the memory
     89
    9090        // Output directory
    9191        QDir mOutputDirectory;
     
    9898
    9999/** Class to provide the obstacle detection from a disparity map data */
    100 class PTGREYCAMERAS_API Flea3Grabber:   public QThread, 
     100class PTGREYCAMERAS_API Flea3Grabber:   public QThread,
    101101                                                                                public ComponentBase
    102102{
     
    114114        //==============================================================================================
    115115
    116         /** 
     116        /**
    117117        * Initialize default values
    118118        */
    119119        void InitDefault(int indice);
    120120
    121         int img2send_; 
     121        int img2send_;
    122122
    123123protected:
  • trunk/PtGreyCameras/PtGreyCamerasPlugin.cpp

    r48 r99  
    1 // Autogenerated file by PacpusPlugin.cmake
     1// Autogenerated file by PacpusUtilities.cmake
    22// DO NOT EDIT!!! ALL CHANGES WOULD BE REMOVED BY THE NEXT CALL OF CMAKE
    33
     
    1717}
    1818
    19 Q_EXPORT_PLUGIN2(PtGreyCamerasPlugin, PtGreyCamerasPlugin)
     19//Qt4 Plugin Macro desactivated
     20//Q_EXPORT_PLUGIN2(PtGreyCamerasPlugin, PtGreyCamerasPlugin)
  • trunk/PtGreyCameras/PtGreyCamerasPlugin.h

    r48 r99  
    1 // Autogenerated file by PacpusPlugin.cmake
     1// Autogenerated file by PacpusUtilities.cmake
    22// DO NOT EDIT!!! ALL CHANGES WOULD BE REMOVED BY THE NEXT CALL OF CMAKE
    33
     
    1616{
    1717    Q_OBJECT
     18    //Qt5 Plugins Macro
     19    Q_PLUGIN_METADATA(IID "pacpus.PtGreyCamerasPlugin" FILE "PtGreyCamerasPlugin.json")
    1820    Q_INTERFACES(PacpusPluginInterface)
    1921
Note: See TracChangeset for help on using the changeset viewer.