|
|
find_package(PkgConfig REQUIRED) |
|
|
|
|
|
set(Optional_Pkgs "") |
|
|
if (USE_SYSTEM_FMT) |
|
|
list(APPEND Optional_Pkgs "fmt") |
|
|
endif () |
|
|
if (USE_SYSTEM_TOML) |
|
|
list(APPEND Optional_Pkgs "tomlplusplus") |
|
|
endif () |
|
|
if (WITH_ZIM) |
|
|
list(APPEND Optional_Pkgs "libzim") |
|
|
endif () |
|
|
if (WITH_FFMPEG_PLAYER) |
|
|
list(APPEND Optional_Pkgs "libavcodec;libavformat;libavutil;libswresample") |
|
|
endif () |
|
|
if (WITH_X11) |
|
|
set(X11_Pkgs "x11;xtst") |
|
|
target_compile_definitions(${GOLDENDICT} PUBLIC WITH_X11) |
|
|
endif () |
|
|
|
|
|
pkg_check_modules(DEPS REQUIRED IMPORTED_TARGET |
|
|
hunspell |
|
|
liblzma |
|
|
lzo2 |
|
|
opencc |
|
|
vorbis |
|
|
vorbisfile |
|
|
xapian-core |
|
|
zlib |
|
|
${X11_Pkgs} |
|
|
${Optional_Pkgs} |
|
|
) |
|
|
|
|
|
|
|
|
find_package(BZip2 REQUIRED) |
|
|
target_link_libraries(${GOLDENDICT} PRIVATE PkgConfig::DEPS BZip2::BZip2) |
|
|
|
|
|
|
|
|
|
|
|
if (BSD STREQUAL "FreeBSD") |
|
|
|
|
|
|
|
|
|
|
|
target_compile_definitions(${GOLDENDICT} PUBLIC LIBICONV_PLUG) |
|
|
else () |
|
|
find_package(Iconv REQUIRED) |
|
|
target_link_libraries(${GOLDENDICT} PRIVATE Iconv::Iconv) |
|
|
endif () |
|
|
|
|
|
if (WITH_EPWING_SUPPORT) |
|
|
find_library(EB_LIBRARY eb REQUIRED) |
|
|
target_link_libraries(${GOLDENDICT} PRIVATE ${EB_LIBRARY}) |
|
|
endif () |
|
|
|