From 580b11b57ac4b62f7e2acda73813a4e10e8e4cd3 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期二, 10 十月 2023 17:17:29 +0800
Subject: [PATCH] v0.8.0

---
 funasr/runtime/onnxruntime/CMakeLists.txt |   67 +++++++++++++--------------------
 1 files changed, 26 insertions(+), 41 deletions(-)

diff --git a/funasr/runtime/onnxruntime/CMakeLists.txt b/funasr/runtime/onnxruntime/CMakeLists.txt
index be337ed..b9a26b2 100644
--- a/funasr/runtime/onnxruntime/CMakeLists.txt
+++ b/funasr/runtime/onnxruntime/CMakeLists.txt
@@ -3,10 +3,12 @@
 project(FunASROnnx)
 
 option(ENABLE_GLOG "Whether to build glog" ON)
-option(ENABLE_WEBSOCKET "Whether to build websocket server" ON)
+option(ENABLE_FST "Whether to build openfst" ON) # ITN need openfst compiled
+
 # set(CMAKE_CXX_STANDARD 11)
 set(CMAKE_CXX_STANDARD 14 CACHE STRING "The C++ version to be used.")
 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
 
 include(TestBigEndian)
 test_big_endian(BIG_ENDIAN)
@@ -25,51 +27,34 @@
 	endif()
 ELSE()
     link_directories(${ONNXRUNTIME_DIR}/lib)
-endif()
-
-if(ENABLE_WEBSOCKET)
-  cmake_policy(SET CMP0135 NEW)
-
-  include(FetchContent)
-  FetchContent_Declare(websocketpp
-  GIT_REPOSITORY https://github.com/zaphoyd/websocketpp.git
-    GIT_TAG 0.8.2
-    SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/websocket
-    )
-  
-  FetchContent_MakeAvailable(websocketpp)
-  include_directories(${PROJECT_SOURCE_DIR}/third_party/websocket)
-  add_subdirectory(third_party/websocket)
-
-  FetchContent_Declare(asio
-     URL   https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-24-0.tar.gz
-   SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/asio
-  )
-  
-  FetchContent_MakeAvailable(asio)
-  include_directories(${PROJECT_SOURCE_DIR}/third_party/asio/asio/include)
- 
-  FetchContent_Declare(json
-     URL   https://github.com/nlohmann/json/archive/refs/tags/v3.11.2.tar.gz
-   SOURCE_DIR ${PROJECT_SOURCE_DIR}/third_party/json
-  )
-  
-  FetchContent_MakeAvailable(json)
-  include_directories(${PROJECT_SOURCE_DIR}/third_party/json/include)
- 
+    link_directories(${FFMPEG_DIR}/lib)
 endif()
 
 include_directories(${PROJECT_SOURCE_DIR}/third_party/kaldi-native-fbank)
 include_directories(${PROJECT_SOURCE_DIR}/third_party/yaml-cpp/include)
 
+if(ENABLE_GLOG)
+    include_directories(${PROJECT_SOURCE_DIR}/third_party/glog/src)
+    set(BUILD_TESTING OFF)
+    add_subdirectory(third_party/glog)
+    include_directories(${glog_BINARY_DIR})
+    
+endif()
+
+if(ENABLE_FST)
+    # fst depend on glog and gflags
+    include_directories(${PROJECT_SOURCE_DIR}/third_party/gflags)
+    add_subdirectory(third_party/gflags)
+    include_directories(${gflags_BINARY_DIR}/include)
+    
+    # the following openfst if cloned from https://github.com/kkm000/openfst.git
+    # with some patch to fix the make errors. 
+    add_subdirectory(third_party/openfst)
+    include_directories(${openfst_SOURCE_DIR}/src/include)
+    
+endif()
+
 add_subdirectory(third_party/yaml-cpp)
 add_subdirectory(third_party/kaldi-native-fbank/kaldi-native-fbank/csrc)
 add_subdirectory(src)
-
-if(ENABLE_GLOG)
-    include_directories(${PROJECT_SOURCE_DIR}/third_party/glog)
-    set(BUILD_TESTING OFF)
-    add_subdirectory(third_party/glog)
-endif()
-
-
+add_subdirectory(bin)

--
Gitblit v1.9.1