|
|
@ -1,11 +1,16 @@ |
|
|
|
# We can't build glog with gflags, unless gflags is pre-installed. |
|
|
|
# If build glog with pre-installed gflags, there will be conflict. |
|
|
|
#message(STATUS "${BoldGreen}glog: ${glog_SOURCE_DIR}${ColourReset}") |
|
|
|
message(STATUS "${BoldGreen}CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}${ColourReset}") |
|
|
|
|
|
|
|
set(openfst_BUILD "${LIB_BASE_DIR}/openfst-build") |
|
|
|
if(NOT EXISTS ${openfst_BUILD}) |
|
|
|
# install openfst |
|
|
|
#./configure --prefix=${openfst_SOURCE_DIR}/build --enable-static --disable-shared --with-pic |
|
|
|
# patch补丁必须打,不然会报glog无法动态识别这个库的方法,导致链接不成功。 |
|
|
|
execute_process( |
|
|
|
COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/patch/openfst ${LIB_BASE_DIR}/openfst-src |
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
|
|
|
) |
|
|
|
execute_process( |
|
|
|
COMMAND ./configure --prefix=${openfst_BUILD} |
|
|
|
WORKING_DIRECTORY ${LIB_BASE_DIR}/openfst-src) |
|
|
@ -50,7 +55,6 @@ include_directories(${LIB_BASE_DIR}/openfst-src/src/include) |
|
|
|
message(STATUS "${BoldGreen}openfst_BINARY_DIR: ${openfst_BINARY_DIR}${ColourReset}") |
|
|
|
|
|
|
|
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) |