CMake: Implement detection for FFTW3

This commit is contained in:
Sam Edwards 2018-02-17 23:35:43 -07:00
parent 84e7539f99
commit 283db1fb7a
7 changed files with 19 additions and 27 deletions

View File

@ -106,4 +106,4 @@ if(NOT FFTW3_INCLUDE_DIR OR NOT FFTW3_LIBRARY_DIR)
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FFTW DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR FFTW3_LIBRARY_DIR)
find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR FFTW3_LIBRARY_DIR)

View File

@ -485,17 +485,6 @@ option(HAVE_VIDEO4LINUX
"Set this to enable webcam support on Linux." ${IS_LINUX})
# TODO: FFTW2
# Is libfftw installed, and where?
#find_package(FFTW2 QUIET)
#package_option(FFTW
# "This enables support for lossless compression of animations in
#.bam files. This is rarely used, and you probably don't need it.")
#TODO PHAVE_DRFFTW_H
# Is libsquish installed, and where?
find_package(Squish QUIET)

View File

@ -163,7 +163,6 @@ check_include_file_cxx(unistd.h PHAVE_UNISTD_H)
check_include_file_cxx(utime.h PHAVE_UTIME_H)
check_include_file_cxx(glob.h PHAVE_GLOB_H)
check_include_file_cxx(dirent.h PHAVE_DIRENT_H)
check_include_file_cxx(drfftw.h PHAVE_DRFFTW_H)
check_include_file_cxx(sys/soundcard.h PHAVE_SYS_SOUNDCARD_H)
check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) #TODO doesn't work on OSX, use sys/ucontext.h
check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H)
@ -190,12 +189,6 @@ endif()
# Now go through all the packages and report whether we have them.
show_packages()
if(HAVE_FFTW)
message("+ fftw")
else()
message("- Did not find fftw")
endif()
if(HAVE_SQUISH)
message("+ squish")
else()

View File

@ -70,6 +70,21 @@ package_option(TAR
"This is used to optimize patch generation against tar files.")
config_package(TAR "libtar")
#
# ------------ FFTW ------------
#
find_package(FFTW3 QUIET)
package_option(FFTW
"This enables support for compression of animations in .bam files.
This is only necessary for creating or reading .bam files containing
compressed animations."
FOUND_AS "FFTW3"
LICENSE "GPL")
config_package(FFTW "FFTW")
# Find and configure Miles Sound System
find_package(Miles QUIET)
#config_package(RAD_MSS "Miles Sound System")

View File

@ -83,7 +83,7 @@
/* Define if we have libtar installed. */
#cmakedefine HAVE_TAR
/* Define if we have libfftw installed. */
/* Define if we have libfftw3 installed. */
#cmakedefine HAVE_FFTW
/* Define if we have libsquish installed. */
@ -406,9 +406,6 @@
/* Define if you have the <dirent.h> header file. */
#cmakedefine PHAVE_DIRENT_H
/* Define if you have the <drfftw.h> header file. */
#cmakedefine PHAVE_DRFFTW_H
/* Do we have <sys/soundcard.h> (and presumably a Linux-style audio
interface)? */
#cmakedefine PHAVE_SYS_SOUNDCARD_H

View File

@ -5,9 +5,6 @@ endif()
# Not sure where I want to hide these inludes yet, but it is annoying
# to have to add them to every CMakeLists that either directly, or
# recursively includes linmath, and other libraries etc...
if(HAVE_FFTW)
include_directories(${FFTW2_INCLUDE_DIR})
endif()
if(HAVE_CG)
include_directories(${CG_INCLUDE_DIRS})
endif()

View File

@ -62,7 +62,8 @@ set(P3MATHUTIL_SOURCES
composite_sources(p3mathutil P3MATHUTIL_SOURCES)
add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES})
target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR})
target_link_libraries(p3mathutil p3event)
target_use_packages(p3mathutil FFTW)
target_interrogate(p3mathutil ALL)
install(TARGETS p3mathutil DESTINATION lib)