CMakeLists.txt 1.62 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
################################################################################
# ffmpeg
################################################################################
if (BUILD_FFMPEG)
moto's avatar
moto committed
20
21
  set(FFMPEG_FIND_COMPONENTS avdevice avfilter avformat avcodec avutil)
  include(FindFFMPEG)
22
  add_library(ffmpeg INTERFACE)
moto's avatar
moto committed
23
24
  target_include_directories(ffmpeg INTERFACE ${FFMPEG_INCLUDE_DIRS})
  target_link_libraries(ffmpeg INTERFACE ${FFMPEG_LIBRARIES})
25
26
endif()

moto's avatar
moto committed
27
28
29
30
31
32
33
34
################################################################################
# kaldi
################################################################################
if (BUILD_KALDI)
  add_subdirectory(kaldi)
  list(APPEND TORCHAUDIO_THIRD_PARTIES kaldi)
endif()

moto's avatar
moto committed
35
set_property(GLOBAL PROPERTY TORCHAUDIO_THIRD_PARTIES "${TORCHAUDIO_THIRD_PARTIES}")
moto's avatar
moto committed
36
37
38
39

################################################################################
# KenLM
################################################################################
40
if (BUILD_CTC_DECODER)
moto's avatar
moto committed
41
42
43
44
45
46
  add_subdirectory(zlib)
  add_subdirectory(bzip2)
  add_subdirectory(lzma)
  add_subdirectory(boost)
  add_subdirectory(kenlm)
endif()