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

Last change on this file since 137 was 99, checked in by nguyenhu, 9 years ago

compilation under linux with 0.2.X framework

File size: 2.9 KB
Line 
1#########################quick start############################################
2# cmake ../ -G "CodeBlocks - Unix Makefiles"
3# make
4# make install
5# make clean
6# sudo apt-get install libopencv-dev
7################################################################################
8project(OpencvVideo)
9set(${PROJECT_NAME}_VERSION_MAJOR 0)
10set(${PROJECT_NAME}_VERSION_MINOR 1)
11# Create a DLL
12add_definitions(-DCVWEBCAM_COMPONENT_EXPORTS)
13add_definitions( -DVIDEO_EXPORTS )
14
15#include(FindOpenCV.cmake)
16find_package(OpenCV REQUIRED)
17
18# Check for OpenCV
19if(NOT OpenCV_FOUND)
20 message(FATAL_ERROR "Project ${PROJECT_NAME} requires OpenCV library")
21endif()
22################################################################################
23create_export(EXPORT_HDR ${PROJECT_NAME})
24pacpus_plugin(PLUGIN_CPP PLUGIN_HDR ${PROJECT_NAME})
25add_definitions (${QT_DEFINITIONS})
26find_package(Qt5Network REQUIRED)
27################################################################################
28# DIRECTORIES
29include_directories(
30 ${PROJECT_BINARY_DIR}
31 ${QT_INCLUDE_DIR}
32 ${PACPUS_INCLUDE_DIR}
33 ${PACPUS_INCLUDE_DIR}/Pacpus/
34)
35
36# ========================================
37# Link directories
38# ========================================
39link_directories(
40 ${PACPUS_LIB_DIR}
41)
42
43
44################################################################################
45# FILES
46set(PROJECT_HDRS
47 ${EXPORT_HDR}
48 CVWebcamComponent.hpp
49 WebcamWorker.hpp
50)
51set(PROJECT_SRCS
52 ${PLUGIN_CPP}
53)
54
55if(OpenCV_FOUND)
56 list(APPEND PROJECT_SRCS CVWebcamComponent.cpp WebcamWorker.cpp)
57endif()
58
59set(FILES_TO_MOC
60 ${PLUGIN_HDR}
61 CVWebcamComponent.hpp
62 WebcamWorker.hpp
63)
64
65set(UI_FILES
66)
67
68################################################################################
69# Qt: call moc, uic
70qt_wrap_cpp(PROJECT_MOC_SRCS
71 ${FILES_TO_MOC}
72)
73
74qt_wrap_ui(PROJECT_UI_SRCS
75 ${UI_FILES}
76)
77
78################################################################################
79# BUILD and LINK
80pacpus_add_library(${PROJECT_NAME} SHARED
81 ${PROJECT_HDRS}
82 ${PROJECT_SRCS}
83 ${PROJECT_MOC_SRCS}
84 ${PROJECT_UI_SRCS}
85)
86
87
88# ========================================
89# Libraries
90# ========================================
91set(LIBS
92 optimized FileLib debug FileLib_d
93 optimized PacpusLib debug PacpusLib_d
94 optimized PacpusTools debug PacpusTools_d
95)
96if (WIN32)
97 list(APPEND LIBS
98 optimized ROAD_TIME debug ROAD_TIME_d
99 )
100endif()
101# LINK
102target_link_libraries(${PROJECT_NAME}
103 ${PACPUS_LIBRARIES}
104 ${PACPUS_DEPENDENCIES_LIB}
105 ${LIBS}
106 ${QT_LIBRARIES}
107 ${OpenCV_LIBS}
108 )
109qt5_use_modules(${PROJECT_NAME} Network)
110################################################################################
111# FOLDERS
112pacpus_folder(${PROJECT_NAME} "components")
113################################################################################
114# INSTALL
115pacpus_install(${PROJECT_NAME})
Note: See TracBrowser for help on using the repository browser.