Changeset 99 in pacpussensors for trunk/SpanCPTComponent


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/SpanCPTComponent
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SpanCPTComponent/CMakeLists.txt

    r59 r99  
     1#########################quick start############################################
     2#cmake ../ -G "CodeBlocks - Unix Makefiles"
     3#make
     4#make install
     5#make clean
     6################################################################################
    17project(SpanCPTComponent)
    28
     
    410add_definitions( -DCPTCOMPONENT_EXPORTS )
    511add_definitions( -DPLUGINLIB_EXPORTS )
     12################################################################################
     13create_export(EXPORT_HDR ${PROJECT_NAME})
     14pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
     15add_definitions (${QT_DEFINITIONS})
    616
    7 
    8 # ========================================
    9 # Configure qt4
    10 # ========================================
    11 if(QT4_FOUND)
    12   set(QT_USE_QTXML true)
    13   set(QT_USE_QTNETWORK true)
    14   include(${QT_USE_FILE})
    15 else()
    16   message(ERROR "Qt4 needed")
    17 endif()
    18 
    19 # ========================================
    20 # Compiler definitions
    21 # ========================================
    22 add_definitions(
    23   ${QT_DEFINITIONS}
    24 )
    25 
    26 # ========================================
    27 # Include directories
    28 # ========================================
    29 include_directories(
    30   ${PROJECT_BINARY_DIR}
    31   ${QT_INCLUDE_DIR}
     17find_package(Qt5Network REQUIRED)
     18################################################################################
     19# DIRECTORIES
     20include_directories(
     21    ${PROJECT_BINARY_DIR}
     22    ${QT_INCLUDE_DIR}
     23    ${PACPUS_INCLUDE_DIR}
     24    ${PACPUS_INCLUDE_DIR}/Pacpus/
    3225)
    3326
     
    4033
    4134
    42 pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
    43 
    44 # ========================================
    45 # List of sources
    46 # ========================================
    47 set(
    48     PROJECT_SRCS
    49         CPTComponent.h
    50         CPTComponent.cpp
     35################################################################################
     36# FILES
     37set(PROJECT_HDRS
     38    ${EXPORT_HDR}
     39    CPTComponent.h 
    5140    ../driver/AbstractSerialPort.h
    52     ../driver/AbstractSerialPort.cpp
     41    xml/spancpt.xml
     42)
     43set(PROJECT_SRCS
    5344    ${PLUGIN_CPP}
     45    CPTComponent.cpp
     46    ../driver/AbstractSerialPort.cpp
    5447)
    5548
     
    7063endif(UNIX)
    7164
    72 
    73 # ========================================
    74 # Files to MOC
    75 # ========================================
    76 
    7765if(UNIX)
    7866set(FILES_TO_MOC
     
    8068  CPTComponent.h
    8169  ../driver/PosixSerialPort.h
    82     ${PLUGIN_H}
     70    ${PLUGIN_HDR}
    8371  )
    8472endif(UNIX)
     
    8977  CPTComponent.h
    9078  ../driver/Win32SerialPort.h
    91     ${PLUGIN_H}
     79    ${PLUGIN_HDR}
    9280  )
    9381endif(WIN32)
    9482
    95 set(
    96     UI_FILES
     83set(UI_FILES
    9784)
    9885
    99 # ========================================
    100 # Call MOC
    101 # ========================================
    102 qt4_wrap_cpp(
    103     PROJECT_MOC_SRCS
     86################################################################################
     87# Qt: call moc, uic
     88qt_wrap_cpp(PROJECT_MOC_SRCS
    10489    ${FILES_TO_MOC}
    10590)
    10691
    107 qt4_wrap_ui(
    108     PROJECT_UI_SRCS
     92qt_wrap_ui(PROJECT_UI_SRCS
    10993    ${UI_FILES}
    11094)
    11195
    112 # ========================================
    113 # Build a library
    114 # ========================================
    115 pacpus_add_library(
    116     ${PROJECT_NAME} SHARED
     96################################################################################
     97# BUILD and LINK
     98pacpus_add_library(${PROJECT_NAME} SHARED
     99    ${PROJECT_HDRS}
    117100    ${PROJECT_SRCS}
    118101    ${PROJECT_MOC_SRCS}
     
    120103)
    121104
     105
    122106# ========================================
    123107# Libraries
    124108# ========================================
    125 if(WIN32)
    126     set(LIBS
    127         # add your specific libraries to link here
    128         optimized NMEA0183LIB debug NMEA0183LIB_d
    129                 optimized PacpusTools debug PacpusTools_d
     109set(LIBS
     110    optimized FileLib debug FileLib_d
     111    optimized PacpusLib debug PacpusLib_d
     112    optimized PacpusTools debug PacpusTools_d
     113    optimized NMEA0183LIB debug NMEA0183LIB_d
     114)
     115if (WIN32)
     116    list(APPEND LIBS
     117        optimized ROAD_TIME debug ROAD_TIME_d
    130118    )
    131 endif(WIN32)
    132 
    133 if(UNIX)
    134     set(LIBS
    135         # add your specific libraries to link here
    136 
    137     )
    138 endif(UNIX)
    139 
    140 # All the platform
    141 target_link_libraries(
    142     ${PROJECT_NAME}
    143     ${PACPUS_LIBRARIES}
    144     ${QT_LIBRARIES}
    145         ${PACPUS_DEPENDENCIES_LIB}
    146         ${LIBS}
    147 #       optimized PacpusTools debug PacpusTools_d
    148 )
     119endif()
     120# LINK
     121target_link_libraries(${PROJECT_NAME}
     122                      ${PACPUS_LIBRARIES}
     123                      ${PACPUS_DEPENDENCIES_LIB}
     124                      ${LIBS}
     125                      ${QT_LIBRARIES}
     126                     )
     127qt5_use_modules(${PROJECT_NAME} Network)
     128################################################################################
     129# FOLDERS
    149130pacpus_folder(${PROJECT_NAME} "components")
    150 
    151 # ========================================
    152 # Install
    153 # ========================================
    154 pacpus_install(${PROJECT_NAME})
    155 
     131################################################################################
     132# INSTALL
     133pacpus_install(${PROJECT_NAME})
  • trunk/SpanCPTComponent/CPTComponent.cpp

    r88 r99  
    183183    memcpy(buffer, currentDataFrame, currentDataFrameLength_);
    184184    buffer[currentDataFrameLength_] = '\0'; // add a \0 to convert for the conversion in QString
    185     currentDataFrame_ = QString::fromAscii(buffer);
     185    currentDataFrame_ = "";
     186    currentDataFrame_.append(buffer);
    186187
    187188        delete[] buffer;
  • trunk/SpanCPTComponent/CPTComponent.h

    r88 r99  
    1717#include <fstream>
    1818#include <qobject.h>
     19#include <QPointF>
    1920#include <string>
    2021
     
    162163                     TimestampedInscovFrame*);
    163164
    164         // component ouputs
    165         void addOutputs();
    166         OutputInterface<QPointF, CPTComponent>* position2DENUOutput_;
     165    // component ouputs
     166    void addOutputs();
     167    OutputInterface<QPointF, CPTComponent>* position2DENUOutput_;
    167168};
    168169
Note: See TracChangeset for help on using the changeset viewer.