[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 | # ========================================
|
---|
[2] | 36 | link_directories( ${PACPUS_LIB_DIR}
|
---|
| 37 | ${CanGateway_SOURCE_DIR}/driver/libs
|
---|
[1] | 38 | )
|
---|
| 39 |
|
---|
| 40 | pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
|
---|
| 41 |
|
---|
| 42 | # ========================================
|
---|
| 43 | # List of sources
|
---|
| 44 | # ========================================
|
---|
| 45 | set(
|
---|
| 46 | PROJECT_SRCS
|
---|
| 47 | CanFrameBase.h
|
---|
| 48 | CanDecoderBase.cpp
|
---|
| 49 | CanDecoderBase.h
|
---|
| 50 | CanGateway.cpp
|
---|
| 51 | CanGateway.h
|
---|
| 52 | CanSubscription.cpp
|
---|
| 53 | CanSubscription.h
|
---|
| 54 | Win32CanInterface.cpp
|
---|
| 55 | Win32CanInterface.h
|
---|
| 56 | DbtRawCanReader.h
|
---|
| 57 | DbtRawCanReader.cpp
|
---|
[4] | 58 | structureCan.h
|
---|
[1] | 59 | ${PLUGIN_CPP}
|
---|
| 60 | )
|
---|
| 61 |
|
---|
| 62 | if(WIN32)
|
---|
| 63 | list(APPEND PROJECT_SRCS
|
---|
| 64 | driver/VectorCanDriver.cpp
|
---|
| 65 | driver/VectorCanDriver.h
|
---|
| 66 | driver/XLVectorCanDriver.cpp
|
---|
| 67 | driver/XLVectorCanDriver.h
|
---|
| 68 | )
|
---|
| 69 | endif(WIN32)
|
---|
| 70 | if(UNIX)
|
---|
| 71 | list(APPEND PROJECT_SRCS
|
---|
[4] | 72 | # driver/PeakCanDriver.cpp
|
---|
[1] | 73 | driver/PeakCanDriver.h
|
---|
[4] | 74 | driver/igepCanDriver.h
|
---|
| 75 | driver/igepCanDriver.cpp
|
---|
[1] | 76 | )
|
---|
| 77 | endif(UNIX)
|
---|
| 78 |
|
---|
| 79 | # ========================================
|
---|
| 80 | # Files to MOC
|
---|
| 81 | # ========================================
|
---|
| 82 |
|
---|
| 83 | set(
|
---|
| 84 | FILES_TO_MOC
|
---|
| 85 | CanGateway.h
|
---|
| 86 | DbtRawCanReader.h
|
---|
| 87 | ${PLUGIN_H}
|
---|
| 88 | )
|
---|
| 89 |
|
---|
| 90 | set(
|
---|
| 91 | UI_FILES
|
---|
| 92 | )
|
---|
| 93 |
|
---|
| 94 | # ========================================
|
---|
| 95 | # Call MOC
|
---|
| 96 | # ========================================
|
---|
| 97 | qt4_wrap_cpp(
|
---|
| 98 | PROJECT_MOC_SRCS
|
---|
| 99 | ${FILES_TO_MOC}
|
---|
| 100 | )
|
---|
| 101 |
|
---|
| 102 | qt4_wrap_ui(
|
---|
| 103 | PROJECT_UI_SRCS
|
---|
| 104 | ${UI_FILES}
|
---|
| 105 | )
|
---|
| 106 |
|
---|
| 107 | # ========================================
|
---|
| 108 | # Build a library
|
---|
| 109 | # ========================================
|
---|
| 110 | pacpus_add_library(
|
---|
| 111 | ${PROJECT_NAME} SHARED
|
---|
| 112 | ${PROJECT_SRCS}
|
---|
| 113 | ${PROJECT_MOC_SRCS}
|
---|
| 114 | ${PROJECT_UI_SRCS}
|
---|
| 115 | )
|
---|
| 116 |
|
---|
| 117 | # ========================================
|
---|
| 118 | # Libraries
|
---|
| 119 | # ========================================
|
---|
| 120 | if(WIN32)
|
---|
| 121 | set(LIBS
|
---|
| 122 | # add your specific libraries to link here
|
---|
| 123 | vcandm32.lib
|
---|
| 124 | vxlapi.lib
|
---|
| 125 | )
|
---|
| 126 | endif(WIN32)
|
---|
| 127 |
|
---|
| 128 | if(UNIX)
|
---|
| 129 | set(LIBS
|
---|
| 130 | # add your specific libraries to link here
|
---|
[4] | 131 | # pcan
|
---|
[1] | 132 | )
|
---|
| 133 | endif(UNIX)
|
---|
| 134 |
|
---|
| 135 | # All the platform
|
---|
| 136 | target_link_libraries(
|
---|
| 137 | ${PROJECT_NAME}
|
---|
| 138 | ${PACPUS_LIBRARIES}
|
---|
| 139 | ${QT_LIBRARIES}
|
---|
| 140 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
[2] | 141 | ${LIBS}
|
---|
[4] | 142 | # PacpusTools
|
---|
[1] | 143 | )
|
---|
[11] | 144 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
[1] | 145 |
|
---|
| 146 | # ========================================
|
---|
| 147 | # Install
|
---|
| 148 | # ========================================
|
---|
| 149 | pacpus_install(${PROJECT_NAME})
|
---|