forked from mia/Aegisub
Modernize CMake (part 1)
This commit is contained in:
parent
5318838b93
commit
c0c2a9100d
7 changed files with 110 additions and 160 deletions
|
@ -2,9 +2,7 @@ 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})
|
||||
target_link_libraries(aegisub-lua PRIVATE libaegisub luabins luajit "Boost::locale")
|
||||
add_custom_target(test-automation
|
||||
COMMAND sh -c "$(luarocks path); ${PROJECT_BINARY_DIR}/aegisub-lua tests/busted.lua -p moon tests/modules"
|
||||
VERBATIM
|
||||
|
@ -51,8 +49,8 @@ if(GTEST_FOUND)
|
|||
tests/support/util.cpp
|
||||
)
|
||||
target_compile_definitions(gtest-run PRIVATE CMAKE_BUILD)
|
||||
target_include_directories(gtest-run PRIVATE tests/support ${Boost_INCLUDE_DIRS} ${Iconv_INCLUDE_DIRS} ${GTEST_INCLUDE_DIRS})
|
||||
target_link_libraries(gtest-run libaegisub ${Boost_LIBRARIES} ${ICU_LIBRARIES} ${GTEST_LIBRARIES})
|
||||
target_include_directories(gtest-run PRIVATE "${PROJECT_SOURCE_DIR}/tests/support")
|
||||
target_link_libraries(gtest-run PRIVATE libaegisub "Boost::filesystem" "GTest::GTest" "Iconv::Iconv")
|
||||
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()
|
||||
|
|
203
CMakeLists.txt
203
CMakeLists.txt
|
@ -3,7 +3,7 @@ cmake_policy(SET CMP0074 NEW)
|
|||
|
||||
project(Aegisub)
|
||||
|
||||
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
|
||||
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
||||
|
||||
include_directories("build")
|
||||
include_directories("libaegisub/include")
|
||||
|
@ -467,7 +467,7 @@ add_executable(Aegisub WIN32
|
|||
src/video_slider.cpp
|
||||
src/visual_feature.cpp
|
||||
)
|
||||
target_link_libraries(Aegisub ${CMAKE_DL_LIBS} libaegisub luabins luajit resrc csri)
|
||||
target_link_libraries(Aegisub LINK_PRIVATE ${CMAKE_DL_LIBS} libaegisub luabins luajit resrc csri)
|
||||
target_compile_definitions(Aegisub PRIVATE CMAKE_BUILD)
|
||||
|
||||
if(WIN32)
|
||||
|
@ -487,7 +487,7 @@ else()
|
|||
add_dependencies(Aegisub git_version)
|
||||
endif()
|
||||
|
||||
set(WITH_BUILD_CREDIT OFF CACHE BOOL "Whether show build credit in about dialog")
|
||||
option(WITH_BUILD_CREDIT "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}")
|
||||
|
@ -504,7 +504,7 @@ 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_link_libraries(Aegisub LINK_PRIVATE 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)
|
||||
|
@ -517,75 +517,60 @@ 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_link_libraries(Aegisub PRIVATE "Fontconfig::Fontconfig")
|
||||
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})
|
||||
target_link_libraries(Aegisub LINK_PRIVATE ${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(Boost REQUIRED container filesystem locale regex thread)
|
||||
target_link_libraries(libaegisub PRIVATE "Boost::locale" "Boost::regex" "Boost::thread")
|
||||
target_link_libraries(libaegisub PUBLIC "Boost::headers" "Boost::container" "Boost::filesystem")
|
||||
target_link_libraries(Aegisub PRIVATE "Boost::headers" "Boost::container" "Boost::filesystem" "Boost::locale" "Boost::regex")
|
||||
|
||||
find_package(OpenGL REQUIRED)
|
||||
target_include_directories(Aegisub PRIVATE ${OPENGL_INCLUDE_DIR})
|
||||
target_link_libraries(Aegisub ${OPENGL_LIBRARIES})
|
||||
target_link_libraries(Aegisub PRIVATE "OpenGL::GL")
|
||||
|
||||
find_package(Iconv REQUIRED)
|
||||
target_include_directories(libaegisub PRIVATE ${Iconv_INCLUDE_DIRS})
|
||||
target_link_libraries(libaegisub ${Iconv_LIBRARIES})
|
||||
target_link_libraries(libaegisub PRIVATE "Iconv::Iconv")
|
||||
|
||||
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(ICU REQUIRED uc)
|
||||
target_link_libraries(libaegisub PRIVATE "ICU::uc")
|
||||
target_link_libraries(Aegisub PRIVATE "ICU::uc")
|
||||
|
||||
find_package(wxWidgets REQUIRED adv base core gl stc xml)
|
||||
include(${wxWidgets_USE_FILE})
|
||||
target_link_libraries(Aegisub ${wxWidgets_LIBRARIES})
|
||||
target_link_libraries(Aegisub LINK_PRIVATE ${wxWidgets_LIBRARIES})
|
||||
|
||||
find_package(ZLIB REQUIRED)
|
||||
target_include_directories(Aegisub PRIVATE ${ZLIB_INCLUDE_DIRS})
|
||||
target_link_libraries(Aegisub ${ZLIB_LIBRARIES})
|
||||
target_link_libraries(Aegisub PRIVATE "ZLIB::ZLIB")
|
||||
|
||||
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()
|
||||
find_package(ALSA)
|
||||
option(WITH_ALSA "Enable ALSA support" ${ALSA_FOUND})
|
||||
if(WITH_ALSA)
|
||||
find_package(ALSA REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_ALSA")
|
||||
target_include_directories(Aegisub PRIVATE ${ALSA_INCLUDE_DIRS})
|
||||
target_link_libraries(Aegisub ${ALSA_LIBRARIES})
|
||||
target_link_libraries(Aegisub PRIVATE "ALSA::ALSA")
|
||||
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()
|
||||
find_package(AviSynth)
|
||||
option(WITH_AVISYNTH "Enable AviSynth support" ${AviSynth_FOUND})
|
||||
if(WITH_AVISYNTH)
|
||||
find_package(AviSynth REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_AVISYNTH")
|
||||
target_include_directories(Aegisub PRIVATE ${AviSynth_INCLUDE_DIRS})
|
||||
if(WIN32)
|
||||
target_link_libraries(Aegisub Vfw32)
|
||||
target_link_libraries(Aegisub LINK_PRIVATE Vfw32)
|
||||
endif()
|
||||
get_filename_component(Avisynth_LIBRARY_NAME "${AviSynth_SHARED_LIBRARY}" NAME CACHE)
|
||||
target_compile_definitions(Aegisub PRIVATE "AVISYNTH_SO=\"${Avisynth_LIBRARY_NAME}\"")
|
||||
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")
|
||||
option(WITH_CSRI "Enable CSRI support" ON)
|
||||
if(WITH_CSRI)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_CSRI")
|
||||
target_include_directories(Aegisub PRIVATE "${PROJECT_SOURCE_DIR}/vendor/csri/include")
|
||||
|
@ -593,11 +578,13 @@ if(WITH_CSRI)
|
|||
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)
|
||||
set(WITH_XAUDIO2 ON CACHE BOOL "Enable XAudio2 support")
|
||||
option(WITH_DIRECTSOUND "Enable DirectSound support" ON)
|
||||
if(WITH_DIRECTSOUND)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_DIRECTSOUND")
|
||||
target_link_libraries(Aegisub LINK_PRIVATE dsound)
|
||||
target_sources(Aegisub PRIVATE src/audio_player_dsound.cpp src/audio_player_dsound2.cpp)
|
||||
endif()
|
||||
option(WITH_XAUDIO2 "Enable XAudio2 support" ON)
|
||||
if(WITH_XAUDIO2)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_XAUDIO2")
|
||||
target_sources(Aegisub PRIVATE src/audio_player_xaudio2.cpp)
|
||||
|
@ -607,17 +594,13 @@ else()
|
|||
set(WITH_XAUDIO2 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()
|
||||
find_package(FFMS2)
|
||||
option(WITH_FFMS2 "Enable FFMS2 support" ${FFMS2_FOUND})
|
||||
if(WITH_FFMS2)
|
||||
find_package(FFMS2 REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_FFMS2")
|
||||
target_include_directories(Aegisub PRIVATE ${FFMS2_INCLUDE_DIRS})
|
||||
target_link_libraries(Aegisub ${FFMS2_LIBRARIES})
|
||||
target_link_libraries(Aegisub LINK_PRIVATE ${FFMS2_LIBRARIES})
|
||||
target_sources(Aegisub PRIVATE src/audio_provider_ffmpegsource.cpp src/ffmpegsource_common.cpp src/video_provider_ffmpegsource.cpp)
|
||||
else()
|
||||
message(SEND_ERROR
|
||||
|
@ -630,121 +613,101 @@ else()
|
|||
)
|
||||
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()
|
||||
find_package(FFTW)
|
||||
option(WITH_FFTW3 "Enable fftw support" ${FFTW_FOUND})
|
||||
if(WITH_FFTW3)
|
||||
find_package(FFTW REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_FFTW3")
|
||||
target_include_directories(Aegisub PRIVATE ${FFTW_INCLUDES})
|
||||
target_link_libraries(Aegisub ${FFTW_LIBRARIES})
|
||||
target_link_libraries(Aegisub LINK_PRIVATE ${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()
|
||||
find_package(Hunspell)
|
||||
option(WITH_HUNSPELL "Enable Hunspell support" ${HUNSPELL_FOUND})
|
||||
if(WITH_HUNSPELL)
|
||||
find_package(Hunspell REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_HUNSPELL")
|
||||
target_include_directories(Aegisub PRIVATE ${HUNSPELL_INCLUDE_DIR})
|
||||
target_link_libraries(Aegisub ${HUNSPELL_LIBRARIES})
|
||||
target_link_libraries(Aegisub PRIVATE "hunspell")
|
||||
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()
|
||||
find_package(PulseAudio)
|
||||
option(WITH_LIBPULSE "Enable PulseAudio support" ${PULSEAUDIO_FOUND})
|
||||
if(WITH_LIBPULSE)
|
||||
find_package(PulseAudio REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_LIBPULSE")
|
||||
target_include_directories(Aegisub PRIVATE ${PULSEAUDIO_INCLUDE_DIR})
|
||||
target_link_libraries(Aegisub ${PULSEAUDIO_LIBRARY})
|
||||
target_link_libraries(Aegisub LINK_PRIVATE ${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()
|
||||
find_package(OpenAL)
|
||||
option(WITH_OPENAL "Enable OpenAL support" ${OPENAL_FOUND})
|
||||
if(WITH_OPENAL)
|
||||
find_package(OpenAL REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_OPENAL")
|
||||
target_include_directories(Aegisub PRIVATE ${OPENAL_INCLUDE_DIR})
|
||||
target_link_libraries(Aegisub ${OPENAL_LIBRARY})
|
||||
target_link_libraries(Aegisub LINK_PRIVATE ${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()
|
||||
endif()
|
||||
find_package(OSS)
|
||||
option(WITH_OSS "Enable OSS support" ${OSS_FOUND})
|
||||
if(WITH_OSS)
|
||||
find_package(OSS REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_OSS")
|
||||
target_include_directories(Aegisub PRIVATE ${OSS_INCLUDE_DIRS})
|
||||
target_sources(Aegisub PRIVATE src/audio_player_oss.cpp)
|
||||
endif()
|
||||
|
||||
set(WITH_PORTAUDIO ON CACHE BOOL "Enable PortAudio support")
|
||||
if(WITH_PORTAUDIO)
|
||||
find_package(PortAudio)
|
||||
if(NOT PortAudio_FOUND)
|
||||
set(WITH_PORTAUDIO OFF CACHE BOOL "Enable PortAudio support" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
find_package(PortAudio)
|
||||
option(WITH_PORTAUDIO "Enable PortAudio support" ${PortAudio_FOUND})
|
||||
if(WITH_PORTAUDIO)
|
||||
find_package(PortAudio REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_PORTAUDIO")
|
||||
target_include_directories(Aegisub PRIVATE ${PortAudio_INCLUDE_DIRS})
|
||||
target_link_libraries(Aegisub ${PortAudio_LIBRARIES})
|
||||
target_link_libraries(Aegisub LINK_PRIVATE ${PortAudio_LIBRARIES})
|
||||
target_sources(Aegisub PRIVATE src/audio_player_portaudio.cpp)
|
||||
endif()
|
||||
|
||||
set(WITH_STARTUPLOG OFF CACHE BOOL "Enable startup log")
|
||||
option(WITH_STARTUPLOG "Enable startup log")
|
||||
if(WITH_STARTUPLOG)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_STARTUPLOG")
|
||||
endif()
|
||||
|
||||
set(WITH_UCHARDET ON CACHE BOOL "Enable uchardet support")
|
||||
if(WITH_UCHARDET)
|
||||
find_package(uchardet)
|
||||
if(NOT uchardet_FOUND)
|
||||
set(WITH_UCHARDET OFF CACHE BOOL "Enable uchardet support" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
find_package(uchardet)
|
||||
option(WITH_UCHARDET "Enable uchardet support" ${uchardet_FOUND})
|
||||
if(WITH_UCHARDET)
|
||||
find_package(uchardet REQUIRED)
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_UCHARDET")
|
||||
target_include_directories(Aegisub PRIVATE ${uchardet_INCLUDE_DIRS})
|
||||
target_link_libraries(Aegisub ${uchardet_LIBRARIES})
|
||||
target_link_libraries(Aegisub LINK_PRIVATE ${uchardet_LIBRARIES})
|
||||
endif()
|
||||
|
||||
set(WITH_UPDATE_CHECKER OFF)
|
||||
option(WITH_UPDATE_CHECKER "Enable update checker")
|
||||
if(WITH_UPDATE_CHECKER)
|
||||
set(UPDATE_CHECKER_SERVER "\"updates.aegisub.org\"" CACHE STRING "Server for the update checker")
|
||||
set(UPDATE_CHECKER_BASE_URL "\"/trunk\"" CACHE STRING "Base path for the update checker")
|
||||
target_compile_definitions(Aegisub PRIVATE "WITH_UPDATE_CHECKER" "UPDATE_CHECKER_SERVER=${UPDATE_CHECKER_SERVER}" "UPDATE_CHECKER_BASE_URL=${UPDATE_CHECKER_BASE_URL}")
|
||||
target_link_libraries(Aegisub ${Boost_asio_LIBRARY})
|
||||
target_sources(Aegisub PRIVATE src/dialog_version_check.cpp)
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
set(DEFAULT_PLAYER_AUDIO DirectSound)
|
||||
configure_file("src/libresrc/default_config_win.json" "${PROJECT_SOURCE_DIR}/src/libresrc/default_config_platform.json" COPYONLY)
|
||||
if(WITH_XAUDIO2)
|
||||
set(DEFAULT_PLAYER_AUDIO "XAudio2" CACHE STRING "Default audio player")
|
||||
elseif(WITH_DIRECTSOUND)
|
||||
set(DEFAULT_PLAYER_AUDIO "DirectSound" CACHE STRING "Default audio player")
|
||||
else()
|
||||
message(SEND_ERROR
|
||||
"No supported audio player interface was enabled.\n"
|
||||
"If you want audio support in Aegisub you need to enable one of these audio players:\n"
|
||||
" - XAudio2\n"
|
||||
" - DirectSound\n"
|
||||
"\n"
|
||||
)
|
||||
set(DEFAULT_PLAYER_AUDIO "NONE" CACHE STRING "Default audio player")
|
||||
endif()
|
||||
configure_file("src/libresrc/default_config_win.json.in" "${PROJECT_SOURCE_DIR}/src/libresrc/default_config_platform.json" @ONLY)
|
||||
else()
|
||||
if(WITH_LIBPULSE)
|
||||
set(DEFAULT_PLAYER_AUDIO "PulseAudio" CACHE STRING "Default audio player")
|
||||
|
@ -770,10 +733,6 @@ else()
|
|||
)
|
||||
set(DEFAULT_PLAYER_AUDIO "NONE" CACHE STRING "Default audio player")
|
||||
endif()
|
||||
add_custom_command(
|
||||
OUTPUT ${PROJECT_SOURCE_DIR}/src/libresrc/default_config_platform.json
|
||||
COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/src/libresrc/default_config_win.json ${PROJECT_SOURCE_DIR}/src/libresrc/default_config_platform.json
|
||||
)
|
||||
configure_file("src/libresrc/default_config_platform.json.in" "${PROJECT_SOURCE_DIR}/src/libresrc/default_config_platform.json" @ONLY)
|
||||
endif()
|
||||
|
||||
|
|
|
@ -40,21 +40,23 @@ FIND_LIBRARY(HUNSPELL_LIBRARIES NAMES hunspell-1.7 hunspell-1.6 hunspell-1.5 hun
|
|||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Hunspell DEFAULT_MSG HUNSPELL_LIBRARIES HUNSPELL_INCLUDE_DIR )
|
||||
|
||||
add_library(hunspell UNKNOWN IMPORTED)
|
||||
set_target_properties(hunspell PROPERTIES IMPORTED_LOCATION ${HUNSPELL_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES ${HUNSPELL_INCLUDE_DIR})
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
# At least statically compiled hunspell 1.7.0 requires HUNSPELL_STATIC
|
||||
# For other versions, it should not hurt
|
||||
set_target_properties(hunspell PROPERTIES INTERFACE_COMPILE_DEFINITIONS HUNSPELL_STATIC)
|
||||
endif ()
|
||||
if(NOT TARGET hunspell)
|
||||
add_library(hunspell UNKNOWN IMPORTED)
|
||||
set_target_properties(hunspell PROPERTIES IMPORTED_LOCATION ${HUNSPELL_LIBRARIES} INTERFACE_INCLUDE_DIRECTORIES ${HUNSPELL_INCLUDE_DIR})
|
||||
if (NOT BUILD_SHARED_LIBS)
|
||||
# At least statically compiled hunspell 1.7.0 requires HUNSPELL_STATIC
|
||||
# For other versions, it should not hurt
|
||||
set_target_properties(hunspell PROPERTIES INTERFACE_COMPILE_DEFINITIONS HUNSPELL_STATIC)
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if (HUNSPELL_FOUND)
|
||||
try_compile(HUNSPELL_HAS_STRING_API "${CMAKE_BINARY_DIR}/hunspell_string_api"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/hunspell_string_api.cpp"
|
||||
LINK_LIBRARIES ${HUNSPELL_LIBRARIES}
|
||||
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES=${HUNSPELL_INCLUDE_DIR}")
|
||||
LINK_LIBRARIES hunspell)
|
||||
if (HUNSPELL_HAS_STRING_API)
|
||||
message(STATUS "Hunspell has string API")
|
||||
set_target_properties(hunspell PROPERTIES INTERFACE_COMPILE_DEFINITIONS HUNSPELL_HAS_STRING_API)
|
||||
else(HUNSPELL_HAS_STRING_API)
|
||||
message(STATUS "Hunspell does not have string API")
|
||||
endif(HUNSPELL_HAS_STRING_API)
|
||||
|
|
|
@ -14,11 +14,6 @@
|
|||
#include <ctime>
|
||||
|
||||
// Common C++
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4996)
|
||||
#endif
|
||||
|
||||
#include <algorithm>
|
||||
#include <functional>
|
||||
#include <iterator>
|
||||
|
@ -28,16 +23,10 @@
|
|||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
// Boost
|
||||
#include <boost/range/algorithm.hpp>
|
||||
#include <boost/range/irange.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#define BOOST_NO_SCOPED_ENUMS
|
||||
#include <boost/filesystem.hpp>
|
||||
#undef BOOST_NO_SCOPED_ENUMS
|
||||
#include <boost/interprocess/streams/bufferstream.hpp>
|
||||
#endif
|
||||
|
|
|
@ -63,11 +63,6 @@
|
|||
#include <cstdint>
|
||||
#include <ctime>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4996)
|
||||
#endif
|
||||
|
||||
// Common C++
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
|
@ -86,10 +81,6 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <objbase.h>
|
||||
#include <mmsystem.h>
|
||||
|
@ -106,9 +97,7 @@
|
|||
#include <boost/range/algorithm.hpp>
|
||||
#include <boost/range/irange.hpp>
|
||||
#include <boost/regex.hpp>
|
||||
#define BOOST_NO_SCOPED_ENUMS
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#undef BOOST_NO_SCOPED_ENUMS
|
||||
#include <boost/interprocess/streams/bufferstream.hpp>
|
||||
#include <boost/interprocess/streams/vectorstream.hpp>
|
||||
|
||||
|
|
15
src/libresrc/default_config_win.json.in
Normal file
15
src/libresrc/default_config_win.json.in
Normal file
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
"Audio" : {
|
||||
"Player" : "@DEFAULT_PLAYER_AUDIO@"
|
||||
},
|
||||
"Provider" : {
|
||||
"Audio" : {
|
||||
"FFmpegSource" : {
|
||||
"Downmix" : false
|
||||
}
|
||||
}
|
||||
},
|
||||
"Subtitle" : {
|
||||
"Provider" : "CSRI/xy-vsfilter_aegisub"
|
||||
}
|
||||
}
|
|
@ -29,8 +29,6 @@
|
|||
|
||||
#include <boost/range/algorithm.hpp>
|
||||
|
||||
#define HUNSPELL_STATIC
|
||||
#undef near
|
||||
#include <hunspell/hunspell.hxx>
|
||||
|
||||
HunspellSpellChecker::HunspellSpellChecker()
|
||||
|
|
Loading…
Reference in a new issue