Skip to content

Commit

Permalink
Fix pkg-config
Browse files Browse the repository at this point in the history
  • Loading branch information
csukuangfj committed Oct 7, 2023
1 parent 5e36cba commit fdc5671
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
18 changes: 15 additions & 3 deletions cmake/kaldi-decoder.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,25 @@ function(download_kaldi_decoder)
${kaldi-decoder_SOURCE_DIR}/
)
if(SHERPA_ONNX_ENABLE_PYTHON AND WIN32)
install(TARGETS kaldi-decoder-core DESTINATION ..)
install(TARGETS
kaldi-decoder-core
kaldifst_core
fst
DESTINATION ..)
else()
install(TARGETS kaldi-decoder-core DESTINATION lib)
install(TARGETS
kaldi-decoder-core
kaldifst_core
fst
DESTINATION lib)
endif()

if(WIN32 AND BUILD_SHARED_LIBS)
install(TARGETS kaldi-decoder-core DESTINATION bin)
install(TARGETS
kaldi-decoder-core
kaldifst_core
fst
DESTINATION bin)
endif()
endfunction()

Expand Down
9 changes: 1 addition & 8 deletions cmake/kaldifst.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function(download_kaldifst)

list(APPEND CMAKE_MODULE_PATH ${kaldifst_SOURCE_DIR}/cmake)

add_subdirectory(${kaldifst_SOURCE_DIR} ${kaldifst_BINARY_DIR})
add_subdirectory(${kaldifst_SOURCE_DIR} ${kaldifst_BINARY_DIR} EXCLUDE_FROM_ALL)

target_include_directories(kaldifst_core
PUBLIC
Expand All @@ -56,13 +56,6 @@ function(download_kaldifst)

set_target_properties(kaldifst_core PROPERTIES OUTPUT_NAME "sherpa-onnx-kaldifst-core")
set_target_properties(fst PROPERTIES OUTPUT_NAME "sherpa-onnx-fst")

if(KHG_BUILD_PYTHON AND WIN32)
install(TARGETS kaldifst_core fst DESTINATION ..)
else()
install(TARGETS kaldifst_core fst DESTINATION lib)
endif()

endfunction()

download_kaldifst()

0 comments on commit fdc5671

Please sign in to comment.