-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
170 additions
and
34 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
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 |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# Findkaldifeat | ||
# ------------- | ||
# | ||
# Finds the kaldifeat library | ||
# | ||
# This will define the following variables: | ||
# | ||
# KALDIFEAT_FOUND -- True if the system has the kaldifeat library | ||
# KALDIFEAT_INCLUDE_DIRS -- The include directories for kaldifeat | ||
# KALDIFEAT_LIBRARIES -- Libraries to link against | ||
# KALDIFEAT_CXX_FLAGS -- Additional (required) compiler flags | ||
# KALDIFEAT_TORCH_VERSION_MAJOR -- The major version of PyTorch used to compile kaldifeat | ||
# KALDIFEAT_TORCH_VERSION_MINOR -- The minor version of PyTorch used to compile kaldifeat | ||
# KALDIFEAT_VERSION -- The version of kaldifeat | ||
# | ||
# and the following imported targets: | ||
# | ||
# kaldifeat_core | ||
|
||
# This file is modified from pytorch/cmake/TorchConfig.cmake.in | ||
|
||
set(KALDIFEAT_CXX_FLAGS "@CMAKE_CXX_FLAGS@") | ||
set(KALDIFEAT_TORCH_VERSION_MAJOR @KALDIFEAT_TORCH_VERSION_MAJOR@) | ||
set(KALDIFEAT_TORCH_VERSION_MINOR @KALDIFEAT_TORCH_VERSION_MINOR@) | ||
set(KALDIFEAT_VERSION @KALDIFEAT_VERSION@) | ||
|
||
if(DEFINED ENV{KALDIFEAT_INSTALL_PREFIX}) | ||
set(KALDIFEAT_INSTALL_PREFIX $ENV{KALDIFEAT_INSTALL_PREFIX}) | ||
else() | ||
# Assume we are in <install-prefix>/share/cmake/kaldifeat/kaldifeatConfig.cmake | ||
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) | ||
get_filename_component(KALDIFEAT_INSTALL_PREFIX "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) | ||
endif() | ||
|
||
set(KALDIFEAT_INCLUDE_DIRS ${KALDIFEAT_INSTALL_PREFIX}/include) | ||
|
||
set(KALDIFEAT_LIBRARIES kaldifeat_core) | ||
|
||
foreach(lib IN LISTS KALDIFEAT_LIBRARIES) | ||
find_library(location_${lib} ${lib} | ||
PATHS | ||
"${KALDIFEAT_INSTALL_PREFIX}/lib" | ||
"${KALDIFEAT_INSTALL_PREFIX}/lib64" | ||
) | ||
|
||
if(NOT MSVC) | ||
add_library(${lib} SHARED IMPORTED) | ||
else() | ||
add_library(${lib} STATIC IMPORTED) | ||
endif() | ||
|
||
set_target_properties(${lib} PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${KALDIFEAT_INCLUDE_DIRS}" | ||
IMPORTED_LOCATION "${location_${lib}}" | ||
CXX_STANDARD 14 | ||
) | ||
|
||
set_property(TARGET ${lib} PROPERTY INTERFACE_COMPILE_OPTIONS @CMAKE_CXX_FLAGS@) | ||
endforeach() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
find_package_handle_standard_args(kaldifeat DEFAULT_MSG | ||
location_kaldifeat_core | ||
) |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file is modified from pytorch/cmake/TorchConfigVersion.cmake.in | ||
set(PACKAGE_VERSION "@kaldifeat_VERSION@") | ||
|
||
# Check whether the requested PACKAGE_FIND_VERSION is compatible | ||
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}") | ||
set(PACKAGE_VERSION_COMPATIBLE FALSE) | ||
else() | ||
set(PACKAGE_VERSION_COMPATIBLE TRUE) | ||
if("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}") | ||
set(PACKAGE_VERSION_EXACT TRUE) | ||
endif() | ||
endif() |
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
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