Compare commits

...

81 Commits

Author SHA1 Message Date
wangqr 6b41659178 Upgrade LuaJIT to 2.1.0-beta3 2019-09-14 19:08:13 -04:00
wangqr 186c98308e Use gettext for desktop file instead of intltool 2019-09-13 17:59:38 -04:00
wangqr 7c500a096a Search user fonts in GDI font lister
Windows now allow user install fonts without admin. List HKCU for those fonts.
https://blogs.windows.com/windowsexperience/2018/06/27/announcing-windows-10-insider-preview-build-17704/
2019-09-13 15:49:15 -04:00
wangqr bd4c7789cf Add openal and CMake test to travis 2019-09-12 02:42:11 -04:00
wangqr 3eff75d56e In tagless_find_helper only tag before start should be ignored
The search result is irrelevant to which tag we should ignore

Fix wangqr/Aegisub#17
2019-09-11 11:29:20 -04:00
wangqr da699f124e Fix wrong memset usage 2019-09-10 02:15:48 -04:00
wangqr 1204a3be85 Cleanup CMake 2019-09-10 01:37:48 -04:00
wangqr 9e6b7e94c0 Fix crash in cache invalidation
The original version uses a reverse iterator, whose .base() is invalid after KillMacroBlock() erases it.

Fix TypesettingTools/Aegisub#33
Fix Aegisub/Aegisub#142
2019-09-08 13:01:55 -04:00
davste0816 ad02d39f44 Fix Move Down button in Export dialog 2019-09-08 11:37:52 -04:00
davste0816 d914ad72b5 Add .webm to extension list, add .eac3 as an audio format
Co-Authored-By: FichteFoll <fichtefoll2@googlemail.com>
2019-09-08 11:37:52 -04:00
davste0816 055aa379e5 Recognize .opus as an audio format, .h264 .hevc as video formats 2019-09-08 11:37:45 -04:00
wangqr 97792e15a8 Add WITH_* switchs to CMake to optional features 2019-09-08 07:12:19 -04:00
wangqr 4a874de442 Fix missing autopoint 2019-09-08 05:53:48 -04:00
scx 5d14137710 make_pot.sh: Check presence of xmlstarlet and jq 2019-09-08 04:35:05 -04:00
scx d252dcf32d Integrate AppData file with build system 2019-09-08 04:35:05 -04:00
scx 4f351b8b4a Add AppData file template 2019-09-08 04:35:05 -04:00
scx c4e0f40370 Fix compiler flags
http://devel.aegisub.org/ticket/1899
http://devel.aegisub.org/ticket/1900
https://github.com/Aegisub/Aegisub/pull/29
2019-09-08 02:25:56 -04:00
scx 05c0ba0e46 Add missing AM_GNU_GETTEXT_VERSION macro
Bug: http://devel.aegisub.org/ticket/1914
2019-09-08 02:22:51 -04:00
wangqr e4e04c9e87 Stop using deprecated hunspell API 2019-09-08 00:29:41 -04:00
wangqr 81160b2ec0 Remove conflicting glext.h 2019-09-07 22:29:23 -04:00
wangqr bf28e7efc3 Add PulseAudio to cmake 2019-09-07 12:35:27 -04:00
wangqr c2c44f1ad2 Fix build warnings
For pimpl with anonymous namespace, see https://stackoverflow.com/questions/39684438
2019-09-07 01:31:16 -04:00
wangqr 5dd201bc2d Update README.md and prepare for release 2019-09-05 22:16:58 -04:00
wangqr 3663d118b6 Separate desktop template for CMake
So it does not affect the translation
2019-09-04 22:46:29 -04:00
wangqr 60a722db31 Don't internally reset the selection after collected fonts
This creates an inconsistency between UI and internal mode.

Fix wangqr/Aegisub#10
2019-09-03 11:58:20 -04:00
wangqr d65643ddee Remove extra semicolon 2019-09-02 22:23:19 -04:00
wangqr fbca222295 Add back original travis tests 2019-09-02 22:06:41 -04:00
wangqr 3225ae39f4 Fix Makefile build
A missing header (acconf.h) issue was introduced in 34575a9786
In 419386aadd, some new source files have been added but not added to the file list in Makefile
2019-09-02 13:46:50 -04:00
wangqr 888be0607f visualSubToolBar now use same style as other toolbars
Previously visualSubToolBar has boarder while visualToolBar does not. So the width of the toolbar will change when toggling visualSubToolBar.

Now we remove the boarder so they have the same width. A separator is added at the top of visualToolBar instead to provide visual cue.

Fix wangqr/Aegisub#11
2019-09-01 22:55:13 -04:00
scx 4200b85fb4 Fix crashing when picking language
Aegisub crashes immediately after selecting any language
from the end of the list (above the 100th position).
This is because it can support no more than 100 languages.
This patch extends this limit up to 1000 languages (locales).

Fixes Aegisub/Aegisub#131
2019-09-01 19:17:35 -04:00
wangqr 0b8b286767 Fix crash on right click due to no spell checker 2019-09-01 19:15:28 -04:00
wangqr 139132a964 Use AviSynth from system 2019-09-01 19:15:21 -04:00
wangqr 4a3689d6e7 Remove the trailing period in help text of time/align
Fix wangqr/Aegisub#7
2019-08-24 02:10:08 -04:00
wangqr 248e69a9b6 Use absolute distance when scrolling audio box with mouse wheel
Instead of 1/3 screen per tick. So the distance of scroll no longer depends on the width of the audio box. Besides, 1/3 is feels to far for me when the audio box is wide.

See wangqr/Aegisub#5
2019-08-24 01:16:18 -04:00
wangqr 46474e0319 Set the height of sub box to the same as secondary_editor
The secondary_editor is a wxTextCtrl, whose height is calculated from 2 rows of text. Using this height gives better consistency on screens with different DPIs, instead of using hard coded value like 50px
2019-08-24 01:12:16 -04:00
wangqr 50544cf749 Set the height of sub box back to 50px
Revert the change made in ad15c53fb1.
As a temporary solution for wangqr/Aegisub#4.
2019-08-18 22:25:50 -04:00
wangqr e9a68f22b9 Remove the usage of dummy wxTimerEvent 2019-07-24 09:11:17 -04:00
wangqr d6ddea0f65 Detect EBML magic number to skip encoding detection for MKV
MKV loads slow after f733297499
2019-06-16 19:16:31 -04:00
wangqr 2bbed6c5a0 Load audio when video is successfully loaded
Fix bug introduced in 8f40ca44ce
2019-06-06 16:32:26 -04:00
wangqr 592250eeaa Remove call to wxSizer::CalcMin and wxSizer::RecalcSizes
As they are used internally by Layout and should not be called
directly.
2019-06-06 15:24:40 -04:00
wangqr 8f40ca44ce Try auto loading audio from video only when actually loading a video
If the user drop some files into Aegisub, we try to load sub, video,
audio, etc from them. When "Automatically open audio when opening
video" is checked in config, we try to load audio from the path of
the video. This should only be done if the video is newly loaded. So
we should never try to load audio from video if the user is just
opening a subtitle.

See https://github.com/Aegisub/Aegisub/issues/121#issuecomment-498489847
2019-06-06 14:31:07 -04:00
wangqr f776db2d2b Change the default fontsize and the list of resolutions
The default fontsize is changed to 48. While it still looks small
on the default 720p video, it is actually bigger than
    20 / 480 * 720 = 30

Here 720p is the default video resolution after 837d5a41d7. Some
common resolutions are also added to the preset list.

Fix wangqr/Aegisub#3
2019-06-03 22:08:11 -04:00
wangqr f9ffc46bf6 Add linux desktop icon 2019-05-22 20:45:51 -04:00
wangqr 019e68147e Fix FFT first sample location
Fix wangqr/Aegisub#1
2019-05-22 20:10:09 -04:00
wangqr f733297499 Rewrite encoding detection
Now feeds all data to uchardet, when uchardet is available. The file
size limit is removed.

When uchardet is not available, we look for UTF-8 BOM.
This should make loading UTF-8-BOM files faster.
Because Aegisub always save file in UTF-8-BOM, this should also
guarentee Aegisub will load large (>100MB) file saved by itself.

See Aegisub/Aegisub#110
2019-05-18 22:13:26 -04:00
wangqr 4c6d370d51 Add install target 2019-05-18 20:10:18 -04:00
wangqr b7c640d061 Fix High DPI issue on GTK
* Use icon size in the config
2019-05-17 13:58:14 -04:00
wangqr 2c06f03f5b Add AviSynth support 2019-05-16 11:07:57 -04:00
wangqr 1819fc8d8b Fix iconv ConversionFailure on long path 2019-05-16 11:04:53 -04:00
wangqr ba54e8d12f Fix build warnings 2019-05-11 21:36:34 -04:00
Ryan Lucia c76e410d30 Divorce stored TPP lead-in/out values from config
There's no real reason to link these as far as I can tell, and plenty of
valid reasons not to
2019-05-11 20:04:29 -04:00
Ryan Lucia bb2cfb1fcd Properly ignore ASS whitespace characters in character counter 2019-05-11 20:00:49 -04:00
Ryan Lucia 9abcc03202 Add configuration options for colors in visual typesetting tools 2019-05-11 19:43:54 -04:00
Ryan Lucia 837d5a41d7 Update default config to modern standards 2019-05-11 19:38:10 -04:00
Ryan Lucia 875456c803 Use FFMS2 constant in place of magic number 2019-05-10 15:22:26 -04:00
Ryan Lucia 9ddecfdd46 Ignore VS build files
Most files were moved to .vs directory with VS15
2019-05-10 15:17:19 -04:00
Ryan Lucia 70f27eae4b Pass 0 to FFMS_Init
The argument is no longer used, and the docs specify to pass a value of 0 to avoid confusion
2019-05-10 15:12:55 -04:00
Ryan Lucia 8d2ef3fca7 Point users at a functional bug tracker 2019-05-10 15:09:25 -04:00
Ryan Lucia 48869ae0ad Fix line order when splitting after current frame 2019-05-10 15:09:05 -04:00
Ryan Lucia b00285cf71 Use proper event for DoubleUpdater
Previously changes weren't recognized because the event bound was for integers
2019-05-10 15:06:01 -04:00
Ryan Lucia c6c9e05406 Remove dead forums link 2019-05-10 15:05:18 -04:00
Ryan Lucia fc1a78aeca Make translation assistant skipping whitespace an explicit setting 2019-05-10 15:04:48 -04:00
Ryan Lucia 38bb1790ab Remove Force BT.601 option and update color matrix guessing 2019-05-10 15:03:20 -04:00
Ryan Lucia fff08c4650 Add support for setting status bar text from Lua 2019-05-10 14:54:05 -04:00
wangqr 163d57d6a2 Fix LuaJIT segfault 2019-05-09 21:36:11 -04:00
wangqr 6266867586 Fix errors in AlignToVideo
* Call TimeAtFrame with correct parameter
* Fix syntax error
2019-05-09 16:54:20 -04:00
wangqr 4431f678ce Update about dialog 2019-05-09 16:30:38 -04:00
Charlie Jiang 419386aadd Merge remote-tracking branch 'origind-dev/master'
Add align to video function
2019-05-09 16:26:08 -04:00
wangqr c4cce28766 Update README to use CMake 2019-05-08 22:49:53 -04:00
wangqr 1ae2f60b9a Fix CMake build errors 2019-05-08 17:09:29 -04:00
wangqr b6eebcd7ef Fix build warnings 2019-05-08 17:09:07 -04:00
wangqr bf55264e6d Fix VS2019 compile issues 2019-05-08 16:34:53 -04:00
wangqr 34575a9786 Migrate to CMake to update packages easier 2019-05-08 16:34:39 -04:00
wangqr 69310d40ae Correctly handle memory free using Lua GC
Instead of manually free. Otherwise return value of `search' may refer to invalid memory.
Fix Aegisub/Aegisub#99
2019-03-15 00:01:29 -04:00
wangqr 657d9d5149 Bump boost version to 1.69.0
Fix Aegisub/Aegisub#93
2019-03-14 23:58:28 -04:00
wangqr 043a45cf91 Add DPI aware to Aegisub manifest 2018-12-08 01:20:08 -05:00
wangqr ad15c53fb1 Add DPI awareness
* Removed most hard coded wxSize
* Sub edit box now have DPI aware icons
2018-12-08 01:20:08 -05:00
wangqr 841a35a6fd Fix overflow bound 2018-12-08 01:20:08 -05:00
wangqr ee7dc6af4e Fix millisecond to centisecond convertion
Fix Aegisub/Aegisub#94
2018-12-08 01:20:08 -05:00
wangqr 77da2436c5 Change some text box size to make it looks better on HiDPI 2018-12-08 01:20:08 -05:00
wangqr 7be2325629 Fix travis-ci build script 2018-12-08 00:48:00 -05:00
367 changed files with 46641 additions and 23581 deletions

3
.gitignore vendored
View File

@ -5,6 +5,7 @@
*.bz2
*.cache
*.dep
*.db
*.dll
*.dmg
*.exe
@ -14,6 +15,7 @@
*.ilk
*.log
*.manifest
!src/dpi_aware.manifest
*.mkv
*.mo
*.ncb
@ -86,3 +88,4 @@ vendor/luajit/src/lj_vm.s
vendor/luajit/src/luajit
.nuget
.vs

View File

@ -1,5 +1,5 @@
sudo: required
dist: trusty
dist: bionic
language: cpp
git:
@ -8,58 +8,68 @@ git:
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'deb https://apt.kitware.com/ubuntu/ bionic main'
key_url: 'https://apt.kitware.com/keys/kitware-archive-latest.asc'
packages:
- libasound2-dev
- libfftw3-dev
- libhunspell-dev
- yasm
- libfribidi-dev
- libass-dev
- libicu-dev
- luarocks
- g++-5
- cmake
- build-essential
- libboost-all-dev
- libffms2-dev
- libfontconfig1-dev
- libopenal-dev
- libuchardet-dev
- libwxgtk3.0-dev
- portaudio19-dev
- libpulse-dev
- autopoint
- libgtest-dev
matrix:
include:
- compiler: gcc
env: BOOST_VERSION=55
- compiler: gcc
env: BOOST_VERSION=60
before_install:
- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 --slave /usr/bin/gcov gcov /usr/bin/gcov-5
- {}
- env: BUILD_SUIT=autotools
install:
# Can't install these via the apt addon due to the whitelist
- sudo apt-get install -y -qq libffms2-dev libwxgtk3.0-dev libuchardet-dev
- sudo pip install cpp-coveralls
- sudo luarocks install busted > /dev/null
- sudo luarocks install moonscript > /dev/null
- sudo luarocks install uuid > /dev/null
- git submodule --quiet init
- git submodule --quiet update vendor/googletest
- cd vendor
- rm -rf boost
- wget http://sourceforge.net/projects/boost/files/boost/1.${BOOST_VERSION}.0/boost_1_${BOOST_VERSION}_0.tar.bz2/download
- tar xjf download
- mv boost_1_${BOOST_VERSION}_0 boost
- cd boost
- ./bootstrap.sh
- ./b2 -j3 -layout=system threading=multi cxxflags=-std=c++11 link=shared variant=release --without-python --without-iostreams --without-serialization --without-graph --without-log --without-math --without-signals --without-test --without-wave --without-mpi --without-program_options --without-graph_parallel --without-context --without-coroutine --without-random --without-timer --without-date_time
- cd ../..
- sudo luarocks install busted > /dev/null
- sudo luarocks install moonscript > /dev/null
- sudo luarocks install uuid > /dev/null
# Remove the CMake provided by travis
- sudo rm -rf /usr/local/cmake*
- if [ "$BUILD_SUIT" = "autotools" ]; then
sudo pip install -U cpp-coveralls;
git submodule --quiet init;
git submodule --quiet update vendor/googletest;
else
pushd /usr/src/googletest;
sudo cmake .;
sudo make install -j2;
popd;
fi
script:
- export CPATH=$(pwd)/vendor/boost
- export LD_LIBRARY_PATH=$(pwd)/vendor/boost/stage/lib:$LD_LIBRARY_PATH
- export CPPFLAGS="-fprofile-arcs -ftest-coverage"
- export LIBS="-lgcov"
- autoreconf -if
- ./configure BOOST_LDFLAGS="-L$(pwd)/vendor/boost/stage/lib" --enable-debug || cat config.log
- make -j3 all test
- coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null
- if [ "$BUILD_SUIT" = "autotools" ]; then
export CPPFLAGS="-fprofile-arcs -ftest-coverage";
export LIBS="-lgcov";
./autogen.sh;
./configure --enable-debug agi_cv_with_openal=yes || cat config.log;
make -j2;
make test || travis_terminate 1;
coveralls --exclude vendor --exclude src --exclude build --exclude tools --exclude libaegisub/windows > /dev/null;
else
./build/version.sh .;
mkdir build-dir;
cd build-dir;
cmake -DCMAKE_CXX_FLAGS='-Wall -Wextra -Wno-unused-parameter -pedantic' -DCMAKE_C_FLAGS='-Wall' -DWITH_STARTUPLOG=ON -DWITH_TEST=ON ..;
make -j2;
make test || travis_terminate 1;
fi
notifications:
email:

78
CMakeLists.test.txt Normal file
View File

@ -0,0 +1,78 @@
if(UNIX)
add_executable(aegisub-lua EXCLUDE_FROM_ALL
automation/tests/aegisub.cpp
)
target_include_directories(aegisub-lua PRIVATE ${Boost_INCLUDE_DIRS})
target_link_directories(aegisub-lua PRIVATE ${Boost_LIBRARY_DIRS})
target_link_libraries(aegisub-lua libaegisub luabins luajit ${Boost_LIBRARIES} ${ICU_LIBRARIES})
add_custom_target(test-automation
COMMAND sh -c "$(luarocks path); ${PROJECT_BINARY_DIR}/aegisub-lua tests/busted.lua -p moon tests/modules"
VERBATIM
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/automation"
)
add_dependencies(test-automation aegisub-lua)
else()
add_custom_target(test-automation)
endif()
find_package(GTest)
if(GTEST_FOUND)
add_executable(gtest-run EXCLUDE_FROM_ALL
tests/tests/access.cpp
tests/tests/audio.cpp
tests/tests/cajun.cpp
tests/tests/calltip_provider.cpp
tests/tests/character_count.cpp
tests/tests/color.cpp
tests/tests/dialogue_lexer.cpp
tests/tests/format.cpp
tests/tests/fs.cpp
tests/tests/hotkey.cpp
tests/tests/iconv.cpp
tests/tests/ifind.cpp
tests/tests/karaoke_matcher.cpp
tests/tests/keyframe.cpp
tests/tests/line_iterator.cpp
tests/tests/line_wrap.cpp
tests/tests/mru.cpp
tests/tests/option.cpp
tests/tests/path.cpp
tests/tests/signals.cpp
tests/tests/split.cpp
tests/tests/syntax_highlight.cpp
tests/tests/thesaurus.cpp
tests/tests/time.cpp
tests/tests/type_name.cpp
tests/tests/util.cpp
tests/tests/uuencode.cpp
tests/tests/vfr.cpp
tests/tests/word_split.cpp
tests/support/main.cpp
tests/support/util.cpp
)
target_compile_definitions(gtest-run PRIVATE CMAKE_BUILD)
target_include_directories(gtest-run PRIVATE tests/support ${GTEST_INCLUDE_DIRS})
target_link_libraries(gtest-run libaegisub ${Boost_LIBRARIES} ${ICU_LIBRARIES} ${GTEST_LIBRARIES})
if(MSVC)
set_target_properties(gtest-run PROPERTIES COMPILE_FLAGS "/Yu${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h" COMPILE_FLAGS "/FI${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h")
else()
target_compile_options(gtest-run PRIVATE -include "${PROJECT_SOURCE_DIR}/tests/support/tests_pre.h")
endif()
if(WIN32)
add_custom_target(test-aegisub
COMMAND "${PROJECT_SOURCE_DIR}/tests/setup.bat"
COMMAND gtest-run
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/tests"
)
else()
add_custom_target(test-aegisub
COMMAND "${PROJECT_SOURCE_DIR}/tests/setup.sh"
COMMAND gtest-run
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}/tests"
)
endif()
else()
add_custom_target(test-aegisub)
endif()
add_custom_target(test DEPENDS test-automation test-aegisub)

809
CMakeLists.txt Normal file
View File

@ -0,0 +1,809 @@
cmake_minimum_required(VERSION 3.14)
cmake_policy(SET CMP0074 NEW)
project(Aegisub)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
include_directories("build")
include_directories("libaegisub/include")
include_directories("vendor/luajit/src")
add_library(libaegisub STATIC
libaegisub/common/parser.cpp
libaegisub/ass/dialogue_parser.cpp
libaegisub/ass/time.cpp
libaegisub/ass/uuencode.cpp
libaegisub/audio/provider.cpp
libaegisub/audio/provider_convert.cpp
libaegisub/audio/provider_dummy.cpp
libaegisub/audio/provider_hd.cpp
libaegisub/audio/provider_lock.cpp
libaegisub/audio/provider_pcm.cpp
libaegisub/audio/provider_ram.cpp
libaegisub/common/cajun/elements.cpp
libaegisub/common/cajun/reader.cpp
libaegisub/common/cajun/writer.cpp
libaegisub/lua/modules/lfs.cpp
libaegisub/lua/modules/re.cpp
libaegisub/lua/modules/unicode.cpp
libaegisub/lua/modules/lpeg.c
libaegisub/lua/modules.cpp
libaegisub/lua/script_reader.cpp
libaegisub/lua/utils.cpp
libaegisub/common/calltip_provider.cpp
libaegisub/common/character_count.cpp
libaegisub/common/charset.cpp
libaegisub/common/charset_6937.cpp
libaegisub/common/charset_conv.cpp
libaegisub/common/color.cpp
libaegisub/common/file_mapping.cpp
libaegisub/common/format.cpp
libaegisub/common/fs.cpp
libaegisub/common/hotkey.cpp
libaegisub/common/io.cpp
libaegisub/common/json.cpp
libaegisub/common/kana_table.cpp
libaegisub/common/karaoke_matcher.cpp
libaegisub/common/keyframe.cpp
libaegisub/common/line_iterator.cpp
libaegisub/common/log.cpp
libaegisub/common/mru.cpp
libaegisub/common/option.cpp
libaegisub/common/option_value.cpp
libaegisub/common/path.cpp
libaegisub/common/thesaurus.cpp
libaegisub/common/util.cpp
libaegisub/common/vfr.cpp
libaegisub/common/ycbcr_conv.cpp
libaegisub/common/dispatch.cpp
)
if(UNIX)
target_sources(libaegisub PRIVATE
libaegisub/unix/access.cpp
libaegisub/unix/fs.cpp
libaegisub/unix/log.cpp
libaegisub/unix/path.cpp
libaegisub/unix/util.cpp
)
set_property(
SOURCE libaegisub/unix/path.cpp
PROPERTY COMPILE_DEFINITIONS
P_DATA="${CMAKE_INSTALL_PREFIX}/share/aegisub/"
)
elseif(WIN32)
target_sources(libaegisub PRIVATE
libaegisub/windows/access.cpp
libaegisub/windows/charset_conv_win.cpp
libaegisub/windows/fs.cpp
libaegisub/windows/lagi_pre.cpp
libaegisub/windows/log_win.cpp
libaegisub/windows/path_win.cpp
libaegisub/windows/util_win.cpp
)
endif()
set_target_properties(libaegisub PROPERTIES PREFIX "")
target_compile_definitions(libaegisub PRIVATE CMAKE_BUILD)
add_library(luabins STATIC
vendor/luabins/src/fwrite.c
vendor/luabins/src/load.c
vendor/luabins/src/luabins.c
vendor/luabins/src/luainternals.c
vendor/luabins/src/save.c
vendor/luabins/src/savebuffer.c
vendor/luabins/src/write.c
)
add_executable(luajit-minilua vendor/luajit/src/host/minilua.c)
if(NOT WIN32)
target_link_libraries(luajit-minilua m)
endif()
if(WIN32)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen/buildvm_arch.h
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen
COMMAND luajit-minilua ../dynasm/dynasm.lua -LN -D WIN -D JIT -D FFI -D P64 -o gen/buildvm_arch.h vm_x86.dasc
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
else()
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen/buildvm_arch.h
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen
COMMAND luajit-minilua ../dynasm/dynasm.lua -LN -D WIN -D JIT -D FFI -o gen/buildvm_arch.h vm_x86.dasc
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
endif()
else()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen/buildvm_arch.h
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen
COMMAND luajit-minilua ../dynasm/dynasm.lua -D P64 -D JIT -D FFI -D FPU -D HFABI -D VER= -o gen/buildvm_arch.h vm_x86.dasc
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
else()
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen/buildvm_arch.h
COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen
COMMAND luajit-minilua ../dynasm/dynasm.lua -D JIT -D FFI -D FPU -D HFABI -D VER= -o gen/buildvm_arch.h vm_x86.dasc
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
endif()
endif()
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/src/libresrc/default_config.cpp ${PROJECT_SOURCE_DIR}/src/libresrc/default_config.h
DEPENDS ${PROJECT_SOURCE_DIR}/src/libresrc/default_config_platform.json
COMMAND luajit-minilua ../../tools/respack.lua manifest.respack default_config.cpp default_config.h
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/libresrc
)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/src/libresrc/bitmap.cpp ${PROJECT_SOURCE_DIR}/src/libresrc/bitmap.h
COMMAND luajit-minilua ../../tools/respack.lua manifest.respack ../libresrc/bitmap.cpp ../libresrc/bitmap.h
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/src/bitmaps
)
add_executable(luajit-buildvm
vendor/luajit/src/host/buildvm.c
vendor/luajit/src/host/buildvm_asm.c
vendor/luajit/src/host/buildvm_peobj.c
vendor/luajit/src/host/buildvm_lib.c
vendor/luajit/src/host/buildvm_fold.c
vendor/luajit/src/gen/buildvm_arch.h
)
target_compile_definitions(luajit-buildvm PRIVATE LUAJIT_ENABLE_LUA52COMPAT)
target_include_directories(luajit-buildvm PRIVATE vendor/luajit/src vendor/luajit/src/gen)
if(UNIX)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/lj_vm.s
COMMAND luajit-buildvm -m elfasm -o lj_vm.s
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
elseif(MSVC)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/lj_vm.obj
COMMAND luajit-buildvm -m peobj -o lj_vm.obj
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
endif()
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen/lj_ffdef.h
COMMAND luajit-buildvm -m ffdef -o gen/lj_ffdef.h lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen/lj_bcdef.h
COMMAND luajit-buildvm -m bcdef -o gen/lj_bcdef.h lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen/lj_folddef.h
COMMAND luajit-buildvm -m folddef -o gen/lj_folddef.h lj_opt_fold.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen/lj_recdef.h
COMMAND luajit-buildvm -m recdef -o gen/lj_recdef.h lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/gen/lj_libdef.h
COMMAND luajit-buildvm -m libdef -o gen/lj_libdef.h lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_custom_command(
OUTPUT ${PROJECT_SOURCE_DIR}/vendor/luajit/src/jit/vmdef.lua
COMMAND luajit-buildvm -m vmdef -o jit/vmdef.lua lib_base.c lib_math.c lib_bit.c lib_string.c lib_table.c lib_io.c lib_os.c lib_package.c lib_debug.c lib_jit.c lib_ffi.c
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/vendor/luajit/src
)
add_library(luajit STATIC
vendor/luajit/src/lib_base.c
vendor/luajit/src/lib_math.c
vendor/luajit/src/lib_bit.c
vendor/luajit/src/lib_string.c
vendor/luajit/src/lib_table.c
vendor/luajit/src/lib_io.c
vendor/luajit/src/lib_os.c
vendor/luajit/src/lib_package.c
vendor/luajit/src/lib_debug.c
vendor/luajit/src/lib_jit.c
vendor/luajit/src/lib_ffi.c
vendor/luajit/src/lj_gc.c
vendor/luajit/src/lj_err.c
vendor/luajit/src/lj_char.c
vendor/luajit/src/lj_bc.c
vendor/luajit/src/lj_obj.c
vendor/luajit/src/lj_buf.c
vendor/luajit/src/lj_str.c
vendor/luajit/src/lj_tab.c
vendor/luajit/src/lj_func.c
vendor/luajit/src/lj_udata.c
vendor/luajit/src/lj_meta.c
vendor/luajit/src/lj_debug.c
vendor/luajit/src/lj_state.c
vendor/luajit/src/lj_dispatch.c
vendor/luajit/src/lj_vmevent.c
vendor/luajit/src/lj_vmmath.c
vendor/luajit/src/lj_strscan.c
vendor/luajit/src/lj_strfmt.c
vendor/luajit/src/lj_strfmt_num.c
vendor/luajit/src/lj_api.c
vendor/luajit/src/lj_profile.c
vendor/luajit/src/lj_lex.c
vendor/luajit/src/lj_parse.c
vendor/luajit/src/lj_bcread.c
vendor/luajit/src/lj_bcwrite.c
vendor/luajit/src/lj_load.c
vendor/luajit/src/lj_ir.c
vendor/luajit/src/lj_opt_mem.c
vendor/luajit/src/lj_opt_fold.c
vendor/luajit/src/lj_opt_narrow.c
vendor/luajit/src/lj_opt_dce.c
vendor/luajit/src/lj_opt_loop.c
vendor/luajit/src/lj_opt_split.c
vendor/luajit/src/lj_opt_sink.c
vendor/luajit/src/lj_mcode.c
vendor/luajit/src/lj_snap.c
vendor/luajit/src/lj_record.c
vendor/luajit/src/lj_crecord.c
vendor/luajit/src/lj_ffrecord.c
vendor/luajit/src/lj_asm.c
vendor/luajit/src/lj_trace.c
vendor/luajit/src/lj_gdbjit.c
vendor/luajit/src/lj_ctype.c
vendor/luajit/src/lj_cdata.c
vendor/luajit/src/lj_cconv.c
vendor/luajit/src/lj_ccall.c
vendor/luajit/src/lj_ccallback.c
vendor/luajit/src/lj_carith.c
vendor/luajit/src/lj_clib.c
vendor/luajit/src/lj_cparse.c
vendor/luajit/src/lj_lib.c
vendor/luajit/src/lj_alloc.c
vendor/luajit/src/lib_aux.c
vendor/luajit/src/lib_init.c
vendor/luajit/src/gen/lj_ffdef.h
vendor/luajit/src/gen/lj_bcdef.h
vendor/luajit/src/gen/lj_folddef.h
vendor/luajit/src/gen/lj_recdef.h
vendor/luajit/src/gen/lj_libdef.h
vendor/luajit/src/jit/vmdef.lua
)
target_compile_definitions(luajit PRIVATE LUAJIT_ENABLE_LUA52COMPAT)
target_include_directories(luajit PRIVATE vendor/luajit/src/gen)
if(MSVC)
target_sources(luajit PRIVATE vendor/luajit/src/lj_vm.obj)
else()
target_sources(luajit PRIVATE vendor/luajit/src/lj_vm.s)
set_property(SOURCE vendor/luajit/src/lj_vm.s PROPERTY LANGUAGE C)
target_link_libraries(luajit ${CMAKE_DL_LIBS})
endif()
add_library(resrc STATIC
src/libresrc/bitmap.cpp
src/libresrc/default_config.cpp
src/libresrc/libresrc.cpp
)
add_library(csri STATIC
vendor/csri/lib/list.c
vendor/csri/lib/wrap.c
vendor/csri/subhelp/logging.c
)
target_include_directories(csri PRIVATE "vendor/csri/include")
if(WIN32)
target_include_directories(csri PRIVATE "vendor/csri/lib/win32")
target_sources(csri PRIVATE vendor/csri/lib/win32/enumerate.c)
else()
target_include_directories(csri PRIVATE "vendor/csri/lib/posix")
target_sources(csri PRIVATE vendor/csri/lib/posix/enumerate.c)
endif()
add_executable(Aegisub WIN32
src/command/app.cpp
src/command/audio.cpp
src/command/automation.cpp
src/command/command.cpp
src/command/edit.cpp
src/command/grid.cpp
src/command/help.cpp
src/command/keyframe.cpp
src/command/recent.cpp
src/command/subtitle.cpp
src/command/time.cpp
src/command/timecode.cpp
src/command/tool.cpp
src/command/video.cpp
src/command/vis_tool.cpp
src/dialog_about.cpp
src/dialog_align.cpp
src/dialog_attachments.cpp
src/dialog_automation.cpp
src/dialog_autosave.cpp
src/dialog_colorpicker.cpp
src/dialog_detached_video.cpp
src/dialog_dummy_video.cpp
src/dialog_export.cpp
src/dialog_export_ebu3264.cpp
src/dialog_fonts_collector.cpp
src/dialog_jumpto.cpp
src/dialog_kara_timing_copy.cpp
src/dialog_log.cpp
src/dialog_paste_over.cpp
src/dialog_progress.cpp
src/dialog_properties.cpp
src/dialog_resample.cpp
src/dialog_search_replace.cpp
src/dialog_selected_choices.cpp
src/dialog_selection.cpp
src/dialog_shift_times.cpp
src/dialog_spellchecker.cpp
src/dialog_style_editor.cpp
src/dialog_style_manager.cpp
src/dialog_styling_assistant.cpp
src/dialog_text_import.cpp
src/dialog_timing_processor.cpp
src/dialog_translation.cpp
src/dialog_video_details.cpp
src/dialog_video_properties.cpp
src/subtitle_format.cpp
src/subtitle_format_ass.cpp
src/subtitle_format_ebu3264.cpp
src/subtitle_format_encore.cpp
src/subtitle_format_microdvd.cpp
src/subtitle_format_mkv.cpp
src/subtitle_format_srt.cpp
src/subtitle_format_ssa.cpp
src/subtitle_format_transtation.cpp
src/subtitle_format_ttxt.cpp
src/subtitle_format_txt.cpp
src/visual_tool.cpp
src/visual_tool_clip.cpp
src/visual_tool_cross.cpp
src/visual_tool_drag.cpp
src/visual_tool_rotatexy.cpp
src/visual_tool_rotatez.cpp
src/visual_tool_scale.cpp
src/visual_tool_vector_clip.cpp
src/MatroskaParser.c
src/aegisublocale.cpp
src/ass_attachment.cpp
src/ass_dialogue.cpp
src/ass_entry.cpp
src/ass_export_filter.cpp
src/ass_exporter.cpp
src/ass_file.cpp
src/ass_karaoke.cpp
src/ass_override.cpp
src/ass_parser.cpp
src/ass_style.cpp
src/ass_style_storage.cpp
src/async_video_provider.cpp
src/audio_box.cpp
src/audio_colorscheme.cpp
src/audio_controller.cpp
src/audio_display.cpp
src/audio_karaoke.cpp
src/audio_marker.cpp
src/audio_player.cpp
src/audio_provider_factory.cpp
src/audio_renderer.cpp
src/audio_renderer_spectrum.cpp
src/audio_renderer_waveform.cpp
src/audio_timing_dialogue.cpp
src/audio_timing_karaoke.cpp
src/auto4_base.cpp
src/auto4_lua.cpp
src/auto4_lua_assfile.cpp
src/auto4_lua_dialog.cpp
src/auto4_lua_progresssink.cpp
src/base_grid.cpp
src/charset_detect.cpp
src/colorspace.cpp
src/colour_button.cpp
src/compat.cpp
src/context.cpp
src/export_fixstyle.cpp
src/export_framerate.cpp
src/fft.cpp
src/font_file_lister.cpp
src/frame_main.cpp
src/gl_text.cpp
src/gl_wrap.cpp
src/grid_column.cpp
src/help_button.cpp
src/hotkey.cpp
src/hotkey_data_view_model.cpp
src/image_position_picker.cpp
src/initial_line_state.cpp
src/main.cpp
src/menu.cpp
src/mkv_wrap.cpp
src/pen.cpp
src/persist_location.cpp
src/preferences.cpp
src/preferences_base.cpp
src/project.cpp
src/resolution_resampler.cpp
src/search_replace_engine.cpp
src/selection_controller.cpp
src/spellchecker.cpp
src/spline.cpp
src/spline_curve.cpp
src/string_codec.cpp
src/subs_controller.cpp
src/subs_edit_box.cpp
src/subs_edit_ctrl.cpp
src/subs_preview.cpp
src/subtitles_provider.cpp
src/subtitles_provider_libass.cpp
src/text_file_reader.cpp
src/text_file_writer.cpp
src/text_selection_controller.cpp
src/thesaurus.cpp
src/timeedit_ctrl.cpp
src/toggle_bitmap.cpp
src/toolbar.cpp
src/tooltip_manager.cpp
src/utils.cpp
src/validators.cpp
src/vector2d.cpp
src/version.cpp
src/video_box.cpp
src/video_controller.cpp
src/video_display.cpp
src/video_frame.cpp
src/video_out_gl.cpp
src/video_provider_cache.cpp
src/video_provider_dummy.cpp
src/video_provider_manager.cpp
src/video_provider_yuv4mpeg.cpp
src/video_slider.cpp
src/visual_feature.cpp
)
target_link_libraries(Aegisub ${CMAKE_DL_LIBS} libaegisub luabins luajit resrc csri)
target_compile_definitions(Aegisub PRIVATE CMAKE_BUILD)
set(WITH_BUILD_CREDIT OFF CACHE BOOL "Whether show build credit in about dialog")
if(WITH_BUILD_CREDIT)
set(BUILD_CREDIT "" CACHE STRING "Build credit shown in about dialog")
target_compile_definitions(Aegisub PRIVATE "BUILD_CREDIT=${BUILD_CREDIT}")
else()
unset(BUILD_CREDIT CACHE)
endif()
if(MSVC)
set_target_properties(libaegisub PROPERTIES COMPILE_FLAGS "/Yu${PROJECT_SOURCE_DIR}/libaegisub/lagi_pre.h" COMPILE_FLAGS "/FI${PROJECT_SOURCE_DIR}/libaegisub/lagi_pre.h")
else()
target_compile_options(libaegisub PRIVATE -include "${PROJECT_SOURCE_DIR}/libaegisub/lagi_pre.h")
endif()
if(MSVC)
add_definitions("/DNOMINMAX /MP /DINITGUID")
set_target_properties(Aegisub PROPERTIES COMPILE_FLAGS "/Yu${PROJECT_SOURCE_DIR}/src/agi_pre.h" COMPILE_FLAGS "/FI${PROJECT_SOURCE_DIR}/src/agi_pre.h")
target_link_libraries(Aegisub Usp10)
#target_sources(Aegisub PRIVATE src/res/res.rc src/res/strings.rc src/crash_writer_minidump.cpp)
target_sources(Aegisub PRIVATE src/res/res.rc src/res/strings.rc src/crash_writer.cpp src/dpi_aware.manifest)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Aegisub)
else()
target_sources(Aegisub PRIVATE src/crash_writer.cpp)
target_compile_options(Aegisub PRIVATE -include "${PROJECT_SOURCE_DIR}/src/agi_pre.h")
endif()
if(WIN32)
target_sources(Aegisub PRIVATE src/font_file_lister_gdi.cpp)
else()
find_package(Fontconfig REQUIRED)
target_include_directories(Aegisub PRIVATE ${Fontconfig_INCLUDE_DIRS})
target_link_libraries(Aegisub ${Fontconfig_LIBRARIES})
target_sources(Aegisub PRIVATE src/font_file_lister_fontconfig.cpp)
endif()
find_package(ass REQUIRED)
target_include_directories(Aegisub PRIVATE ${ass_INCLUDE_DIRS})
target_link_libraries(Aegisub ${ass_LIBRARIES})
find_package(Boost REQUIRED chrono filesystem locale regex system thread)
target_include_directories(libaegisub PRIVATE ${Boost_INCLUDE_DIRS})
target_include_directories(Aegisub PRIVATE ${Boost_INCLUDE_DIRS})
target_link_directories(Aegisub PRIVATE ${Boost_LIBRARY_DIRS})
target_link_libraries(Aegisub ${Boost_LIBRARIES})
find_package(OpenGL REQUIRED)
target_include_directories(Aegisub PRIVATE ${OPENGL_INCLUDE_DIR})
target_link_libraries(Aegisub ${OPENGL_LIBRARIES})
find_package(Iconv REQUIRED)
target_compile_definitions(libaegisub PRIVATE "HAVE_ICONV")
target_include_directories(libaegisub PRIVATE ${Iconv_INCLUDE_DIRS})
target_link_libraries(libaegisub ${Iconv_LIBRARIES})
if(NOT Iconv_IS_BUILT_IN)
target_compile_definitions(libaegisub PRIVATE "AGI_ICONV_CONST")
endif()
find_package(ICU REQUIRED uc dt in)
target_include_directories(libaegisub PRIVATE ${ICU_INCLUDE_DIRS})
target_include_directories(Aegisub PRIVATE ${ICU_INCLUDE_DIRS})
target_link_libraries(Aegisub ${ICU_LIBRARIES})
find_package(wxWidgets REQUIRED adv base core gl stc xml)
include(${wxWidgets_USE_FILE})
target_link_libraries(Aegisub ${wxWidgets_LIBRARIES})
find_package(ZLIB REQUIRED)
target_include_directories(Aegisub PRIVATE ${ZLIB_INCLUDE_DIRS})
target_link_libraries(Aegisub ${ZLIB_LIBRARIES})
set(WITH_ALSA ON CACHE BOOL "Enable ALSA support")
if(WITH_ALSA)
find_package(ALSA)
if(NOT ALSA_FOUND)
set(WITH_ALSA OFF CACHE BOOL "Enable ALSA support" FORCE)
endif()
endif()
if(WITH_ALSA)
target_compile_definitions(Aegisub PRIVATE "WITH_ALSA")
target_include_directories(Aegisub PRIVATE ${ALSA_INCLUDE_DIRS})
target_link_libraries(Aegisub ${ALSA_LIBRARIES})
target_sources(Aegisub PRIVATE src/audio_player_alsa.cpp)
endif()
set(WITH_AVISYNTH ON CACHE BOOL "Enable AviSynth support")
if(WITH_AVISYNTH)
find_package(AviSynth)
if(NOT AviSynth_FOUND)
set(WITH_AVISYNTH OFF CACHE BOOL "Enable AviSynth support" FORCE)
endif()
endif()
if(WITH_AVISYNTH)
target_compile_definitions(Aegisub PRIVATE "WITH_AVISYNTH" "AVS_LINKAGE_DLLIMPORT")
target_include_directories(Aegisub PRIVATE ${AviSynth_INCLUDE_DIRS})
target_link_libraries(Aegisub Vfw32 ${AviSynth_LIBRARIES})
target_sources(Aegisub PRIVATE src/audio_provider_avs.cpp src/avisynth_wrap.cpp src/video_provider_avs.cpp)
endif()
set(WITH_CSRI ON CACHE BOOL "Enable CSRI support")
if(WITH_CSRI)
target_compile_definitions(Aegisub PRIVATE "WITH_CSRI")
target_include_directories(Aegisub PRIVATE "${PROJECT_SOURCE_DIR}/vendor/csri/include")
target_sources(Aegisub PRIVATE src/subtitles_provider_csri.cpp)
endif()
if(WIN32)
target_compile_definitions(Aegisub PRIVATE "WITH_DIRECTSOUND")
target_link_libraries(Aegisub dsound)
target_sources(Aegisub PRIVATE src/audio_player_dsound.cpp src/audio_player_dsound2.cpp)
set(WITH_DIRECTSOUND ON)
else()
set(WITH_DIRECTSOUND OFF)
endif()
set(WITH_FFMS2 ON CACHE BOOL "Enable FFMS2 support")
if(WITH_FFMS2)
find_package(FFMS2)
if(NOT FFMS2_FOUND)
set(WITH_FFMS2 OFF CACHE BOOL "Enable FFMS2 support" FORCE)
endif()
endif()
if(WITH_FFMS2)
target_compile_definitions(Aegisub PRIVATE "WITH_FFMS2")
target_include_directories(Aegisub PRIVATE ${FFMS2_INCLUDE_DIRS})
target_link_libraries(Aegisub ${FFMS2_LIBRARIES})
target_sources(Aegisub PRIVATE src/audio_provider_ffmpegsource.cpp src/ffmpegsource_common.cpp src/video_provider_ffmpegsource.cpp)
else()
message(SEND_ERROR
"No supported video/audio reader interface was enabled.\n"
"You will not be able to open any video or audio files in Aegisub unless you install a supported video/audio provider.\n"
"You will however still be able to open \"dummy\" video, ie. a blank, virtual video clip with subtitles overlaid.\n"
"Currently we only support one video/audio provider on non-Windows systems:\n"
" - FFMS2\n"
" * http://github.com/FFMS/ffms2\n"
)
endif()
set(WITH_FFTW3 ON CACHE BOOL "Enable fftw support")
if(WITH_FFTW3)
find_package(FFTW)
if(NOT FFTW_FOUND)
set(WITH_FFTW3 OFF CACHE BOOL "Enable fftw support" FORCE)
endif()
endif()
if(WITH_FFTW3)
target_compile_definitions(Aegisub PRIVATE "WITH_FFTW3")
target_include_directories(Aegisub PRIVATE ${FFTW_INCLUDES})
target_link_libraries(Aegisub ${FFTW_LIBRARIES})
endif()
set(WITH_HUNSPELL ON CACHE BOOL "Enable Hunspell support")
if(WITH_HUNSPELL)
find_package(Hunspell)
if(NOT HUNSPELL_FOUND)
set(WITH_HUNSPELL OFF CACHE BOOL "Enable Hunspell support" FORCE)
endif()
endif()
if(WITH_HUNSPELL)
target_compile_definitions(Aegisub PRIVATE "WITH_HUNSPELL")
target_include_directories(Aegisub PRIVATE ${HUNSPELL_INCLUDE_DIR})
target_link_libraries(Aegisub ${HUNSPELL_LIBRARIES})
target_sources(Aegisub PRIVATE src/spellchecker_hunspell.cpp)
if(HUNSPELL_HAS_STRING_API)
target_compile_definitions(Aegisub PRIVATE "HUNSPELL_HAS_STRING_API")
endif(HUNSPELL_HAS_STRING_API)
endif()
set(WITH_LIBPULSE ON CACHE BOOL "Enable PulseAudio support")
if(WITH_LIBPULSE)
find_package(PulseAudio)
if(NOT PULSEAUDIO_FOUND)
set(WITH_LIBPULSE OFF CACHE BOOL "Enable PulseAudio support" FORCE)
endif()
endif()
if(WITH_LIBPULSE)
target_compile_definitions(Aegisub PRIVATE "WITH_LIBPULSE")
target_include_directories(Aegisub PRIVATE ${PULSEAUDIO_INCLUDE_DIR})
target_link_libraries(Aegisub ${PULSEAUDIO_LIBRARY})
target_sources(Aegisub PRIVATE src/audio_player_pulse.cpp)
endif()
set(WITH_OPENAL ON CACHE BOOL "Enable OpenAL support")
if(WITH_OPENAL)
find_package(OpenAL)
if(NOT OPENAL_FOUND)
set(WITH_OPENAL OFF CACHE BOOL "Enable OpenAL support" FORCE)
endif()
endif()
if(WITH_OPENAL)
target_compile_definitions(Aegisub PRIVATE "WITH_OPENAL")
target_include_directories(Aegisub PRIVATE ${OPENAL_INCLUDE_DIR})
target_link_libraries(Aegisub ${OPENAL_LIBRARY})
target_sources(Aegisub PRIVATE src/audio_player_openal.cpp)
endif()
set(WITH_OSS OFF CACHE BOOL "Enable OSS support")
if(WITH_OSS)
find_package(OSS)
if(NOT OSS_FOUND)
set(WITH_OSS OFF CACHE BOOL "Enable OSS support" FORCE)
endif()