-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
101 lines (76 loc) · 1.91 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
cmake_minimum_required(VERSION 3.7)
project(QtVideoPlayer)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules")
if(QT_DIR)
message("Qt path is : ${QT_DIR}")
set(CMAKE_PREFIX_PATH ${QT_DIR})
endif(QT_DIR)
find_package(
FFmpeg
REQUIRED
COMPONENTS
avformat
avutil
swscale
swresample
avfilter
avdevice
avcodec)
if(${FFMPEG_FOUND})
include_directories(${FFMPEG_INCLUDE_DIRS})
message(${FFMPEG_INCLUDE_DIRS})
endif(${FFMPEG_FOUND})
find_package(Qt5 COMPONENTS Widgets Multimedia REQUIRED QUIET)
set(
SRC_HEADERS
video/video_player.h
video/main_window.h
video/data/data_context.h
video/data/audio_cvt.h
video/data/image_cvt.h
video/input/input_format.h
video/input/input_thread.h
video/render/audio_thread.h
video/render/video_thread.h
video/render/audio_render.h
video/render/video_render.h
)
set(
SRC_CPPS
video/main.cpp
video/video_player.cpp
video/main_window.cpp
video/data/data_context.cpp
video/data/audio_cvt.cpp
video/data/image_cvt.cpp
video/input/input_format.cpp
video/input/input_thread.cpp
video/render/audio_thread.cpp
video/render/video_thread.cpp
video/render/audio_render.cpp
video/render/video_render.cpp
)
if(WIN32)
add_executable(
QtVideoPlayer
WIN32
${SRC_HEADERS}
${SRC_CPPS}
)
else(WIN32)
add_executable(
QtVideoPlayer
MACOSX_BUNDLE
${SRC_HEADERS}
${SRC_CPPS}
)
endif(WIN32)
target_link_libraries(
QtVideoPlayer
Qt5::Widgets
Qt5::Multimedia
${FFMPEG_LIBRARIES}
)