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.

53 lines
1.5 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(GFLAGS "build with GLOGS" ON)
  6. option(GLOGS "build with GLOGS" OFF)
  7. option(ONNX "build with ONNX" OFF)
  8. option(OPENFST "build with FST" OFF)
  9. option(CLEAN_CMAKE_CACHE "更换Build目录运行需要清空缓存" OFF)
  10. # set color
  11. string(ASCII 27 Esc)
  12. set(ColourReset "${Esc}[m")
  13. set(BoldGreen "${Esc}[1;32m")
  14. set(BoldRed "${Esc}[31m")
  15. set(third_party_libraries)
  16. set(LIB_BASE_DIR /root/projects/temp_xiaoke/asr_runtime/lib_files)
  17. #清空缓存
  18. if(CLEAN_CMAKE_CACHE)
  19. message(STATUS "Cleaning CMakeCache.txt")
  20. execute_process(
  21. COMMAND find . -name "CMake*" -exec rm -rf {} \;
  22. WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
  23. )
  24. endif ()
  25. list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux)
  26. if(GFLAGS)
  27. include(gflags)
  28. add_executable(gflags_main "gflags.cc")
  29. target_link_libraries(gflags_main ${GFLAGS_LIBRARY_NOTHREADS})
  30. elseif(GLOGS)
  31. include(gflags)
  32. include(glog)
  33. add_executable(glog_main "glogs.cc")
  34. target_link_libraries(glog_main ${third_party_libraries})
  35. elseif (GRPC)
  36. include(grpc)
  37. add_subdirectory(bin_test_grpc)
  38. endif()
  39. if(ONNX)
  40. include(onnx)
  41. add_executable(onnx_main "onnx.cc")
  42. target_link_libraries(onnx_main PRIVATE ${third_party_libraries})
  43. endif()
  44. if(OPENFST)
  45. include(openfst)
  46. add_executable(fst_main "fst.cc")
  47. target_link_libraries(fst_main PRIVATE ${third_party_libraries})
  48. endif()