diff --git a/cmake/modules/FindFFTW3.cmake b/cmake/modules/FindFFTW3.cmake index 619c580828..fbd572fbfc 100644 --- a/cmake/modules/FindFFTW3.cmake +++ b/cmake/modules/FindFFTW3.cmake @@ -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) \ No newline at end of file +find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR FFTW3_LIBRARY_DIR) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index a20434d80b..6b1ebd89cb 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -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) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index fb0537ff31..1da3ec113b 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -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() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index a115cb118e..f72eb3a398 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -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") diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index a328367234..4cfc7d70c7 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -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 header file. */ #cmakedefine PHAVE_DIRENT_H -/* Define if you have the header file. */ -#cmakedefine PHAVE_DRFFTW_H - /* Do we have (and presumably a Linux-style audio interface)? */ #cmakedefine PHAVE_SYS_SOUNDCARD_H diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index e781ae96a3..ab8ff038a6 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -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() diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 6227880573..fcc9f55dea 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -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)