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.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(BoldRed "${Esc}[31m")
  14. set(third_party_libraries)
  15. set(LIB_BASE_DIR /root/projects/temp_xiaoke/asr_runtime/lib_files)
  16. #清空缓存
  17. if(CLEAN_CMAKE_CACHE)
  18. message(STATUS "Cleaning CMakeCache.txt")
  19. execute_process(
  20. COMMAND find . -name "CMake*" -exec rm -rf {} \;
  21. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  22. )
  23. endif ()
  24. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux)
  25. if(GLOGS)
  26. include(gflags)
  27. include(glog)
  28. add_executable(glog_main "glogs.cc")
  29. target_link_libraries(glog_main ${third_party_libraries})
  30. endif()
  31. if(GRPC)
  32. include(grpc)
  33. add_subdirectory(bin_test_grpc)
  34. endif()
  35. if(ONNX)
  36. include(onnx)
  37. add_executable(onnx_main "onnx.cc")
  38. target_link_libraries(onnx_main PRIVATE ${third_party_libraries})
  39. endif()
  40. if(OPENFST)
  41. include(openfst)
  42. add_executable(fst_main "fst.cc")
  43. target_link_libraries(fst_main PRIVATE ${third_party_libraries})
  44. endif()