|
@ -31,7 +31,6 @@ if(TARGET gflags) |
|
|
endif() |
|
|
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) |
|
|
include(glog) |
|
|
include(glog) |
|
|
message(STATUS "${BoldGreen}Find Package glog: ${glog_FOUND}${ColourReset}") |
|
|
|
|
|
# 下面这堆关键字是防止cmake出一堆无关的提示 |
|
|
# 下面这堆关键字是防止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) |
|
@ -48,15 +47,14 @@ set(HAVE_LOOKAHEAD OFF CACHE BOOL "Build lookahead" FORCE) |
|
|
set(HAVE_NGRAM OFF CACHE BOOL "Build ngram" FORCE) |
|
|
set(HAVE_NGRAM OFF CACHE BOOL "Build ngram" FORCE) |
|
|
set(HAVE_SPECIAL OFF CACHE BOOL "Build special" FORCE) |
|
|
set(HAVE_SPECIAL OFF CACHE BOOL "Build special" FORCE) |
|
|
|
|
|
|
|
|
find_package(openfst REQUIRED CONFIG HINTS ${openfst_ROOT}) |
|
|
|
|
|
message(STATUS "${BoldGreen}Find Package openfst: ${openfst_FOUND}${ColourReset}") |
|
|
|
|
|
|
|
|
|
|
|
include_directories(${openfst_ROOT}/src/include) |
|
|
include_directories(${openfst_ROOT}/src/include) |
|
|
|
|
|
|
|
|
message(STATUS "${BoldGreen}openfst_BINARY_DIR: ${openfst_BINARY_DIR}${ColourReset}") |
|
|
|
|
|
|
|
|
|
|
|
add_dependencies(fst ${third_party_libraries}) |
|
|
|
|
|
|
|
|
|
|
|
target_link_libraries(fst PUBLIC gflags_nothreads_static glog dl) |
|
|
|
|
|
|
|
|
if (EXISTS ${openfst_BUILD}/src/lib/libfst.so) |
|
|
|
|
|
add_library(fst SHARED IMPORTED) |
|
|
|
|
|
set_property(TARGET fst PROPERTY IMPORTED_LOCATION ${openfst_BUILD}/src/lib/libfst.so) |
|
|
|
|
|
message(STATUS "${BoldGreen}Find Library libfst.so: ${openfst_BUILD}/src/lib/${ColourReset}") |
|
|
|
|
|
else () |
|
|
|
|
|
message(FATAL_ERROR "${BoldRed}Can't find openfst library from: ${openfst_BUILD}/src/lib ${ColourReset}") |
|
|
|
|
|
endif () |
|
|
|
|
|
|
|
|
list(APPEND third_party_libraries fst) |
|
|
|
|
|
|
|
|
list(APPEND third_party_libraries fst gflags_nothreads_static glog dl) |