[1] | 1 | project(CanGateway)
|
---|
| 2 | ################################################################################
|
---|
| 3 |
|
---|
| 4 | add_definitions( -DCANGATEWAY_EXPORTS )
|
---|
| 5 | add_definitions( -DDBTRAWCANREADER_EXPORTS )
|
---|
| 6 |
|
---|
| 7 | # ========================================
|
---|
| 8 | # Configure qt4
|
---|
| 9 | # ========================================
|
---|
| 10 | if(QT4_FOUND)
|
---|
| 11 | set(QT_USE_QTXML true)
|
---|
| 12 | set(QT_USE_QTNETWORK true)
|
---|
| 13 | include(${QT_USE_FILE})
|
---|
| 14 | else()
|
---|
| 15 | message(ERROR "Qt4 needed")
|
---|
| 16 | endif()
|
---|
| 17 |
|
---|
| 18 | # ========================================
|
---|
| 19 | # Compiler definitions
|
---|
| 20 | # ========================================
|
---|
| 21 | add_definitions(
|
---|
| 22 | ${QT_DEFINITIONS}
|
---|
| 23 | )
|
---|
| 24 |
|
---|
| 25 | # ========================================
|
---|
| 26 | # Include directories
|
---|
| 27 | # ========================================
|
---|
| 28 | include_directories(
|
---|
| 29 | ${PROJECT_BINARY_DIR}
|
---|
| 30 | ${QT_INCLUDE_DIR}
|
---|
| 31 | )
|
---|
| 32 |
|
---|
| 33 | # ========================================
|
---|
| 34 | # Link directories
|
---|
| 35 | # ========================================
|
---|
[31] | 36 | link_directories(
|
---|
| 37 | ${PACPUS_LIB_DIR}
|
---|
[2] | 38 | ${CanGateway_SOURCE_DIR}/driver/libs
|
---|
[1] | 39 | )
|
---|
| 40 |
|
---|
[31] | 41 |
|
---|
[1] | 42 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
|
---|
| 43 |
|
---|
| 44 | # ========================================
|
---|
| 45 | # List of sources
|
---|
| 46 | # ========================================
|
---|
| 47 | set(
|
---|
| 48 | PROJECT_SRCS
|
---|
| 49 | CanFrameBase.h
|
---|
| 50 | CanDecoderBase.cpp
|
---|
| 51 | CanDecoderBase.h
|
---|
| 52 | CanGateway.cpp
|
---|
| 53 | CanGateway.h
|
---|
| 54 | CanSubscription.cpp
|
---|
| 55 | CanSubscription.h
|
---|
| 56 | Win32CanInterface.cpp
|
---|
| 57 | Win32CanInterface.h
|
---|
| 58 | DbtRawCanReader.h
|
---|
| 59 | DbtRawCanReader.cpp
|
---|
[4] | 60 | structureCan.h
|
---|
[1] | 61 | ${PLUGIN_CPP}
|
---|
| 62 | )
|
---|
| 63 |
|
---|
| 64 | if(WIN32)
|
---|
| 65 | list(APPEND PROJECT_SRCS
|
---|
| 66 | driver/VectorCanDriver.cpp
|
---|
| 67 | driver/VectorCanDriver.h
|
---|
| 68 | driver/XLVectorCanDriver.cpp
|
---|
| 69 | driver/XLVectorCanDriver.h
|
---|
| 70 | )
|
---|
| 71 | endif(WIN32)
|
---|
| 72 | if(UNIX)
|
---|
| 73 | list(APPEND PROJECT_SRCS
|
---|
[4] | 74 | # driver/PeakCanDriver.cpp
|
---|
[1] | 75 | driver/PeakCanDriver.h
|
---|
[4] | 76 | driver/igepCanDriver.h
|
---|
| 77 | driver/igepCanDriver.cpp
|
---|
[1] | 78 | )
|
---|
| 79 | endif(UNIX)
|
---|
| 80 |
|
---|
| 81 | # ========================================
|
---|
| 82 | # Files to MOC
|
---|
| 83 | # ========================================
|
---|
| 84 |
|
---|
| 85 | set(
|
---|
| 86 | FILES_TO_MOC
|
---|
| 87 | CanGateway.h
|
---|
| 88 | DbtRawCanReader.h
|
---|
| 89 | ${PLUGIN_H}
|
---|
| 90 | )
|
---|
| 91 |
|
---|
| 92 | set(
|
---|
| 93 | UI_FILES
|
---|
| 94 | )
|
---|
| 95 |
|
---|
| 96 | # ========================================
|
---|
| 97 | # Call MOC
|
---|
| 98 | # ========================================
|
---|
| 99 | qt4_wrap_cpp(
|
---|
| 100 | PROJECT_MOC_SRCS
|
---|
| 101 | ${FILES_TO_MOC}
|
---|
| 102 | )
|
---|
| 103 |
|
---|
| 104 | qt4_wrap_ui(
|
---|
| 105 | PROJECT_UI_SRCS
|
---|
| 106 | ${UI_FILES}
|
---|
| 107 | )
|
---|
| 108 |
|
---|
| 109 | # ========================================
|
---|
| 110 | # Build a library
|
---|
| 111 | # ========================================
|
---|
| 112 | pacpus_add_library(
|
---|
| 113 | ${PROJECT_NAME} SHARED
|
---|
| 114 | ${PROJECT_SRCS}
|
---|
| 115 | ${PROJECT_MOC_SRCS}
|
---|
| 116 | ${PROJECT_UI_SRCS}
|
---|
| 117 | )
|
---|
| 118 |
|
---|
| 119 | # ========================================
|
---|
| 120 | # Libraries
|
---|
| 121 | # ========================================
|
---|
| 122 | if(WIN32)
|
---|
| 123 | set(LIBS
|
---|
| 124 | # add your specific libraries to link here
|
---|
[31] | 125 |
|
---|
| 126 | optimized vcandm32.lib debug vcandm32.lib
|
---|
| 127 | optimized vxlapi.lib debug vxlapi.lib
|
---|
[1] | 128 | )
|
---|
| 129 | endif(WIN32)
|
---|
| 130 |
|
---|
| 131 | if(UNIX)
|
---|
| 132 | set(LIBS
|
---|
| 133 | # add your specific libraries to link here
|
---|
[31] | 134 | # pcan
|
---|
[1] | 135 | )
|
---|
| 136 | endif(UNIX)
|
---|
| 137 |
|
---|
| 138 | # All the platform
|
---|
| 139 | target_link_libraries(
|
---|
| 140 | ${PROJECT_NAME}
|
---|
| 141 | ${PACPUS_LIBRARIES}
|
---|
| 142 | ${QT_LIBRARIES}
|
---|
| 143 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
[2] | 144 | ${LIBS}
|
---|
[31] | 145 | # optimized PacpusTools debug PacpusTools_d
|
---|
[1] | 146 | )
|
---|
[11] | 147 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
[1] | 148 |
|
---|
| 149 | # ========================================
|
---|
| 150 | # Install
|
---|
| 151 | # ========================================
|
---|
[45] | 152 | # install plugin
|
---|
[1] | 153 | pacpus_install(${PROJECT_NAME})
|
---|
[45] | 154 | # install headers
|
---|
| 155 | install(
|
---|
| 156 | DIRECTORY
|
---|
| 157 | ${CanGateway_SOURCE_DIR}
|
---|
| 158 | DESTINATION
|
---|
| 159 | ${PACPUS_INSTALL_DIR}/include
|
---|
| 160 | )
|
---|
| 161 | # if WIN32 install driver dependencies
|
---|
| 162 |
|
---|
| 163 |
|
---|
| 164 | sta#
|
---|