Browse Source

Changes

master
xiemingxian 1 year ago
parent
commit
fb5e75d76e
3 changed files with 11 additions and 7 deletions
  1. +4
    -2
      CMakeLists.txt
  2. +5
    -3
      cmake-local/glog.cmake
  3. +2
    -2
      cmake-local/openfst.cmake

+ 4
- 2
CMakeLists.txt

@ -14,7 +14,9 @@ set(Red "${Esc}[31m")
include(FetchContent) include(FetchContent)
set(FETCHCONTENT_QUIET OFF) set(FETCHCONTENT_QUIET OFF)
set(third_party_libraries) set(third_party_libraries)
# -build-subbuild
message(STATUS 111)
set(LIB_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib_files) set(LIB_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib_files)
set(FETCHCONTENT_BASE_DIR ${LIB_BASE_DIR}) set(FETCHCONTENT_BASE_DIR ${LIB_BASE_DIR})
@ -37,6 +39,6 @@ if(ONNX)
endif() endif()
if(OPENFST) if(OPENFST)
include(openfst) include(openfst)
add_executable(fst_main "fst.cc")
add_executable(fst_main bin_test/fst.cc)
target_link_libraries(fst_main PRIVATE ${third_party_libraries}) target_link_libraries(fst_main PRIVATE ${third_party_libraries})
endif() endif()

+ 5
- 3
cmake-local/glog.cmake

@ -1,8 +1,10 @@
#find_package(glog REQUIRED) #find_package(glog REQUIRED)
#list(APPEND third_party_libraries glog::glog) #list(APPEND third_party_libraries glog::glog)
#/usr/bin clion
set(GLOG_ROOT_DIR /root/projects/temp_xiaoke/asr_runtime/lib_files/glog-build)
find_package(glog REQUIRED CONFIG PATHS ${GLOG_ROOT_DIR})
set(GLOG_ROOT_DIR ${LIB_BASE_DIR}/glog-src)
find_package(glog REQUIRED CONFIG HINTS ${GLOG_ROOT_DIR})
set(GLOG_INCLUDE_DIR ${GLOG_ROOT_DIR}/include) set(GLOG_INCLUDE_DIR ${GLOG_ROOT_DIR}/include)
# glog::glog is imported target # glog::glog is imported target
list(APPEND third_party_libraries glog::glog)
list(APPEND third_party_libraries glog)

+ 2
- 2
cmake-local/openfst.cmake

@ -30,7 +30,7 @@ if(TARGET gflags)
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)
find_package(glog)
include(cmake-local/glog.cmake)
# 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)
@ -54,7 +54,7 @@ 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_nothreads_static glog::glog)
add_dependencies(fst gflags 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)

Loading…
Cancel
Save