1 | project(CameraViewer)
|
---|
2 |
|
---|
3 | add_definitions( -DCAMERA_VIEWER_COMPONENT_EXPORTS )
|
---|
4 |
|
---|
5 | set(${PROJECT_NAME}_VERSION_MAJOR 0)
|
---|
6 | set(${PROJECT_NAME}_VERSION_MINOR 1)
|
---|
7 | # Create a DLL
|
---|
8 |
|
---|
9 | find_package(OpenCV REQUIRED)
|
---|
10 |
|
---|
11 | # Check for OpenCV
|
---|
12 | if(NOT OpenCV_FOUND)
|
---|
13 | message(FATAL_ERROR "Project ${PROJECT_NAME} requires OpenCV library")
|
---|
14 | endif()
|
---|
15 |
|
---|
16 | ################################################################################
|
---|
17 | create_export(EXPORT_HDR ${PROJECT_NAME})
|
---|
18 | pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
|
---|
19 | add_definitions (${QT_DEFINITIONS})
|
---|
20 |
|
---|
21 | ################################################################################
|
---|
22 | # DIRECTORIES
|
---|
23 | include_directories(
|
---|
24 | ${PROJECT_BINARY_DIR}
|
---|
25 | ${QT_INCLUDE_DIR}
|
---|
26 | ${OpenCV_INCLUDE_DIRS}
|
---|
27 | ${PACPUS_INCLUDE_DIR}
|
---|
28 | ${PACPUS_INCLUDE_DIR}/Pacpus/
|
---|
29 |
|
---|
30 | )
|
---|
31 |
|
---|
32 | # ========================================
|
---|
33 | # Link directories
|
---|
34 | # ========================================
|
---|
35 | link_directories(
|
---|
36 | ${PACPUS_LIB_DIR}
|
---|
37 | )
|
---|
38 |
|
---|
39 | ################################################################################
|
---|
40 | # FILES
|
---|
41 | set(PROJECT_HDRS
|
---|
42 | ${EXPORT_HDR}
|
---|
43 | CameraViewerComponent.hpp
|
---|
44 | )
|
---|
45 | set(PROJECT_SRCS
|
---|
46 | ${PLUGIN_CPP}
|
---|
47 | CameraViewerComponent.cpp
|
---|
48 | )
|
---|
49 |
|
---|
50 |
|
---|
51 | set(FILES_TO_MOC
|
---|
52 | ${PLUGIN_HDR}
|
---|
53 | CameraViewerComponent.hpp
|
---|
54 | )
|
---|
55 |
|
---|
56 | set(UI_FILES
|
---|
57 | )
|
---|
58 |
|
---|
59 | ################################################################################
|
---|
60 | # Qt: call moc, uic
|
---|
61 | qt_wrap_cpp(PROJECT_MOC_SRCS
|
---|
62 | ${FILES_TO_MOC}
|
---|
63 | )
|
---|
64 |
|
---|
65 | qt_wrap_ui(PROJECT_UI_SRCS
|
---|
66 | ${UI_FILES}
|
---|
67 | )
|
---|
68 |
|
---|
69 | ################################################################################
|
---|
70 | # BUILD and LINK
|
---|
71 | pacpus_add_library(${PROJECT_NAME} SHARED
|
---|
72 | ${PROJECT_HDRS}
|
---|
73 | ${PROJECT_SRCS}
|
---|
74 | ${PROJECT_MOC_SRCS}
|
---|
75 | ${PROJECT_UI_SRCS}
|
---|
76 | )
|
---|
77 |
|
---|
78 | target_compile_definitions(${PROJECT_NAME} PUBLIC OPENCV_MAJOR=${OpenCV_VERSION_MAJOR})
|
---|
79 |
|
---|
80 |
|
---|
81 | # ========================================
|
---|
82 | # Libraries
|
---|
83 | # ========================================
|
---|
84 | set(LIBS
|
---|
85 | optimized FileLib debug FileLib_d
|
---|
86 | optimized PacpusLib debug PacpusLib_d
|
---|
87 | optimized PacpusTools debug PacpusTools_d
|
---|
88 | )
|
---|
89 | if (WIN32)
|
---|
90 | list(APPEND LIBS
|
---|
91 | optimized ROAD_TIME debug ROAD_TIME_d
|
---|
92 | )
|
---|
93 | endif()
|
---|
94 | # LINK
|
---|
95 | target_link_libraries(${PROJECT_NAME}
|
---|
96 | ${PACPUS_LIBRARIES}
|
---|
97 | ${PACPUS_DEPENDENCIES_LIB}
|
---|
98 | ${LIBS}
|
---|
99 | ${QT_LIBRARIES}
|
---|
100 | ${OpenCV_LIBS}
|
---|
101 |
|
---|
102 | )
|
---|
103 | ################################################################################
|
---|
104 | # FOLDERS
|
---|
105 | pacpus_folder(${PROJECT_NAME} "components")
|
---|
106 | ################################################################################
|
---|
107 | # INSTALL
|
---|
108 | pacpus_install(${PROJECT_NAME})
|
---|