You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.3 KiB

  1. cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
  2. project(kaldi)
  3. include_directories(${CMAKE_CURRENT_SOURCE_DIR})
  4. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread -fPIC -w")
  5. # include_directories() is called in the root CMakeLists.txt.test.bak1.bak
  6. add_library(kaldi-util
  7. base/kaldi-error.cc
  8. base/kaldi-math.cc
  9. util/kaldi-io.cc
  10. util/parse-options.cc
  11. util/simple-io-funcs.cc
  12. util/text-utils.cc
  13. )
  14. target_link_libraries(kaldi-util PUBLIC utils)
  15. add_library(kaldi-decoder
  16. lat/determinize-lattice-pruned.cc
  17. lat/lattice-functions.cc
  18. decoder/lattice-faster-decoder.cc
  19. decoder/lattice-faster-online-decoder.cc
  20. )
  21. target_link_libraries(kaldi-decoder PUBLIC kaldi-util)
  22. if(GRAPH_TOOLS)
  23. # Arpa binary
  24. add_executable(arpa2fst
  25. lm/arpa-file-parser.cc
  26. lm/arpa-lm-compiler.cc
  27. lmbin/arpa2fst.cc
  28. )
  29. target_link_libraries(arpa2fst PUBLIC kaldi-util)
  30. # FST tools binary
  31. set(FST_BINS
  32. fstaddselfloops
  33. fstdeterminizestar
  34. fstisstochastic
  35. fstminimizeencoded
  36. fsttablecompose
  37. )
  38. if(NOT MSVC)
  39. # dl is for dynamic linking, otherwise there is a linking error on linux
  40. link_libraries(dl)
  41. endif()
  42. foreach(name IN LISTS FST_BINS)
  43. add_executable(${name}
  44. fstbin/${name}.cc
  45. fstext/kaldi-fst-io.cc
  46. )
  47. target_link_libraries(${name} PUBLIC kaldi-util)
  48. endforeach()
  49. endif()