Browse Source

2024.5.9-无fetch_content版本构建

master
Administrator 1 year ago
parent
commit
168485f2e9
11 changed files with 74 additions and 47 deletions
  1. +24
    -40
      CMakeLists.txt
  2. +0
    -6
      CMakeLists.txt.bak1
  3. +49
    -0
      CMakeLists.txt.test
  4. +0
    -0
      bin_test_grpc/CMakeLists.txt
  5. +0
    -0
      bin_test_grpc/greeter_async_client.cc
  6. +0
    -0
      bin_test_grpc/greeter_async_client2.cc
  7. +0
    -0
      bin_test_grpc/greeter_async_server.cc
  8. +0
    -0
      bin_test_grpc/greeter_client.cc
  9. +0
    -0
      bin_test_grpc/greeter_server.cc
  10. +0
    -0
      bin_test_grpc/helloworld.proto
  11. +1
    -1
      kaldi/CMakeLists.txt

+ 24
- 40
CMakeLists.txt

@ -1,49 +1,33 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR) cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(wenet VERSION 0.1)
#
option(GRPC "build with gRPC" OFF)
option(GLOGS "build with GLOGS" OFF)
option(ONNX "build with ONNX" OFF)
option(OPENFST "build with FST" ON)
option(CLEAN_CMAKE_CACHE "更换Build目录运行需要清空缓存" OFF)
project(wenet VERSION 0.2)
#
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread -fPIC")
option(GRPC "whether to build with gRPC" ON)
option(ONNX "whether to build with ONNX" ON)
# set color
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(BoldGreen "${Esc}[1;32m")
set(BoldRed "${Esc}[31m")
set(third_party_libraries)
set(LIB_BASE_DIR /root/projects/temp_xiaoke/asr_runtime/lib_files)
#
if(CLEAN_CMAKE_CACHE)
message(STATUS "Cleaning CMakeCache.txt")
execute_process(
COMMAND find . -name "CMake*" -exec rm -rf {} \;
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif ()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux)
if(GLOGS)
include(gflags)
include(glog)
add_executable(glog_main "glogs.cc")
target_link_libraries(glog_main ${third_party_libraries})
# Model Option
if(ONNX)
include(onnx)
endif() endif()
include(openfst)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/kaldi
)
# Build all libraries
add_subdirectory(utils)
add_subdirectory(frontend)
add_subdirectory(post_processor)
add_subdirectory(kaldi) # kaldi:
add_subdirectory(decoder)
#Connection Option
if(GRPC) if(GRPC)
include(grpc) include(grpc)
add_subdirectory(bin_grpc)
add_subdirectory(grpc)
endif() endif()
if(ONNX)
include(onnx)
add_executable(onnx_main "onnx.cc")
target_link_libraries(onnx_main PRIVATE ${third_party_libraries})
endif()
if(OPENFST)
include(openfst)
add_executable(fst_main "fst.cc")
target_link_libraries(fst_main PRIVATE ${third_party_libraries})
endif()
# Build all bins
add_subdirectory(bin)

+ 0
- 6
CMakeLists.txt.bak1

@ -1,6 +0,0 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(wenet VERSION 0.2)
option(GRPC "whether to build with gRPC" ON)
option(ONNX "whether to build with ONNX" ON)

+ 49
- 0
CMakeLists.txt.test

@ -0,0 +1,49 @@
cmake_minimum_required(VERSION 3.14 FATAL_ERROR)
project(wenet VERSION 0.1)
# 测试模块参数设置
option(GRPC "build with gRPC" OFF)
option(GLOGS "build with GLOGS" OFF)
option(ONNX "build with ONNX" OFF)
option(OPENFST "build with FST" ON)
option(CLEAN_CMAKE_CACHE "更换Build目录运行需要清空缓存" OFF)
# set color
string(ASCII 27 Esc)
set(ColourReset "${Esc}[m")
set(BoldGreen "${Esc}[1;32m")
set(BoldRed "${Esc}[31m")
set(third_party_libraries)
set(LIB_BASE_DIR /root/projects/temp_xiaoke/asr_runtime/lib_files)
#清空缓存
if(CLEAN_CMAKE_CACHE)
message(STATUS "Cleaning CMakeCache.txt")
execute_process(
COMMAND find . -name "CMake*" -exec rm -rf {} \;
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
endif ()
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux)
if(GLOGS)
include(gflags)
include(glog)
add_executable(glog_main "glogs.cc")
target_link_libraries(glog_main ${third_party_libraries})
endif()
if(GRPC)
include(grpc)
add_subdirectory(bin_test_grpc)
endif()
if(ONNX)
include(onnx)
add_executable(onnx_main "onnx.cc")
target_link_libraries(onnx_main PRIVATE ${third_party_libraries})
endif()
if(OPENFST)
include(openfst)
add_executable(fst_main "fst.cc")
target_link_libraries(fst_main PRIVATE ${third_party_libraries})
endif()

bin_grpc/CMakeLists.txt → bin_test_grpc/CMakeLists.txt


bin_grpc/greeter_async_client.cc → bin_test_grpc/greeter_async_client.cc


bin_grpc/greeter_async_client2.cc → bin_test_grpc/greeter_async_client2.cc


bin_grpc/greeter_async_server.cc → bin_test_grpc/greeter_async_server.cc


bin_grpc/greeter_client.cc → bin_test_grpc/greeter_client.cc


bin_grpc/greeter_server.cc → bin_test_grpc/greeter_server.cc


bin_grpc/helloworld.proto → bin_test_grpc/helloworld.proto


+ 1
- 1
kaldi/CMakeLists.txt

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
project(kaldi) project(kaldi)
# include_directories() is called in the root CMakeLists.txt.bak1.bak
# include_directories() is called in the root CMakeLists.txt.test.bak1.bak
add_library(kaldi-util add_library(kaldi-util
base/kaldi-error.cc base/kaldi-error.cc

Loading…
Cancel
Save