|
@ -1,6 +1,6 @@ |
|
|
# 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. |
|
|
message(STATUS "${BoldGreen}CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}${ColourReset}") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
set(openfst_BUILD "${LIB_BASE_DIR}/openfst-build") |
|
|
set(openfst_BUILD "${LIB_BASE_DIR}/openfst-build") |
|
|
if(NOT EXISTS ${openfst_BUILD}) |
|
|
if(NOT EXISTS ${openfst_BUILD}) |
|
@ -24,13 +24,14 @@ 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 |
|
|
# gflags和glog现在被我安装到了系统盘下/usr/lib/x86_64-linux-gnu |
|
|
find_package(gflags) |
|
|
|
|
|
|
|
|
include(gflags) |
|
|
if(TARGET gflags) |
|
|
if(TARGET gflags) |
|
|
message(STATUS "${BoldGreen}TARGET: ${gflags_FOUND}${ColourReset}") |
|
|
|
|
|
|
|
|
message(STATUS "${BoldGreen}Find Package gflags: ${gflags_FOUND}${ColourReset}") |
|
|
set_target_properties(gflags PROPERTIES INTERFACE_COMPILE_OPTIONS "-fPIC") |
|
|
set_target_properties(gflags PROPERTIES INTERFACE_COMPILE_OPTIONS "-fPIC") |
|
|
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(cmake-local/glog.cmake) |
|
|
|
|
|
|
|
|
find_package(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) |
|
@ -52,9 +53,11 @@ FetchContent_Declare(openfst |
|
|
FetchContent_MakeAvailable(openfst) |
|
|
FetchContent_MakeAvailable(openfst) |
|
|
|
|
|
|
|
|
include_directories(${LIB_BASE_DIR}/openfst-src/src/include) |
|
|
include_directories(${LIB_BASE_DIR}/openfst-src/src/include) |
|
|
|
|
|
|
|
|
message(STATUS "${BoldGreen}openfst_BINARY_DIR: ${openfst_BINARY_DIR}${ColourReset}") |
|
|
message(STATUS "${BoldGreen}openfst_BINARY_DIR: ${openfst_BINARY_DIR}${ColourReset}") |
|
|
|
|
|
|
|
|
add_dependencies(fst gflags glog) |
|
|
|
|
|
|
|
|
add_dependencies(fst gflags glog::glog) |
|
|
|
|
|
|
|
|
target_link_libraries(fst PUBLIC gflags_nothreads_static glog) |
|
|
target_link_libraries(fst PUBLIC gflags_nothreads_static glog) |
|
|
|
|
|
|
|
|
list(APPEND third_party_libraries fst) |
|
|
list(APPEND third_party_libraries fst) |