From 47256ce14b285fc1fe4eb893ba3a4b2c9a3e8d1b Mon Sep 17 00:00:00 2001 From: Szilard Pall Date: Tue, 31 Aug 2010 17:18:24 +0200 Subject: [PATCH] fixed/improved cmake FFTW3 detection --- cmake/FindFFTW3.cmake | 10 ++++++++-- cmake/FindFFTW3F.cmake | 12 ++++++++---- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/cmake/FindFFTW3.cmake b/cmake/FindFFTW3.cmake index 636a96ec50..616bbbf854 100644 --- a/cmake/FindFFTW3.cmake +++ b/cmake/FindFFTW3.cmake @@ -10,9 +10,15 @@ if (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES) set (FFTW3_FIND_QUIETLY TRUE) endif (FFTW3_INCLUDE_DIR AND FFTW3_LIBRARIES) -find_path (FFTW3_INCLUDE_DIR fftw3.h) +find_path (FFTW3_INCLUDE_DIR fftw3.h + CACHE STRING "Path to headers for double precision FFTW3") + + +find_library (FFTW3_LIBRARIES + NAMES fftw3 + PATHS "${FFTW3_INCLUDE_DIR}/../lib" + CACHE STRING "Double precision FFTW3 libraries") -find_library (FFTW3_LIBRARIES NAMES fftw3) # handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if # all listed variables are TRUE diff --git a/cmake/FindFFTW3F.cmake b/cmake/FindFFTW3F.cmake index 5ca2fc3e30..23050153ad 100644 --- a/cmake/FindFFTW3F.cmake +++ b/cmake/FindFFTW3F.cmake @@ -5,14 +5,18 @@ # FFTW3F_LIBRARIES - List of libraries when using FFTW. # FFTW3F_FOUND - True if FFTW found. -if (FFTW3F_INCLUDE_DIR) +if (FFTW3F_INCLUDE_DIR AND FFTW3F_LIBRARIES) # Already in cache, be silent set (FFTW3F_FIND_QUIETLY TRUE) -endif (FFTW3F_INCLUDE_DIR) +endif (FFTW3F_INCLUDE_DIR AND FFTW3F_LIBRARIES) -find_path (FFTW3F_INCLUDE_DIR fftw3.h) +find_path (FFTW3F_INCLUDE_DIR fftw3.h + CACHE STRING "Path to headers for single precision FFTW3") -find_library (FFTW3F_LIBRARIES NAMES fftw3f) +find_library (FFTW3F_LIBRARIES + NAMES fftw3f + PATHS "${FFTW3F_INCLUDE_DIR}/../lib" + CACHE STRING "Single precision FFTW3 libraries") # handle the QUIETLY and REQUIRED arguments and set FFTW_FOUND to TRUE if # all listed variables are TRUE -- 2.11.4.GIT