2025-08-26 18:24:06 +09:00
|
|
|
|
2025-08-26 13:32:53 +09:00
|
|
|
cmake_minimum_required(VERSION 3.10.2)
|
2025-08-26 18:24:06 +09:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
2025-08-26 13:32:53 +09:00
|
|
|
|
2025-08-26 18:24:06 +09:00
|
|
|
project(native_renderer)
|
2025-08-26 13:32:53 +09:00
|
|
|
|
2025-08-26 18:24:06 +09:00
|
|
|
# 기본 로그 및 안드로이드 라이브러리
|
2025-08-26 13:32:53 +09:00
|
|
|
find_library(log-lib log)
|
2025-08-26 18:24:06 +09:00
|
|
|
find_library(android-lib android)
|
2025-08-26 13:32:53 +09:00
|
|
|
|
2025-08-26 18:24:06 +09:00
|
|
|
# ABI에 따라 jniLibs 경로 지정 (예: arm64-v8a, armeabi-v7a 등)
|
|
|
|
|
set(FFMPEG_LIB_DIR ${CMAKE_SOURCE_DIR}/../jniLibs/${ANDROID_ABI})
|
|
|
|
|
message(STATUS "FFMPEG_LIB_DIR: ${FFMPEG_LIB_DIR}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# FFmpeg 헤더 경로 추가
|
|
|
|
|
include_directories(${FFMPEG_LIB_DIR}/include)
|
|
|
|
|
include_directories(${CMAKE_SOURCE_DIR}/include) # stb_image.h가 이 경로에 있다면
|
|
|
|
|
|
|
|
|
|
# FFmpeg 라이브러리들 임포트 선언 및 위치 지정
|
|
|
|
|
add_library(avformat SHARED IMPORTED)
|
|
|
|
|
set_target_properties(avformat PROPERTIES IMPORTED_LOCATION
|
|
|
|
|
${FFMPEG_LIB_DIR}/libavformat.so)
|
|
|
|
|
|
|
|
|
|
add_library(avcodec SHARED IMPORTED)
|
|
|
|
|
set_target_properties(avcodec PROPERTIES IMPORTED_LOCATION
|
|
|
|
|
${FFMPEG_LIB_DIR}/libavcodec.so)
|
|
|
|
|
|
|
|
|
|
add_library(avutil SHARED IMPORTED)
|
|
|
|
|
set_target_properties(avutil PROPERTIES IMPORTED_LOCATION
|
|
|
|
|
${FFMPEG_LIB_DIR}/libavutil.so)
|
|
|
|
|
|
|
|
|
|
add_library(swscale SHARED IMPORTED)
|
|
|
|
|
set_target_properties(swscale PROPERTIES IMPORTED_LOCATION
|
|
|
|
|
${FFMPEG_LIB_DIR}/libswscale.so)
|
|
|
|
|
|
|
|
|
|
add_library(swresample SHARED IMPORTED)
|
|
|
|
|
set_target_properties(swresample PROPERTIES IMPORTED_LOCATION
|
|
|
|
|
${FFMPEG_LIB_DIR}/libswresample.so)
|
|
|
|
|
|
|
|
|
|
add_library(avfilter SHARED IMPORTED)
|
|
|
|
|
set_target_properties(avfilter PROPERTIES IMPORTED_LOCATION
|
|
|
|
|
${FFMPEG_LIB_DIR}/libavfilter.so)
|
|
|
|
|
|
|
|
|
|
# 네이티브 렌더러 라이브러리 빌드
|
|
|
|
|
add_library(native_renderer SHARED native_renderer.cpp) # 실제 소스파일명 입력
|
|
|
|
|
|
|
|
|
|
# 링크할 라이브러리 지정
|
|
|
|
|
target_link_libraries(native_renderer
|
|
|
|
|
avformat
|
|
|
|
|
avcodec
|
|
|
|
|
avutil
|
|
|
|
|
swscale
|
|
|
|
|
swresample
|
|
|
|
|
avfilter
|
|
|
|
|
${log-lib}
|
|
|
|
|
${android-lib}
|
|
|
|
|
)
|