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