-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Masaiki/master
add cmake build script
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,5 @@ | |
*.exe | ||
*.out | ||
*.app | ||
|
||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}) |