Skip to content

Commit

Permalink
Build and install kissfft-tools
Browse files Browse the repository at this point in the history
Signed-off-by: Vasyl Gello <[email protected]>
  • Loading branch information
basilgello committed Jan 21, 2021
1 parent 7651bda commit c2e82a3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
11 changes: 7 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ project(kissfft VERSION "${MAKEFILE_EXTRACTED_VERSION}")
option(KISSFFT_SIMD "Build kissfft with SIMD" OFF)
option(KISSFFT_FLOAT "Build kissfft with float type" ON)
option(KISSFFT_OPENMP "Build kissfft with openmp" OFF)
option(KISSFFT_TOOLS "Build kissfft tools" ON)
option(KISSFFT_TEST "Build and enable kissfft tests" ON)
option(KISSFFT_INSTALL "Enable kissfft install" ON)

if (KISSFFT_INSTALL)
include(GNUInstallDirs)
endif()

if(CMAKE_C_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
add_compile_options(-ffast-math -fomit-frame-pointer
Expand Down Expand Up @@ -93,20 +100,16 @@ function(add_kissfft_executable NAME)
OUTPUT_NAME "${NAME}_${KISSFFT_DATATYPE}")
endfunction()

option(KISSFFT_TOOLS "Build kissfft tools" ON)
if(KISSFFT_TOOLS)
add_subdirectory(tools)
endif()

option(KISSFFT_TEST "Build and enable kissfft tests" ON)
if(KISSFFT_TEST)
enable_testing()
add_subdirectory(test)
endif()

option(KISSFFT_INSTALL "Enable kissfft install" ON)
if (KISSFFT_INSTALL)
include(GNUInstallDirs)
install(TARGETS kissfft EXPORT kissfft
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
Expand Down
16 changes: 16 additions & 0 deletions tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,28 @@ target_compile_definitions(fastconv PRIVATE FAST_FILT_UTIL)

add_kissfft_executable(fft fftutil.c kiss_fftnd.c kiss_fftr.c kiss_fftndr.c)


if (KISSFFT_INSTALL)
install(TARGETS fastconv fastconvr fft
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()

# psdpng does not build with "simd" datatype
if(NOT KISSFFT_DATATYPE MATCHES "simd")
include(FindPkgConfig)
pkg_check_modules(libpng REQUIRED IMPORTED_TARGET libpng)
add_kissfft_executable(psdpng psdpng.c kiss_fftr.c)
target_link_libraries(psdpng PRIVATE PkgConfig::libpng)
if (KISSFFT_INSTALL)
install(TARGETS psdpng
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
endif()
endif()

#FIXME: dumphdr.c is not available
Expand Down

0 comments on commit c2e82a3

Please sign in to comment.