Changeset 99 in pacpussensors for trunk/Gps/CMakeLists.txt


Ignore:
Timestamp:
10/15/15 14:47:01 (9 years ago)
Author:
nguyenhu
Message:

compilation under linux with 0.2.X framework

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Gps/CMakeLists.txt

    r59 r99  
     1#########################quick start############################################
     2#cmake ../ -G "CodeBlocks - Unix Makefiles"
     3#make
     4#make install
     5#make clean
     6################################################################################
    17project(Gps)
     8set(${PROJECT_NAME}_VERSION_MAJOR 0)
     9set(${PROJECT_NAME}_VERSION_MINOR 1)
     10add_definitions( -DGPS_EXPORTS )
    211################################################################################
     12create_export(EXPORT_HDR ${PROJECT_NAME})
     13pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
     14add_definitions (${QT_DEFINITIONS})
    315
    4 add_definitions( -DGPS_EXPORTS )
    5 
    6 # ========================================
    7 # Configure qt4
    8 # ========================================
    9 if(QT4_FOUND)
    10   set(QT_USE_QTXML true)
    11   set(QT_USE_QTNETWORK true)
    12   include(${QT_USE_FILE})
    13 else()
    14   message(ERROR "Qt4 needed")
    15 endif()
    16 
    17 # ========================================
    18 # Compiler definitions
    19 # ========================================
    20 add_definitions(
    21   ${QT_DEFINITIONS}
    22 )
    23 
    24 # ========================================
    25 # Include directories
    26 # ========================================
    27 include_directories(
    28   ${PROJECT_BINARY_DIR}
    29   ${QT_INCLUDE_DIR}
     16find_package(Qt5Network REQUIRED)
     17find_package(Qt5Widgets REQUIRED)
     18################################################################################
     19# DIRECTORIES
     20include_directories(
     21    ${PROJECT_BINARY_DIR}
     22    ${QT_INCLUDE_DIR}
     23    ${PACPUS_INCLUDE_DIR}
     24    ${PACPUS_INCLUDE_DIR}/Pacpus/
    3025)
    3126
     
    3833
    3934
    40 pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
    41 
    42 # ========================================
    43 # List of sources
    44 # ========================================
    45 set(
    46     PROJECT_SRCS
    47   gpsComponent.cpp
    48   gpsComponent.h
    49   GpsFrames.h
    50 #  SeptentrioSocket.h
    51 #  SeptentrioSocket.cpp
    52 #  SeptentrioComponent.h
    53 #  SeptentrioComponent.cpp
    54   #UbloxComponent.h
    55   #UbloxComponent.cpp
    56   #polarxGPSTKsolver.cpp
    57 #  ui/polarxmainwindow.hpp
    58 #  ui/polarxmainwindow.cpp
     35################################################################################
     36# FILES
     37set(PROJECT_HDRS
     38    ${EXPORT_HDR}
     39    gpsComponent.h
     40    GpsFrames.h
     41    SeptentrioSocket.h
     42    SbfFrames.h
     43    structure_gps.h
     44    xml/gps_nmea.xml
     45)
     46set(PROJECT_SRCS
    5947    ${PLUGIN_CPP}
     48    gpsComponent.cpp
     49    SeptentrioSocket.cpp
     50    ui/polarxmainwindow.cpp
    6051)
    6152
     
    7667endif(UNIX)
    7768
    78 
    79 # ========================================
    80 # Files to MOC
    81 # ========================================
    82 
    8369if(UNIX)
    8470set(FILES_TO_MOC
    8571  # add here the header files that you want to MOC
    8672  gpsComponent.h
    87   SeptentrioComponent.h
     73  GpsFrames.h
     74  #SeptentrioComponent.h
    8875  SeptentrioSocket.h 
    8976  ../driver/PosixSerialPort.h
    9077  ui/polarxmainwindow.hpp
    91     ${PLUGIN_H}
     78  ${PLUGIN_HDR}
    9279  )
    9380endif(UNIX)
     
    9784  # add here the header files that you want to MOC
    9885  gpsComponent.h
    99 # SeptentrioComponent.h
    100 # SeptentrioSocket.h   
     86  # SeptentrioComponent.h
     87  # SeptentrioSocket.h   
    10188  ../driver/Win32SerialPort.h
    102 #  ui/polarxmainwindow.hpp
    103   ${PLUGIN_H}
     89  #  ui/polarxmainwindow.hpp
     90  ${PLUGIN_HDR}
    10491  )
    10592endif(WIN32)
    10693
    107 set(
    108     UI_FILES
     94set(UI_FILES
    10995)
    11096
    111 # ========================================
    112 # Call MOC
    113 # ========================================
    114 qt4_wrap_cpp(
    115     PROJECT_MOC_SRCS
     97################################################################################
     98# Qt: call moc, uic
     99qt_wrap_cpp(PROJECT_MOC_SRCS
    116100    ${FILES_TO_MOC}
    117101)
    118102
    119 qt4_wrap_ui(
    120     PROJECT_UI_SRCS
     103qt_wrap_ui(PROJECT_UI_SRCS
    121104    ${UI_FILES}
    122105)
    123106
    124 # ========================================
    125 # Build a library
    126 # ========================================
    127 pacpus_add_library(
    128     ${PROJECT_NAME} SHARED
     107################################################################################
     108# BUILD and LINK
     109pacpus_add_library(${PROJECT_NAME} SHARED
     110    ${PROJECT_HDRS}
    129111    ${PROJECT_SRCS}
    130112    ${PROJECT_MOC_SRCS}
     
    132114)
    133115
     116
    134117# ========================================
    135118# Libraries
    136119# ========================================
    137 if(WIN32)
    138     set(LIBS
    139         # add your specific libraries to link here
    140         optimized NMEA0183LIB debug NMEA0183LIB_d
     120set(LIBS
     121    optimized FileLib debug FileLib_d
     122    optimized PacpusLib debug PacpusLib_d
     123    optimized PacpusTools debug PacpusTools_d
     124    optimized NMEA0183LIB debug NMEA0183LIB_d
     125)
     126if (WIN32)
     127    list(APPEND LIBS
     128        optimized ROAD_TIME debug ROAD_TIME_d
    141129    )
    142 endif(WIN32)
    143 
    144 if(UNIX)
    145     set(LIBS
    146         # add your specific libraries to link here
    147 
    148     )
    149 endif(UNIX)
    150 
    151 # All the platform
    152 target_link_libraries(
    153     ${PROJECT_NAME}
    154     ${PACPUS_LIBRARIES}
    155     ${QT_LIBRARIES}
    156         ${PACPUS_DEPENDENCIES_LIB}
    157         ${LIBS}
    158 #       optimized PacpusTools debug PacpusTools_d
    159 )
     130endif()
     131# LINK
     132target_link_libraries(${PROJECT_NAME}
     133                      ${PACPUS_LIBRARIES}
     134                      ${PACPUS_DEPENDENCIES_LIB}
     135                      ${LIBS}
     136                      ${QT_LIBRARIES} 
     137                     )
     138qt5_use_modules(${PROJECT_NAME} Network)
     139################################################################################
     140# FOLDERS
    160141pacpus_folder(${PROJECT_NAME} "components")
    161 
    162 # ========================================
    163 # Install
    164 # ========================================
    165 pacpus_install(${PROJECT_NAME})
     142################################################################################
     143# INSTALL
     144pacpus_install(${PROJECT_NAME})
Note: See TracChangeset for help on using the changeset viewer.