Skip to content

Commit

Permalink
Merge pull request #1 from Masaiki/master
Browse files Browse the repository at this point in the history
add cmake build script
  • Loading branch information
myrsloik authored Sep 11, 2021
2 parents f0c95a1 + 8d1f4c9 commit be937ee
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@
*.exe
*.out
*.app

/build
31 changes: 31 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
cmake_minimum_required(VERSION 3.15) # for cmake policy CMP0091 https://cmake.org/cmake/help/latest/policy/CMP0091.html#policy:CMP0091
project(subtext)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_C_VISIBILITY_PRESET hidden)

include(FetchContent)
FetchContent_Declare(VapourSynth
URL https://github.com/vapoursynth/vapoursynth/archive/refs/tags/R55-API4-RC3.zip
URL_HASH MD5=2352CD4FD2DEEA88A9495279820AC2A0)
FetchContent_MakeAvailable(VapourSynth)

find_package(Iconv REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBAV REQUIRED
libavcodec
libavformat
libavutil
)
pkg_check_modules(LIBASS REQUIRED libass>=0.12.0)

add_library(subtext SHARED
"src/common.c"
"src/image.cpp"
"src/text.c"
"src/toass.cpp"
"src/toutf8.c"
)
target_include_directories(subtext PRIVATE "${vapoursynth_SOURCE_DIR}/include" ${LIBAV_INCLUDE_DIRS} ${LIBASS_INCLUDE_DIRS})
target_link_libraries(subtext PRIVATE Iconv::Iconv ${LIBAV_LINK_LIBRARIES} ${LIBASS_LINK_LIBRARIES})

0 comments on commit be937ee

Please sign in to comment.