[99] | 1 | #########################quick start############################################
|
---|
| 2 | #cmake ../ -G "CodeBlocks - Unix Makefiles"
|
---|
| 3 | #make
|
---|
| 4 | #make install
|
---|
| 5 | #make clean
|
---|
| 6 | ################################################################################
|
---|
| 7 | project(Gps)
|
---|
| 8 | set(${PROJECT_NAME}_VERSION_MAJOR 0)
|
---|
| 9 | set(${PROJECT_NAME}_VERSION_MINOR 1)
|
---|
| 10 | add_definitions( -DGPS_EXPORTS )
|
---|
| 11 | ################################################################################
|
---|
| 12 | create_export(EXPORT_HDR ${PROJECT_NAME})
|
---|
| 13 | pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
|
---|
| 14 | add_definitions (${QT_DEFINITIONS})
|
---|
| 15 |
|
---|
| 16 | find_package(Qt5Network REQUIRED)
|
---|
| 17 | find_package(Qt5Widgets REQUIRED)
|
---|
| 18 | ################################################################################
|
---|
| 19 | # DIRECTORIES
|
---|
| 20 | include_directories(
|
---|
| 21 | ${PROJECT_BINARY_DIR}
|
---|
| 22 | ${QT_INCLUDE_DIR}
|
---|
| 23 | ${PACPUS_INCLUDE_DIR}
|
---|
| 24 | ${PACPUS_INCLUDE_DIR}/Pacpus/
|
---|
| 25 | )
|
---|
| 26 |
|
---|
| 27 | # ========================================
|
---|
| 28 | # Link directories
|
---|
| 29 | # ========================================
|
---|
| 30 | link_directories(
|
---|
| 31 | ${PACPUS_LIB_DIR}
|
---|
| 32 | )
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 | ################################################################################
|
---|
| 36 | # FILES
|
---|
| 37 | set(PROJECT_HDRS
|
---|
| 38 | ${EXPORT_HDR}
|
---|
| 39 | gpsComponent.h
|
---|
| 40 | GpsFrames.h
|
---|
| 41 | SeptentrioSocket.h
|
---|
| 42 | SbfFrames.h
|
---|
| 43 | structure_gps.h
|
---|
[100] | 44 | gps_nmea.xml
|
---|
[99] | 45 | )
|
---|
| 46 | set(PROJECT_SRCS
|
---|
| 47 | ${PLUGIN_CPP}
|
---|
| 48 | gpsComponent.cpp
|
---|
| 49 | SeptentrioSocket.cpp
|
---|
| 50 | ui/polarxmainwindow.cpp
|
---|
| 51 | )
|
---|
| 52 |
|
---|
| 53 | if(WIN32)
|
---|
| 54 | set(PROJECT_SRCS
|
---|
| 55 | ${PROJECT_SRCS}
|
---|
| 56 | ../driver/Win32SerialPort.cpp
|
---|
| 57 | ../driver/Win32SerialPort.h
|
---|
| 58 | )
|
---|
| 59 | endif(WIN32)
|
---|
| 60 |
|
---|
| 61 | if(UNIX)
|
---|
| 62 | set(PROJECT_SRCS
|
---|
| 63 | ${PROJECT_SRCS}
|
---|
| 64 | ../driver/PosixSerialPort.cpp
|
---|
| 65 | ../driver/PosixSerialPort.h
|
---|
| 66 | )
|
---|
| 67 | endif(UNIX)
|
---|
| 68 |
|
---|
| 69 | if(UNIX)
|
---|
| 70 | set(FILES_TO_MOC
|
---|
| 71 | # add here the header files that you want to MOC
|
---|
| 72 | gpsComponent.h
|
---|
| 73 | GpsFrames.h
|
---|
| 74 | #SeptentrioComponent.h
|
---|
| 75 | SeptentrioSocket.h
|
---|
| 76 | ../driver/PosixSerialPort.h
|
---|
| 77 | ui/polarxmainwindow.hpp
|
---|
| 78 | ${PLUGIN_HDR}
|
---|
| 79 | )
|
---|
| 80 | endif(UNIX)
|
---|
| 81 |
|
---|
| 82 | if(WIN32)
|
---|
| 83 | set(FILES_TO_MOC
|
---|
| 84 | # add here the header files that you want to MOC
|
---|
| 85 | gpsComponent.h
|
---|
| 86 | # SeptentrioComponent.h
|
---|
| 87 | # SeptentrioSocket.h
|
---|
| 88 | ../driver/Win32SerialPort.h
|
---|
| 89 | # ui/polarxmainwindow.hpp
|
---|
| 90 | ${PLUGIN_HDR}
|
---|
| 91 | )
|
---|
| 92 | endif(WIN32)
|
---|
| 93 |
|
---|
| 94 | set(UI_FILES
|
---|
| 95 | )
|
---|
| 96 |
|
---|
| 97 | ################################################################################
|
---|
| 98 | # Qt: call moc, uic
|
---|
| 99 | qt_wrap_cpp(PROJECT_MOC_SRCS
|
---|
| 100 | ${FILES_TO_MOC}
|
---|
| 101 | )
|
---|
| 102 |
|
---|
| 103 | qt_wrap_ui(PROJECT_UI_SRCS
|
---|
| 104 | ${UI_FILES}
|
---|
| 105 | )
|
---|
| 106 |
|
---|
| 107 | ################################################################################
|
---|
| 108 | # BUILD and LINK
|
---|
| 109 | pacpus_add_library(${PROJECT_NAME} SHARED
|
---|
| 110 | ${PROJECT_HDRS}
|
---|
| 111 | ${PROJECT_SRCS}
|
---|
| 112 | ${PROJECT_MOC_SRCS}
|
---|
| 113 | ${PROJECT_UI_SRCS}
|
---|
| 114 | )
|
---|
| 115 |
|
---|
| 116 |
|
---|
| 117 | # ========================================
|
---|
| 118 | # Libraries
|
---|
| 119 | # ========================================
|
---|
| 120 | set(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 | )
|
---|
| 126 | if (WIN32)
|
---|
| 127 | list(APPEND LIBS
|
---|
| 128 | optimized ROAD_TIME debug ROAD_TIME_d
|
---|
| 129 | )
|
---|
| 130 | endif()
|
---|
| 131 | # LINK
|
---|
| 132 | target_link_libraries(${PROJECT_NAME}
|
---|
| 133 | ${PACPUS_LIBRARIES}
|
---|
| 134 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
| 135 | ${LIBS}
|
---|
| 136 | ${QT_LIBRARIES}
|
---|
| 137 | )
|
---|
| 138 | qt5_use_modules(${PROJECT_NAME} Network)
|
---|
| 139 | ################################################################################
|
---|
| 140 | # FOLDERS
|
---|
| 141 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
| 142 | ################################################################################
|
---|
| 143 | # INSTALL
|
---|
| 144 | pacpus_install(${PROJECT_NAME})
|
---|