@ -1,50 +1,52 @@ |
|||||
cmake_minimum_required(VERSION 3.14 FATAL_ERROR) |
cmake_minimum_required(VERSION 3.14 FATAL_ERROR) |
||||
|
|
||||
project(wenet VERSION 0.2) |
|
||||
|
project(wenet VERSION 0.1) |
||||
|
# 测试模块参数设置 |
||||
|
option(GRPC "build with gRPC" OFF) |
||||
|
option(GFLAGS "build with GLOGS" ON) |
||||
|
option(GLOGS "build with GLOGS" OFF) |
||||
|
option(ONNX "build with ONNX" OFF) |
||||
|
option(OPENFST "build with FST" OFF) |
||||
|
option(CLEAN_CMAKE_CACHE "更换Build目录运行需要清空缓存" OFF) |
||||
|
|
||||
|
|
||||
# set color |
# set color |
||||
string(ASCII 27 Esc) |
string(ASCII 27 Esc) |
||||
set(ColourReset "${Esc}[m") |
set(ColourReset "${Esc}[m") |
||||
set(BoldGreen "${Esc}[1;32m") |
set(BoldGreen "${Esc}[1;32m") |
||||
set(BoldRed "${Esc}[31m") |
set(BoldRed "${Esc}[31m") |
||||
# 运行参数 |
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread -fPIC -w") |
|
||||
set(LIB_BASE_DIR /root/CXX_ENVS/wenet_runtime) |
|
||||
set(third_party_libraries) |
|
||||
option(GRPC "whether to build with gRPC" ON) |
|
||||
option(ONNX "whether to build with ONNX" ON) |
|
||||
option(CLEAN_CMAKE_CACHE "是否清空cmake缓存重新构建" ON) |
|
||||
|
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux) |
|
||||
|
set(third_party_libraries) |
||||
|
set(LIB_BASE_DIR /root/projects/temp_xiaoke/asr_runtime/lib_files) |
||||
#清空缓存 |
#清空缓存 |
||||
if(CLEAN_CMAKE_CACHE) |
if(CLEAN_CMAKE_CACHE) |
||||
message(STATUS "Cleaning CMakeCache.txt") |
message(STATUS "Cleaning CMakeCache.txt") |
||||
execute_process( |
execute_process( |
||||
COMMAND find . -name "CMakeCache*" -exec rm -rf {} \; |
|
||||
|
COMMAND find . -name "CMake*" -exec rm -rf {} \; |
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
||||
) |
) |
||||
endif () |
endif () |
||||
# Model Option |
|
||||
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux) |
||||
|
if(GFLAGS) |
||||
|
include(gflags) |
||||
|
add_executable(gflags_main "gflags.cc") |
||||
|
elseif(GLOGS) |
||||
|
include(gflags) |
||||
|
include(glog) |
||||
|
add_executable(glog_main "glogs.cc") |
||||
|
target_link_libraries(glog_main ${third_party_libraries}) |
||||
|
elseif (GRPC) |
||||
|
include(grpc) |
||||
|
add_subdirectory(bin_test_grpc) |
||||
|
endif() |
||||
|
|
||||
if(ONNX) |
if(ONNX) |
||||
include(onnx) |
include(onnx) |
||||
|
add_executable(onnx_main "onnx.cc") |
||||
|
target_link_libraries(onnx_main PRIVATE ${third_party_libraries}) |
||||
endif() |
endif() |
||||
|
|
||||
include(openfst) |
|
||||
#wenet个人项目内容 |
|
||||
include_directories( |
|
||||
${OPENFST_INCLUDE_DIR} |
|
||||
${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) |
|
||||
add_subdirectory(grpc) |
|
||||
|
if(OPENFST) |
||||
|
include(openfst) |
||||
|
add_executable(fst_main "fst.cc") |
||||
|
target_link_libraries(fst_main PRIVATE ${third_party_libraries}) |
||||
endif() |
endif() |
||||
|
|
||||
# Build all bins |
|
||||
add_subdirectory(bin) |
|
@ -0,0 +1,50 @@ |
|||||
|
cmake_minimum_required(VERSION 3.14 FATAL_ERROR) |
||||
|
|
||||
|
project(wenet VERSION 0.2) |
||||
|
# set color |
||||
|
string(ASCII 27 Esc) |
||||
|
set(ColourReset "${Esc}[m") |
||||
|
set(BoldGreen "${Esc}[1;32m") |
||||
|
set(BoldRed "${Esc}[31m") |
||||
|
# 运行参数 |
||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -pthread -fPIC -w") |
||||
|
set(LIB_BASE_DIR /root/CXX_ENVS/wenet_runtime) |
||||
|
set(third_party_libraries) |
||||
|
option(GRPC "whether to build with gRPC" ON) |
||||
|
option(ONNX "whether to build with ONNX" ON) |
||||
|
option(CLEAN_CMAKE_CACHE "是否清空cmake缓存重新构建" ON) |
||||
|
|
||||
|
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake-linux) |
||||
|
#清空缓存 |
||||
|
if(CLEAN_CMAKE_CACHE) |
||||
|
message(STATUS "Cleaning CMakeCache.txt") |
||||
|
execute_process( |
||||
|
COMMAND find . -name "CMakeCache*" -exec rm -rf {} \; |
||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
||||
|
) |
||||
|
endif () |
||||
|
# Model Option |
||||
|
if(ONNX) |
||||
|
include(onnx) |
||||
|
endif() |
||||
|
|
||||
|
include(openfst) |
||||
|
#wenet个人项目内容 |
||||
|
include_directories( |
||||
|
${OPENFST_INCLUDE_DIR} |
||||
|
${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) |
||||
|
add_subdirectory(grpc) |
||||
|
endif() |
||||
|
|
||||
|
# Build all bins |
||||
|
add_subdirectory(bin) |
@ -1,49 +0,0 @@ |
|||||
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() |
|