|
@ -18,10 +18,15 @@ if(NOT EXISTS ${openfst_BUILD}) |
|
|
endif() |
|
|
endif() |
|
|
# We can't build glog with gflags, unless gflags is pre-installed. |
|
|
# We can't build glog with gflags, unless gflags is pre-installed. |
|
|
# If build glog with pre-installed gflags, there will be conflict. |
|
|
# If build glog with pre-installed gflags, there will be conflict. |
|
|
|
|
|
# gflags和glog现在被我安装到了系统盘下/usr/lib/x86_64-linux-gnu |
|
|
find_package(gflags) |
|
|
find_package(gflags) |
|
|
|
|
|
if(TARGET gflags) |
|
|
|
|
|
message(STATUS "${BoldGreen}TARGET: ${gflags_FOUND}${ColourReset}") |
|
|
|
|
|
set_target_properties(gflags PROPERTIES INTERFACE_COMPILE_OPTIONS "-fPIC") |
|
|
|
|
|
endif() |
|
|
set(WITH_GFLAGS OFF CACHE BOOL "whether build glog with gflags" FORCE) |
|
|
set(WITH_GFLAGS OFF CACHE BOOL "whether build glog with gflags" FORCE) |
|
|
find_package(glog) |
|
|
find_package(glog) |
|
|
|
|
|
|
|
|
|
|
|
# 下面这堆关键字是防止cmake出一堆无关的提示 |
|
|
if(NOT GRAPH_TOOLS) |
|
|
if(NOT GRAPH_TOOLS) |
|
|
set(HAVE_BIN OFF CACHE BOOL "Build the fst binaries" FORCE) |
|
|
set(HAVE_BIN OFF CACHE BOOL "Build the fst binaries" FORCE) |
|
|
set(HAVE_SCRIPT OFF CACHE BOOL "Build the fstscript" FORCE) |
|
|
set(HAVE_SCRIPT OFF CACHE BOOL "Build the fstscript" FORCE) |
|
@ -39,14 +44,13 @@ set(HAVE_SPECIAL OFF CACHE BOOL "Build special" FORCE) |
|
|
|
|
|
|
|
|
FetchContent_Declare(openfst |
|
|
FetchContent_Declare(openfst |
|
|
SOURCE_DIR ${LIB_BASE_DIR}/openfst-src) |
|
|
SOURCE_DIR ${LIB_BASE_DIR}/openfst-src) |
|
|
# |
|
|
|
|
|
FetchContent_MakeAvailable(openfst) |
|
|
FetchContent_MakeAvailable(openfst) |
|
|
include_directories(${openfst_SOURCE_DIR}/src/include) |
|
|
|
|
|
set(openfst_BINARY_DIR "${grpc_build_dir}/src/lib") |
|
|
|
|
|
add_dependencies(fst glog::glog gflags) |
|
|
|
|
|
|
|
|
|
|
|
list(APPEND third_party_libraries fst glog::glog gflags) |
|
|
|
|
|
|
|
|
include_directories(${LIB_BASE_DIR}/openfst-src/src/include) |
|
|
|
|
|
message(STATUS "${BoldGreen}openfst_BINARY_DIR: ${openfst_BINARY_DIR}${ColourReset}") |
|
|
|
|
|
|
|
|
#list(APPEND third_party_libraries ) |
|
|
|
|
|
|
|
|
add_dependencies(fst gflags_nothreads_static glog::glog) |
|
|
|
|
|
#set_target_properties(fst PROPERTIES COMPILE_FLAGS "-fPIC") |
|
|
|
|
|
target_link_libraries(fst PUBLIC gflags_nothreads_static glog) |
|
|
|
|
|
|
|
|
# |
|
|
|
|
|
|
|
|
list(APPEND third_party_libraries fst) |