You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.0 KiB

  1. # We can't build glog with gflags, unless gflags is pre-installed.
  2. # If build glog with pre-installed gflags, there will be conflict.
  3. #message(STATUS "${BoldGreen}glog: ${glog_SOURCE_DIR}${ColourReset}")
  4. set(openfst_BUILD "${LIB_BASE_DIR}/openfst-build")
  5. if(NOT EXISTS ${openfst_BUILD})
  6. # install openfst
  7. #./configure --prefix=${openfst_SOURCE_DIR}/build --enable-static --disable-shared --with-pic
  8. execute_process(
  9. COMMAND ./configure --prefix=${openfst_BUILD}
  10. WORKING_DIRECTORY ${LIB_BASE_DIR}/openfst-src)
  11. execute_process(
  12. COMMAND cmake --build . --target install
  13. WORKING_DIRECTORY ${openfst_BUILD})
  14. execute_process(
  15. COMMAND cmake --install .
  16. WORKING_DIRECTORY ${openfst_BUILD})
  17. endif()
  18. # We can't build glog with gflags, unless gflags is pre-installed.
  19. # If build glog with pre-installed gflags, there will be conflict.
  20. find_package(gflags)
  21. set(WITH_GFLAGS OFF CACHE BOOL "whether build glog with gflags" FORCE)
  22. find_package(glog)
  23. if(NOT GRAPH_TOOLS)
  24. set(HAVE_BIN OFF CACHE BOOL "Build the fst binaries" FORCE)
  25. set(HAVE_SCRIPT OFF CACHE BOOL "Build the fstscript" FORCE)
  26. endif()
  27. set(HAVE_COMPACT OFF CACHE BOOL "Build compact" FORCE)
  28. set(HAVE_CONST OFF CACHE BOOL "Build const" FORCE)
  29. set(HAVE_GRM OFF CACHE BOOL "Build grm" FORCE)
  30. set(HAVE_FAR OFF CACHE BOOL "Build far" FORCE)
  31. set(HAVE_PDT OFF CACHE BOOL "Build pdt" FORCE)
  32. set(HAVE_MPDT OFF CACHE BOOL "Build mpdt" FORCE)
  33. set(HAVE_LINEAR OFF CACHE BOOL "Build linear" FORCE)
  34. set(HAVE_LOOKAHEAD OFF CACHE BOOL "Build lookahead" FORCE)
  35. set(HAVE_NGRAM OFF CACHE BOOL "Build ngram" FORCE)
  36. set(HAVE_SPECIAL OFF CACHE BOOL "Build special" FORCE)
  37. FetchContent_Declare(openfst
  38. SOURCE_DIR ${LIB_BASE_DIR}/openfst-src)
  39. #
  40. FetchContent_MakeAvailable(openfst)
  41. include_directories(${openfst_SOURCE_DIR}/src/include)
  42. set(openfst_BINARY_DIR "${grpc_build_dir}/src/lib")
  43. add_dependencies(fst glog::glog gflags)
  44. list(APPEND third_party_libraries fst glog::glog gflags)
  45. #list(APPEND third_party_libraries )
  46. #