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.

41 lines
1.1 KiB

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(ONNX "build with ONNX" OFF)
  6. option(GLOGS "build with GLOGS" OFF)
  7. option(OPENFST "build with FST" ON)
  8. # set color
  9. string(ASCII 27 Esc)
  10. set(ColourReset "${Esc}[m")
  11. set(BoldGreen "${Esc}[1;32m")
  12. set(Red "${Esc}[31m")
  13. include(FetchContent)
  14. set(FETCHCONTENT_QUIET OFF)
  15. set(third_party_libraries)
  16. set(LIB_BASE_DIR /root/projects/temp_xiaoke/asr_runtime/lib_files)
  17. set(FETCHCONTENT_BASE_DIR ${LIB_BASE_DIR})
  18. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-local)
  19. if(GLOGS)
  20. include(gflags)
  21. include(glog)
  22. add_executable(glog_main "glogs.cc")
  23. target_link_libraries(glog_main ${third_party_libraries})
  24. endif()
  25. if(GRPC)
  26. include(grpc)
  27. add_subdirectory(bin_grpc)
  28. endif()
  29. if(ONNX)
  30. include(onnx)
  31. add_executable(main "onnx.cc")
  32. target_link_libraries(onnx_main ${third_party_libraries})
  33. endif()
  34. if(OPENFST)
  35. include(openfst)
  36. add_executable(fst_main bin_test/fst.cc)
  37. target_link_libraries(fst_main PRIVATE ${third_party_libraries})
  38. endif()