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.

51 lines
1.4 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
  1. cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
  2. project(wenet VERSION 0.1)
  3. # 测试模块参数设置
  4. option(GRPC "build with gRPC" OFF)
  5. option(GLOGS "build with GLOGS" OFF)
  6. option(ONNX "build with ONNX" OFF)
  7. option(OPENFST "build with FST" ON)
  8. option(CLEAN_CMAKE_CACHE "更换Build目录运行需要清空缓存" OFF)
  9. # set color
  10. string(ASCII 27 Esc)
  11. set(ColourReset "${Esc}[m")
  12. set(BoldGreen "${Esc}[1;32m")
  13. set(Red "${Esc}[31m")
  14. include(FetchContent)
  15. set(FETCHCONTENT_QUIET OFF)
  16. set(third_party_libraries)
  17. set(LIB_BASE_DIR /root/projects/temp_xiaoke/asr_runtime/lib_files)
  18. set(FETCHCONTENT_BASE_DIR ${LIB_BASE_DIR})
  19. #清空缓存
  20. if(CLEAN_CMAKE_CACHE)
  21. message(STATUS "Cleaning CMakeCache.txt")
  22. execute_process(
  23. COMMAND find . -name "CMake*" -exec rm -rf {} \;
  24. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  25. )
  26. endif ()
  27. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux)
  28. if(GLOGS)
  29. include(gflags)
  30. include(glog)
  31. add_executable(glog_main "glogs.cc")
  32. target_link_libraries(glog_main ${third_party_libraries})
  33. endif()
  34. if(GRPC)
  35. include(grpc)
  36. add_subdirectory(bin_grpc)
  37. endif()
  38. if(ONNX)
  39. include(onnx)
  40. add_executable(onnx_main "onnx.cc")
  41. target_link_libraries(onnx_main PRIVATE ${third_party_libraries})
  42. endif()
  43. if(OPENFST)
  44. include(openfst)
  45. add_executable(fst_main bin_test_env/fst.cc)
  46. target_link_libraries(fst_main PRIVATE ${third_party_libraries})
  47. endif()