-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add option to use internal or external kissfft
By default, ENABLE_INTERNAL_KISSFFT is ON for all architectures. It is immutable on non-Unix systems because 'FindKissFFT.cmake' relies on 'pkg-config' tool not available in Windows and Android. If Kodi built with internal kissfft, the corresponding CMake search module sets kissfft's include directory to the copied location created by 'core_add_subdirs_from_filelist' macro expanded from 'cmake/treedata/common/externals.txt'. If Kodi built with system kissfft, the module detects the presence of header files and solib by 'pkg-config' and disables building the 'xbmc/contrib/kissfft' directory. Signed-off-by: Vasyl Gello <[email protected]>
- Loading branch information
1 parent
53d7223
commit a9f8d3f
Showing
4 changed files
with
60 additions
and
8 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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#.rst: | ||
# FindKissFFT | ||
# ------------ | ||
# Finds the KissFFT as a Fast Fourier Transformation (FFT) library | ||
# | ||
# This will define the following variables: | ||
# | ||
# KISSFFT_FOUND - System has KissFFT | ||
# KISSFFT_INCLUDE_DIRS - the KissFFT include directory | ||
# KISSFFT_LIBRARIES - the KissFFT libraries | ||
# | ||
|
||
if(ENABLE_INTERNAL_KISSFFT) | ||
# KissFFT is located in xbmc/contrib/kissfft | ||
set(KISSFFT_FOUND TRUE) | ||
set(KISSFFT_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/xbmc/contrib") | ||
message(STATUS "Found KissFFT: ${KISSFFT_INCLUDE_DIRS}") | ||
else() | ||
find_package(PkgConfig) | ||
if(PKG_CONFIG_FOUND) | ||
pkg_check_modules(PC_KISSFFT kissfft QUIET) | ||
endif() | ||
|
||
find_path(KISSFFT_INCLUDE_DIR kissfft/kiss_fft.h kissfft/kiss_fftr.h | ||
PATHS ${PC_KISSFFT_INCLUDEDIR}) | ||
find_library(KISSFFT_LIBRARY NAMES kissfft-float kissfft-int32 kissfft-int16 kissfft-simd | ||
PATHS ${PC_KISSFFT_LIBDIR}) | ||
|
||
# Check if all REQUIRED_VARS are satisfied and set KISSFFT_FOUND | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(KissFFT REQUIRED_VARS KISSFFT_INCLUDE_DIR KISSFFT_LIBRARY) | ||
|
||
if(KISSFFT_FOUND) | ||
set(KISSFFT_INCLUDE_DIRS ${KISSFFT_INCLUDE_DIR}) | ||
set(KISSFFT_LIBRARIES ${KISSFFT_LIBRARY}) | ||
|
||
if(NOT TARGET kissfft) | ||
add_library(kissfft UNKNOWN IMPORTED) | ||
set_target_properties(kissfft PROPERTIES | ||
IMPORTED_LOCATION "${KISSFFT_LIBRARY}" | ||
INTERFACE_INCLUDE_DIRECTORIES "${KISSFFT_INCLUDE_DIR}") | ||
endif() | ||
endif() | ||
|
||
mark_as_advanced(KISSFFT_INCLUDE_DIR KISSFFT_LIBRARY) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
set(SOURCES kiss_fft.c | ||
kiss_fftr.c) | ||
if(ENABLE_INTERNAL_KISSFFT) | ||
set(SOURCES kiss_fft.c | ||
kiss_fftr.c) | ||
|
||
set(HEADERS _kiss_fft_guts.h | ||
kiss_fft.h | ||
kiss_fftr.h) | ||
set(HEADERS _kiss_fft_guts.h | ||
kiss_fft.h | ||
kiss_fftr.h) | ||
|
||
core_add_library(kissfft) | ||
core_add_library(kissfft) | ||
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