CMakeLists.txt 1.77 KB
Newer Older
moto's avatar
moto committed
1
set(TORCHAUDIO_THIRD_PARTIES "")
moto's avatar
moto committed
2

moto's avatar
moto committed
3
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden")
moto's avatar
moto committed
4

moto's avatar
moto committed
5
6
7
8
################################################################################
# sox
################################################################################
add_library(libsox INTERFACE)
moto's avatar
moto committed
9
if (BUILD_SOX)
10
  add_subdirectory(sox)
moto's avatar
moto committed
11
12
  target_include_directories(libsox INTERFACE ${SOX_INCLUDE_DIR})
  target_link_libraries(libsox INTERFACE ${SOX_LIBRARIES})
Caroline Chen's avatar
Caroline Chen committed
13
  list(APPEND TORCHAUDIO_THIRD_PARTIES libsox)
moto's avatar
moto committed
14
endif()
15

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
################################################################################
# ffmpeg
################################################################################
if (BUILD_FFMPEG)
  find_package(PkgConfig REQUIRED)
  pkg_check_modules(LIBAV REQUIRED IMPORTED_TARGET
    # requires ffmpeg>=4.1
    libavdevice>=58
    libavfilter>=7
    libavformat>=58
    libavcodec>=58
    libswresample>=3
    libswscale>=3
    libavutil>=56
    )
  add_library(ffmpeg INTERFACE)
  target_include_directories(ffmpeg INTERFACE ${LIBAV_INCLUDE_DIRS})
  target_link_libraries(ffmpeg INTERFACE ${LIBAV_LINK_LIBRARIES})
endif()

moto's avatar
moto committed
36
37
38
39
40
41
42
43
################################################################################
# kaldi
################################################################################
if (BUILD_KALDI)
  add_subdirectory(kaldi)
  list(APPEND TORCHAUDIO_THIRD_PARTIES kaldi)
endif()

moto's avatar
moto committed
44
set_property(GLOBAL PROPERTY TORCHAUDIO_THIRD_PARTIES "${TORCHAUDIO_THIRD_PARTIES}")
moto's avatar
moto committed
45
46
47
48

################################################################################
# KenLM
################################################################################
49
if (BUILD_CTC_DECODER)
moto's avatar
moto committed
50
51
52
53
54
55
  add_subdirectory(zlib)
  add_subdirectory(bzip2)
  add_subdirectory(lzma)
  add_subdirectory(boost)
  add_subdirectory(kenlm)
endif()