-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
34 lines (23 loc) · 917 Bytes
/
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
cmake_minimum_required(VERSION 3.27)
project(avideostream)
# Find the required ffmpeg libraries
find_package(PkgConfig REQUIRED)
pkg_check_modules(AVFORMAT REQUIRED libavformat)
pkg_check_modules(AVCODEC REQUIRED libavcodec)
pkg_check_modules(AVUTIL REQUIRED libavutil)
# Find python
find_package(Python3 COMPONENTS Interpreter Development REQUIRED)
# Include ffmpeg headers
include_directories(${AVFORMAT_INCLUDE_DIRS} ${AVCODEC_INCLUDE_DIRS} ${AVUTIL_INCLUDE_DIRS} ${Python3_INCLUDE_DIRS})
include_directories(src)
add_library(VideoStream SHARED
src/VideoStream.c
src/FrameEncoding.c
)
target_link_libraries(VideoStream ${AVFORMAT_LIBRARIES} ${AVCODEC_LIBRARIES} ${AVUTIL_LIBRARIES})
add_library(VideoStreamPy MODULE
src/avideostream.c
)
target_link_libraries(VideoStreamPy VideoStream ${Python3_LIBRARIES})
add_executable(main src/main.c)
target_link_libraries(main VideoStream)