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.

42 lines
1.1 KiB

  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. # -build和-subbuild文件夹在的地方
  17. set(LIB_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib_files)
  18. set(FETCHCONTENT_BASE_DIR ${LIB_BASE_DIR})
  19. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-local)
  20. if(GLOGS)
  21. include(gflags)
  22. include(glog)
  23. add_executable(glog_main "glogs.cc")
  24. target_link_libraries(glog_main ${third_party_libraries})
  25. endif()
  26. if(GRPC)
  27. include(grpc)
  28. add_subdirectory(bin_grpc)
  29. endif()
  30. if(ONNX)
  31. include(onnx)
  32. add_executable(main "onnx.cc")
  33. target_link_libraries(onnx_main ${third_party_libraries})
  34. endif()
  35. if(OPENFST)
  36. include(openfst)
  37. add_executable(fst_main "fst.cc")
  38. target_link_libraries(fst_main ${third_party_libraries} dl)
  39. endif()