-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
48 lines (37 loc) · 1.28 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
PROJECT ( QVideoWriter )
CMAKE_MINIMUM_REQUIRED (VERSION 3.0)
SET( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/")
OPTION(USE_QT6 "If on the library will be build for qt6 else qt5 is used")
IF(MSVC)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj /permissive-")
ENDIF(MSVC)
FIND_PACKAGE (FFmpeg REQUIRED)
ADD_DEFINITIONS (${FFMPEG_DEFINITIONS})
IF (USE_QT6)
FIND_PACKAGE (Qt6 REQUIRED COMPONENTS Core Widgets )
INCLUDE_DIRECTORIES (${Qt6Core_INCLUDE_DIRS})
INCLUDE_DIRECTORIES (${Qt6Widgets_INCLUDE_DIRS})
ELSE (USE_QT6)
FIND_PACKAGE (Qt5 REQUIRED COMPONENTS Core Widgets )
ADD_DEFINITIONS (${Qt5Widgets_DEFINITIONS})
INCLUDE_DIRECTORIES (${Qt5Core_INCLUDE_DIRS})
INCLUDE_DIRECTORIES (${Qt5Widgets_INCLUDE_DIRS})
ENDIF (USE_QT6)
INCLUDE_DIRECTORIES (${FFMPEG_INCLUDE_DIRS})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR})
INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR}/include)
SET ( QTFFMPEG_HDR
QVideoWriter.h
)
SET ( QTFFMPEG_SRC
src/QVideoWriter.cpp
)
ADD_LIBRARY ( qvideowriter STATIC ${QTFFMPEG_SRC} )
SET_PROPERTY(TARGET qvideowriter PROPERTY POSITION_INDEPENDENT_CODE ON)
TARGET_LINK_LIBRARIES ( qvideowriter
${Qt6Widgets_LIBRARIES}
${Qt6Core_LIBRARIES}
${FFMPEG_LIBRARIES}
${SWSCALE_LIBRARIES}
)