Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cmake] Fetch OpenFST at configure time. (#4558)
- Loading branch information
Showing
2 changed files
with
36 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
cmake_minimum_required(VERSION 2.8.2) | ||
project(openfst-download NONE) | ||
|
||
include(ExternalProject) | ||
ExternalProject_Add(openfst | ||
GIT_REPOSITORY https://github.com/kkm000/openfst | ||
GIT_TAG 0bca6e76d24647427356dc242b0adbf3b5f1a8d9 # tag win/1.7.2.1 | ||
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/openfst" | ||
BINARY_DIR "" | ||
CONFIGURE_COMMAND "" | ||
BUILD_COMMAND "" | ||
INSTALL_COMMAND "" | ||
TEST_COMMAND "" | ||
cmake_minimum_required(VERSION 3.14) | ||
include(FetchContent) | ||
|
||
FetchContent_Declare( | ||
openfst | ||
GIT_REPOSITORY https://github.com/kkm000/openfst | ||
GIT_TAG 338225416178ac36b8002d70387f5556e44c8d05 # tag win/1.7.2.1 | ||
) | ||
|
||
FetchContent_GetProperties(openfst) | ||
if(NOT openfst_POPULATED) | ||
FetchContent_Populate(openfst) | ||
include_directories(${openfst_SOURCE_DIR}/src/include) | ||
|
||
add_subdirectory(${openfst_SOURCE_DIR} ${openfst_BINARY_DIR}) | ||
|
||
install(DIRECTORY ${openfst_SOURCE_DIR}/src/include/ DESTINATION include/ | ||
FILES_MATCHING PATTERN "*.h") | ||
|
||
install(TARGETS fst | ||
EXPORT kaldi-targets | ||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||
endif() |