Changeset 99 in pacpussensors for trunk/Sick


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/Sick
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Sick/CMakeLists.txt

    r71 r99  
     1#########################quick start############################################
     2#cmake ../ -G "CodeBlocks - Unix Makefiles"
     3#make
     4#make install
     5#make clean
     6################################################################################
    17project(Sick)
    2 
    3 ################################################################################
     8set(${PROJECT_NAME}_VERSION_MAJOR 0)
     9set(${PROJECT_NAME}_VERSION_MINOR 1)
    410add_definitions( -DSICK_EXPORTS )
    511add_definitions( -DSICKLDMRS_EXPORTS )
    612add_definitions( -DSICKLMS_EXPORTS )
     13################################################################################
     14create_export(EXPORT_HDR ${PROJECT_NAME})
     15pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
     16add_definitions (${QT_DEFINITIONS})
    717
    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 find_package(OpenGL REQUIRED)
    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}
     18find_package(Qt5Network REQUIRED)
     19################################################################################
     20# DIRECTORIES
     21include_directories(
     22    ${PROJECT_BINARY_DIR}
     23    ${QT_INCLUDE_DIR}
     24    ${PACPUS_INCLUDE_DIR}
     25    ${PACPUS_INCLUDE_DIR}/Pacpus/
    3226)
    3327
     
    3529# Link directories
    3630# ========================================
    37 link_directories( ${PACPUS_LIB_DIR}
     31link_directories(
     32        ${PACPUS_LIB_DIR}
    3833)
    3934
    4035
    41 pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
    42 
    43 # ========================================
    44 # List of sources
    45 # ========================================
    46 set(
    47     PROJECT_SRCS
    48   SickComponent.h
    49   SickComponent.cpp
    50   AbstractSickSensor.h
    51   AbstractSickSensor.cpp
    52   SickLDMRSSensor.h
    53   SickLDMRSSensor.cpp
    54   SickLMSSensor.h
    55   SickLMSSensor.cpp
    56   SickSocket.h
    57   SickSocket.cpp
     36################################################################################
     37# FILES
     38set(PROJECT_HDRS
     39    ${EXPORT_HDR}
     40    SickComponent.h
     41    AbstractSickSensor.h
     42    SickLDMRSSensor.h
     43    SickLMSSensor.h
     44    SickSocket.h
     45    xml/${PROJECT_NAME}.xml
     46    xml/${PROJECT_NAME}_d.xml
     47)
     48set(PROJECT_SRCS
    5849    ${PLUGIN_CPP}
     50    SickComponent.cpp
     51    AbstractSickSensor.cpp
     52    SickLDMRSSensor.cpp
     53    SickLMSSensor.cpp
     54    SickSocket.cpp
    5955)
    6056
    61 # ========================================
    62 # Files to MOC
    63 # ========================================
    64 set(
    65     FILES_TO_MOC
    66      SickComponent.h
    67      SickLDMRSSensor.h
    68      SickLMSSensor.h
    69      AbstractSickSensor.h
    70      SickSocket.h
    71     ${PLUGIN_H}
     57set(FILES_TO_MOC
     58    ${PLUGIN_HDR}
     59    SickComponent.h
     60    AbstractSickSensor.h
     61    SickLDMRSSensor.h
     62    SickLMSSensor.h
     63    SickSocket.h
    7264)
    7365
    74 set(
    75     UI_FILES
    76 
     66set(UI_FILES
    7767)
    7868
    79 # ========================================
    80 # Call MOC
    81 # ========================================
    82 qt4_wrap_cpp(
    83     PROJECT_MOC_SRCS
     69################################################################################
     70# Qt: call moc, uic
     71qt_wrap_cpp(PROJECT_MOC_SRCS
    8472    ${FILES_TO_MOC}
    8573)
    8674
    87 qt4_wrap_ui(
    88     PROJECT_UI_SRCS
     75qt_wrap_ui(PROJECT_UI_SRCS
    8976    ${UI_FILES}
    9077)
    9178
    92 # ========================================
    93 # Build a library
    94 # ========================================
    95 pacpus_add_library(
    96     ${PROJECT_NAME} SHARED
     79################################################################################
     80# BUILD and LINK
     81pacpus_add_library(${PROJECT_NAME} SHARED
     82    ${PROJECT_HDRS}
    9783    ${PROJECT_SRCS}
    9884    ${PROJECT_MOC_SRCS}
     
    10086)
    10187
    102 message(STATUS  ${PACPUS_DEPENDENCIES_LIB} )
    10388
     89# ========================================
     90# Libraries
     91# ========================================
    10492set(LIBS
    10593    optimized FileLib debug FileLib_d
     
    112100    )
    113101endif()
    114 
    115 # ========================================
    116 # Libraries
    117 # ========================================
    118 # All the platform
    119 target_link_libraries(
    120     ${PROJECT_NAME}
    121     ${PACPUS_LIBRARIES}
    122     ${QT_LIBRARIES}
    123         ${PACPUS_DEPENDENCIES_LIB}
    124         ${OPENGL_LIBRARIES}
    125         ${LIBS}
    126 )
    127 
     102# LINK
     103target_link_libraries(${PROJECT_NAME}
     104                      ${PACPUS_LIBRARIES}
     105                      ${PACPUS_DEPENDENCIES_LIB}
     106                      ${LIBS}
     107                      ${QT_LIBRARIES}
     108                     )
     109qt5_use_modules(${PROJECT_NAME} Network)
     110################################################################################
     111# FOLDERS
    128112pacpus_folder(${PROJECT_NAME} "components")
    129 
    130 # ========================================
    131 # Install
    132 # ========================================
    133 pacpus_install(${PROJECT_NAME})
     113################################################################################
     114# INSTALL
     115pacpus_install(${PROJECT_NAME})
  • trunk/Sick/SickSocket.cpp

    r72 r99  
    9797  mutex.lock();
    9898  QTextStream os(socket);
    99   os << data.toAscii() << endl;
     99  os << data.toLatin1() << endl;//change in qt5
    100100  mutex.unlock();
    101   qDebug() << "data sent to server: " << data.toAscii() ; //a adapter aussi
     101  qDebug() << "data sent to server: " << data.toLatin1() ; //a adapter aussi
    102102}
    103103
Note: See TracChangeset for help on using the changeset viewer.