forked from LYcreative/BackgroundSplit-OpenCV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
60 lines (49 loc) · 1.53 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(BACKGROUND_SPLIT)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
SET(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
FIND_PACKAGE(OpenCV REQUIRED)
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lib)
INCLUDE_DIRECTORIES(./)
INCLUDE_DIRECTORIES(./src)
# BGDifference,高斯背景差分法动态链接库生成
SET(LIB_BGDIFF_SOURCE
./src/BGDifference/BGDifference.h
./src/BGDifference/BGDifference.cpp)
ADD_LIBRARY(BGDiff SHARED ${LIB_BGDIFF_SOURCE})
TARGET_LINK_LIBRARIES(BGDiff
${OpenCV_LIBS})
# ViBe动态链接库生成
SET(LIB_VIBE_SOURCE
./src/ViBe/Vibe.h
./src/ViBe/Vibe.cpp)
ADD_LIBRARY(vibe SHARED ${LIB_VIBE_SOURCE})
TARGET_LINK_LIBRARIES(vibe
${OpenCV_LIBS})
# ViBe+动态链接库生成
SET(LIB_VIBEPLUS_SOURCE
./src/ViBe+/ViBePlus.h
./src/ViBe+/ViBePlusMacro.h
./src/ViBe+/ViBePlus.cpp)
ADD_LIBRARY(vibe+ SHARED ${LIB_VIBEPLUS_SOURCE})
TARGET_LINK_LIBRARIES(vibe+
${OpenCV_LIBS})
# 生成FrameDifference测试程序
ADD_EXECUTABLE(FrameDifference_test ./src/FramesDifference/main.cpp)
TARGET_LINK_LIBRARIES(FrameDifference_test
${OpenCV_LIBS})
# 生成BGDifference测试程序
SET(LIB_BGDIFF BGDiff)
ADD_EXECUTABLE(BGDiff_test ./src/BGDifference/main.cpp)
TARGET_LINK_LIBRARIES(BGDiff_test
${LIB_BGDIFF})
# 生成ViBe测试程序
SET(LIB_VIBE vibe)
ADD_EXECUTABLE(vibe_test ./src/ViBe/main.cpp)
TARGET_LINK_LIBRARIES(vibe_test
${LIB_VIBE})
# 生成ViBe+测试程序
SET(LIB_VIBEPLUS vibe+)
ADD_EXECUTABLE(vibe+_test ./src/ViBe+/main.cpp)
TARGET_LINK_LIBRARIES(vibe+_test
${LIB_VIBEPLUS})