[147] | 1 | #########################quick start############################################
|
---|
| 2 | #cmake ../ -G "CodeBlocks - Unix Makefiles"
|
---|
| 3 | #make
|
---|
| 4 | #make install
|
---|
| 5 | #make clean
|
---|
| 6 | ################################################################################
|
---|
| 7 | project(CameraPlayer)
|
---|
| 8 | set(${PROJECT_NAME}_VERSION_MAJOR 0)
|
---|
| 9 | set(${PROJECT_NAME}_VERSION_MINOR 1)
|
---|
| 10 | add_definitions( -DCAMERAPLAYER_EXPORTS )
|
---|
| 11 |
|
---|
| 12 |
|
---|
| 13 | ################################################################################
|
---|
| 14 | create_export(EXPORT_HDR ${PROJECT_NAME})
|
---|
| 15 | pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
|
---|
| 16 | add_definitions (${QT_DEFINITIONS})
|
---|
| 17 |
|
---|
| 18 | find_package(Qt5Network REQUIRED)
|
---|
| 19 |
|
---|
| 20 | find_package(OpenCV REQUIRED)
|
---|
| 21 |
|
---|
| 22 | # Check for OpenCV
|
---|
| 23 | if(NOT OpenCV_FOUND)
|
---|
| 24 | message(FATAL_ERROR "Project ${PROJECT_NAME} requires OpenCV library")
|
---|
| 25 | endif()
|
---|
| 26 | ################################################################################
|
---|
| 27 | # DIRECTORIES
|
---|
| 28 | include_directories(
|
---|
| 29 | ${PROJECT_BINARY_DIR}
|
---|
| 30 | ${QT_INCLUDE_DIR}
|
---|
| 31 | ${OpenCV_INCLUDE_DIRS}
|
---|
| 32 | ${PACPUS_INCLUDE_DIR}
|
---|
| 33 | ${PACPUS_INCLUDE_DIR}/Pacpus/
|
---|
| 34 | )
|
---|
| 35 |
|
---|
| 36 | # ========================================
|
---|
| 37 | # Link directories
|
---|
| 38 | # ========================================
|
---|
| 39 | link_directories(
|
---|
| 40 | ${PACPUS_LIB_DIR}
|
---|
| 41 | )
|
---|
| 42 |
|
---|
| 43 |
|
---|
| 44 | ################################################################################
|
---|
| 45 | # FILES
|
---|
| 46 | set(PROJECT_HDRS
|
---|
| 47 | ${EXPORT_HDR}
|
---|
| 48 | CameraPlayerConfig.h
|
---|
| 49 | DbtPlyOpenCVManager.h
|
---|
| 50 | )
|
---|
| 51 | set(PROJECT_SRCS
|
---|
| 52 | ${PLUGIN_CPP}
|
---|
| 53 | DbtPlyOpenCVManager.cpp
|
---|
| 54 | )
|
---|
| 55 |
|
---|
| 56 | set(FILES_TO_MOC
|
---|
| 57 | ${PLUGIN_HDR}
|
---|
| 58 | DbtPlyOpenCVManager.h
|
---|
| 59 | )
|
---|
| 60 |
|
---|
| 61 | set(UI_FILES
|
---|
| 62 | )
|
---|
| 63 |
|
---|
| 64 | ################################################################################
|
---|
| 65 | # Qt: call moc, uic
|
---|
| 66 | qt_wrap_cpp(PROJECT_MOC_SRCS
|
---|
| 67 | ${FILES_TO_MOC}
|
---|
| 68 | )
|
---|
| 69 |
|
---|
| 70 | qt_wrap_ui(PROJECT_UI_SRCS
|
---|
| 71 | ${UI_FILES}
|
---|
| 72 | )
|
---|
| 73 |
|
---|
| 74 | ################################################################################
|
---|
| 75 | # BUILD and LINK
|
---|
| 76 | pacpus_add_library(${PROJECT_NAME} SHARED
|
---|
| 77 | ${PROJECT_HDRS}
|
---|
| 78 | ${PROJECT_SRCS}
|
---|
| 79 | ${PROJECT_MOC_SRCS}
|
---|
| 80 | ${PROJECT_UI_SRCS}
|
---|
| 81 | )
|
---|
| 82 |
|
---|
| 83 | target_compile_definitions(${PROJECT_NAME} PUBLIC OPENCV_MAJOR=${OpenCV_VERSION_MAJOR})
|
---|
| 84 |
|
---|
| 85 | # ========================================
|
---|
| 86 | # Libraries
|
---|
| 87 | # ========================================
|
---|
| 88 | set(LIBS
|
---|
| 89 | optimized FileLib debug FileLib_d
|
---|
| 90 | optimized PacpusLib debug PacpusLib_d
|
---|
| 91 | optimized PacpusTools debug PacpusTools_d
|
---|
| 92 |
|
---|
| 93 | #optimized NMEA0183LIB debug NMEA0183LIB_d
|
---|
| 94 |
|
---|
| 95 | )
|
---|
| 96 | if (WIN32)
|
---|
| 97 | list(APPEND LIBS
|
---|
| 98 | optimized ROAD_TIME debug ROAD_TIME_d
|
---|
| 99 | )
|
---|
| 100 | endif()
|
---|
| 101 | # LINK
|
---|
| 102 | target_link_libraries(${PROJECT_NAME}
|
---|
| 103 | ${PACPUS_LIBRARIES}
|
---|
| 104 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
| 105 | ${LIBS}
|
---|
| 106 | ${QT_LIBRARIES}
|
---|
| 107 | ${OpenCV_LIBS}
|
---|
| 108 |
|
---|
| 109 | #optimized NMEA0183LIB debug NMEA0183LIB_d
|
---|
| 110 | )
|
---|
| 111 | qt5_use_modules(${PROJECT_NAME} Network)
|
---|
| 112 | ################################################################################
|
---|
| 113 | # FOLDERS
|
---|
| 114 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
| 115 | ################################################################################
|
---|
| 116 | # INSTALL
|
---|
| 117 | pacpus_install(${PROJECT_NAME})
|
---|
| 118 |
|
---|
| 119 | # install headers
|
---|
| 120 | install(
|
---|
| 121 | DIRECTORY
|
---|
| 122 | ${StdDbtPlayerComponents_SOURCE_DIR}
|
---|
| 123 | DESTINATION
|
---|
| 124 | ${PACPUS_INSTALL_DIR}/include
|
---|
| 125 | FILES_MATCHING PATTERN "*.h"
|
---|
| 126 | )
|
---|