source: pacpussensors/trunk/OpencvVideo/CMakeLists.txt@ 91

Last change on this file since 91 was 60, checked in by DHERBOMEZ Gérald, 10 years ago

Add the module opencv video acquisition (compatible with 0.1.x version of the framework).

File size: 2.6 KB
Line 
1project(OpencvVideo)
2################################################################################
3
4# Create a DLL
5add_definitions(-DCVWEBCAM_COMPONENT_EXPORTS)
6add_definitions( -DVIDEO_EXPORTS )
7
8find_package(OpenCV REQUIRED)
9
10# Check for OpenCV
11if(NOT OpenCV_FOUND)
12 message(FATAL_ERROR "Project ${PROJECT_NAME} requires OpenCV library")
13endif()
14
15# ========================================
16# Configure qt4
17# ========================================
18if(QT4_FOUND)
19 set(QT_USE_QTXML true)
20 set(QT_USE_QTNETWORK true)
21 include(${QT_USE_FILE})
22else()
23 message(ERROR "Qt4 needed")
24endif()
25
26# ========================================
27# Compiler definitions
28# ========================================
29add_definitions(
30 ${QT_DEFINITIONS}
31)
32
33# ========================================
34# Include directories
35# ========================================
36include_directories(
37 ${PROJECT_BINARY_DIR}
38 ${QT_INCLUDE_DIR}
39)
40
41# ========================================
42# Link directories
43# ========================================
44link_directories( ${PACPUS_LIB_DIR} )
45
46message (STATUS ${PACPUS_LIB_DIR})
47
48pacpus_plugin(PLUGIN_CPP PLUGIN_H ${PROJECT_NAME} )
49
50# ========================================
51# List of sources
52# ========================================
53if (UNIX)
54 set(
55 PROJECT_SRCS
56 ${PLUGIN_CPP}
57 )
58endif()
59
60if(WIN32)
61 set(
62 PROJECT_SRCS
63 ${PLUGIN_CPP}
64 )
65 if(OpenCV_FOUND)
66 list(APPEND PROJECT_SRCS CVWebcamComponent.cpp WebcamWorker.cpp)
67 endif()
68endif()
69
70
71# ========================================
72# Files to MOC
73# ========================================
74set(
75 FILES_TO_MOC
76 ${PLUGIN_H}
77 CVWebcamComponent.hpp
78 WebcamWorker.hpp
79)
80
81set(
82 UI_FILES
83
84)
85
86# ========================================
87# Call MOC
88# ========================================
89qt4_wrap_cpp(
90 PROJECT_MOC_SRCS
91 ${FILES_TO_MOC}
92)
93
94qt4_wrap_ui(
95 PROJECT_UI_SRCS
96 ${UI_FILES}
97)
98
99# ========================================
100# Build a library
101# ========================================
102pacpus_add_library(
103 ${PROJECT_NAME} SHARED
104 ${PROJECT_SRCS}
105 ${PROJECT_MOC_SRCS}
106 ${PROJECT_UI_SRCS}
107)
108
109message(STATUS ${PACPUS_DEPENDENCIES_LIB} )
110
111# ========================================
112# Libraries
113# ========================================
114# All the platform
115target_link_libraries(
116 ${PROJECT_NAME}
117 ${PACPUS_LIBRARIES}
118 ${QT_LIBRARIES}
119 ${PACPUS_DEPENDENCIES_LIB}
120 ${OpenCV_LIBS}
121 PacpusTools
122)
123
124# ========================================
125# Install
126# ========================================
127pacpus_install(${PROJECT_NAME})
128
Note: See TracBrowser for help on using the repository browser.