From fb5e75d76efb0a995eef84629432f63951b1e1e0 Mon Sep 17 00:00:00 2001 From: xiemingxian <623158663@qq.com> Date: Wed, 8 May 2024 16:48:32 +0800 Subject: [PATCH] Changes --- CMakeLists.txt | 6 ++++-- cmake-local/glog.cmake | 8 +++++--- cmake-local/openfst.cmake | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 250118c..5bef488 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,9 @@ set(Red "${Esc}[31m") include(FetchContent) set(FETCHCONTENT_QUIET OFF) set(third_party_libraries) -# -build和-subbuild文件夹在的地方 + + +message(STATUS 111) set(LIB_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib_files) set(FETCHCONTENT_BASE_DIR ${LIB_BASE_DIR}) @@ -37,6 +39,6 @@ if(ONNX) endif() if(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}) endif() diff --git a/cmake-local/glog.cmake b/cmake-local/glog.cmake index 113d1ce..5c5dfd3 100644 --- a/cmake-local/glog.cmake +++ b/cmake-local/glog.cmake @@ -1,8 +1,10 @@ #find_package(glog REQUIRED) #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) # glog::glog is imported target -list(APPEND third_party_libraries glog::glog) \ No newline at end of file +list(APPEND third_party_libraries glog) \ No newline at end of file diff --git a/cmake-local/openfst.cmake b/cmake-local/openfst.cmake index c404422..d620910 100644 --- a/cmake-local/openfst.cmake +++ b/cmake-local/openfst.cmake @@ -30,7 +30,7 @@ if(TARGET gflags) set_target_properties(gflags PROPERTIES INTERFACE_COMPILE_OPTIONS "-fPIC") endif() set(WITH_GFLAGS OFF CACHE BOOL "whether build glog with gflags" FORCE) -find_package(glog) +include(cmake-local/glog.cmake) # 下面这堆关键字是防止cmake出一堆无关的提示 if(NOT GRAPH_TOOLS) 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) 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) list(APPEND third_party_libraries fst) \ No newline at end of file