[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
|
---|
[59] | 70 | driver/PeakCanDriverWin.h
|
---|
| 71 | driver/PeakCanDriverWin.cpp
|
---|
[1] | 72 | )
|
---|
| 73 | endif(WIN32)
|
---|
| 74 | if(UNIX)
|
---|
| 75 | list(APPEND PROJECT_SRCS
|
---|
[4] | 76 | # driver/PeakCanDriver.cpp
|
---|
[1] | 77 | driver/PeakCanDriver.h
|
---|
[4] | 78 | driver/igepCanDriver.h
|
---|
| 79 | driver/igepCanDriver.cpp
|
---|
[1] | 80 | )
|
---|
| 81 | endif(UNIX)
|
---|
| 82 |
|
---|
| 83 | # ========================================
|
---|
| 84 | # Files to MOC
|
---|
| 85 | # ========================================
|
---|
| 86 |
|
---|
| 87 | set(
|
---|
| 88 | FILES_TO_MOC
|
---|
| 89 | CanGateway.h
|
---|
| 90 | DbtRawCanReader.h
|
---|
| 91 | ${PLUGIN_H}
|
---|
| 92 | )
|
---|
| 93 |
|
---|
| 94 | set(
|
---|
| 95 | UI_FILES
|
---|
| 96 | )
|
---|
| 97 |
|
---|
| 98 | # ========================================
|
---|
| 99 | # Call MOC
|
---|
| 100 | # ========================================
|
---|
| 101 | qt4_wrap_cpp(
|
---|
| 102 | PROJECT_MOC_SRCS
|
---|
| 103 | ${FILES_TO_MOC}
|
---|
| 104 | )
|
---|
| 105 |
|
---|
| 106 | qt4_wrap_ui(
|
---|
| 107 | PROJECT_UI_SRCS
|
---|
| 108 | ${UI_FILES}
|
---|
| 109 | )
|
---|
| 110 |
|
---|
| 111 | # ========================================
|
---|
| 112 | # Build a library
|
---|
| 113 | # ========================================
|
---|
| 114 | pacpus_add_library(
|
---|
| 115 | ${PROJECT_NAME} SHARED
|
---|
| 116 | ${PROJECT_SRCS}
|
---|
| 117 | ${PROJECT_MOC_SRCS}
|
---|
| 118 | ${PROJECT_UI_SRCS}
|
---|
| 119 | )
|
---|
| 120 |
|
---|
| 121 | # ========================================
|
---|
| 122 | # Libraries
|
---|
| 123 | # ========================================
|
---|
| 124 | if(WIN32)
|
---|
| 125 | set(LIBS
|
---|
| 126 | # add your specific libraries to link here
|
---|
[31] | 127 |
|
---|
| 128 | optimized vcandm32.lib debug vcandm32.lib
|
---|
| 129 | optimized vxlapi.lib debug vxlapi.lib
|
---|
[59] | 130 | optimized PCANBasic.lib debug PCANBasic.lib
|
---|
[1] | 131 | )
|
---|
| 132 | endif(WIN32)
|
---|
| 133 |
|
---|
| 134 | if(UNIX)
|
---|
| 135 | set(LIBS
|
---|
| 136 | # add your specific libraries to link here
|
---|
[31] | 137 | # pcan
|
---|
[1] | 138 | )
|
---|
| 139 | endif(UNIX)
|
---|
| 140 |
|
---|
| 141 | # All the platform
|
---|
| 142 | target_link_libraries(
|
---|
| 143 | ${PROJECT_NAME}
|
---|
| 144 | ${PACPUS_LIBRARIES}
|
---|
| 145 | ${QT_LIBRARIES}
|
---|
| 146 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
[2] | 147 | ${LIBS}
|
---|
[31] | 148 | # optimized PacpusTools debug PacpusTools_d
|
---|
[1] | 149 | )
|
---|
[11] | 150 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
[1] | 151 |
|
---|
| 152 | # ========================================
|
---|
| 153 | # Install
|
---|
| 154 | # ========================================
|
---|
[45] | 155 | # install plugin
|
---|
[1] | 156 | pacpus_install(${PROJECT_NAME})
|
---|
[45] | 157 | # install headers
|
---|
| 158 | install(
|
---|
| 159 | DIRECTORY
|
---|
| 160 | ${CanGateway_SOURCE_DIR}
|
---|
| 161 | DESTINATION
|
---|
| 162 | ${PACPUS_INSTALL_DIR}/include
|
---|
| 163 | )
|
---|
[49] | 164 | # if WIN32 install driver dependencies
|
---|