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.

49 lines
1.3 KiB

  1. cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
  2. project(wenet VERSION 0.2)
  3. # set color
  4. string(ASCII 27 Esc)
  5. set(ColourReset "${Esc}[m")
  6. set(BoldGreen "${Esc}[1;32m")
  7. set(BoldRed "${Esc}[31m")
  8. # 运行参数
  9. set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread -fPIC -w")
  10. set(LIB_BASE_DIR /root/CXX_ENVS/wenet_runtime)
  11. set(third_party_libraries)
  12. option(GRPC "whether to build with gRPC" ON)
  13. option(ONNX "whether to build with ONNX" ON)
  14. option(CLEAN_CMAKE_CACHE "是否清空cmake缓存重新构建" ON)
  15. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux)
  16. #清空缓存
  17. if(CLEAN_CMAKE_CACHE)
  18. message(STATUS "Cleaning CMakeCache.txt")
  19. execute_process(
  20. COMMAND find . -name "CMakeCache*" -exec rm -rf {} \;
  21. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  22. )
  23. endif ()
  24. # Model Option
  25. if(ONNX)
  26. include(onnx)
  27. endif()
  28. include(openfst)
  29. #wenet个人项目内容
  30. include_directories(
  31. ${OPENFST_INCLUDE_DIR}
  32. ${CMAKE_CURRENT_SOURCE_DIR}
  33. ${CMAKE_CURRENT_SOURCE_DIR}/kaldi
  34. )
  35. # Build all libraries
  36. add_subdirectory(utils)
  37. add_subdirectory(frontend)
  38. add_subdirectory(post_processor)
  39. add_subdirectory(kaldi) # kaldi:
  40. add_subdirectory(decoder)
  41. # Connection Option
  42. if(GRPC)
  43. add_subdirectory(grpc)
  44. endif()
  45. # Build all bins
  46. add_subdirectory(bin)