Permalink
Browse files

Fix fingerprint library build and make the find modules use pkg-confi…

…g as hints.
  • Loading branch information...
1 parent 9e702de commit ca4461b0b436a2b82728df26d6175756a0a913b9 @eartle eartle committed May 22, 2012
@@ -9,12 +9,17 @@
# LIBFFTW3_INCLUDE_DIR The libfftw3 include directory
# LIBFFTW3_LIBRARY The libfftw3 librarys
+find_package(PkgConfig)
+pkg_check_modules(PC_FFTW3F QUIET fftw)
+set(FFTW3F_DEFINITIONS ${PC_FFTW3F_CFLAGS_OTHER})
+
if(NOT LIBFFTW3_PRECISION)
message(STATUS "Searching for LIBFFTW3, using default precision float")
set(LIBFFTW3_PRECISION FLOAT)
endif(NOT LIBFFTW3_PRECISION)
-find_path(LIBFFTW3_INCLUDE_DIR fftw3.h)
+find_path(LIBFFTW3_INCLUDE_DIR fftw3.h
+ HINTS ${PC_FFTW3F_INCLUDEDIR} ${PC_FFTW3F_INCLUDE_DIRS})
if(LIBFFTW3_PRECISION STREQUAL FLOAT)
set(LIBFFTW3_PRECISION_SUFFIX f)
@@ -28,7 +33,8 @@ if(LIBFFTW3_PRECISION STREQUAL LDOUBLE)
set(LIBFFTW3_PRECISION_SUFFIX l)
endif(LIBFFTW3_PRECISION STREQUAL LDOUBLE)
-find_library(LIBFFTW3_LIBRARY NAMES fftw3${LIBFFTW3_PRECISION_SUFFIX} libfftw3${LIBFFTW3_PRECISION_SUFFIX}-3 fftw3${LIBFFTW3_PRECISION_SUFFIX}-3)
+find_library(LIBFFTW3_LIBRARY NAMES fftw3${LIBFFTW3_PRECISION_SUFFIX} libfftw3${LIBFFTW3_PRECISION_SUFFIX}-3 fftw3${LIBFFTW3_PRECISION_SUFFIX}-3
+ HINTS ${PC_FFTW3F_LIBDIR} ${PC_FFTW3F_LIBRARY_DIRS})
if(FIND_LIBFFTW3_VERBOSE)
message(STATUS
@@ -9,10 +9,15 @@
# LIBSAMPLERATE_LIBRARY The libsamplerate librarys
# LIBSAMPLERATE_INCLUDE_DIR The libsamplerate include directory
+find_package(PkgConfig)
+pkg_check_modules(PC_LIBSAMPLERATE QUIET libsamplerate)
+set(LIBSAMPLERATE_DEFINITIONS ${PC_LIBSAMPLERATE_CFLAGS_OTHER})
-find_library(LIBSAMPLERATE_LIBRARY NAMES samplerate libsamplerate-0 samplerate-0)
+find_library(LIBSAMPLERATE_LIBRARY NAMES samplerate libsamplerate-0 samplerate-0
+ HINTS ${PC_LIBSAMPLERATE_LIBDIR} ${PC_LIBSAMPLERATE_LIBRARY_DIRS})
-find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h)
+find_path(LIBSAMPLERATE_INCLUDE_DIR samplerate.h
+ HINTS ${PC_LIBSAMPLERATE_INCLUDEDIR} ${PC_LIBSAMPLERATE_INCLUDE_DIRS})
if(LIBSAMPLERATE_LIBRARY AND LIBSAMPLERATE_INCLUDE_DIR)
set(LIBSAMPLERATE_FOUND TRUE)
@@ -1,24 +0,0 @@
-# - Try to find the fftw3f include dir and library
-# Variables defined by this module:
-#
-# FFTW3F_INCLUDE_DIRS - where to find fftw3.h
-# FFTW3F_LIBRARIES - list of libraries when using fftw3f
-# FFTW3F_FOUND - true if Fftw3f found
-
-find_path(FFTW3F_INCLUDE_DIR NAMES fftw3.h)
-
-find_library(FFTW3F_LIBRARY
- NAMES fftw3f libfftw3f
-)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(Fftw3f DEFAULT_MSG
- FFTW3F_LIBRARY FFTW3F_INCLUDE_DIR
-)
-
-if(FFTW3F_FOUND)
- set(FFTW3F_INCLUDE_DIRS ${FFTW3F_INCLUDE_DIR})
- set(FFTW3F_LIBRARIES ${FFTW3F_LIBRARY})
-endif()
-
-mark_as_advanced(FFTW3F_INCLUDE_DIR FFTW3F_LIBRARY)
@@ -1,24 +0,0 @@
-# - Try to find the Samplerate include dir and library
-# Variables defined by this module:
-#
-# SAMPLERATE_INCLUDE_DIRS - where to find samplerate.h
-# SAMPLERATE_LIBRARIES - List of libraries when using Samplerate
-# SAMPLERATE_FOUND - true if Samplerate found
-
-find_path(SAMPLERATE_INCLUDE_DIR NAMES samplerate.h)
-
-find_library(SAMPLERATE_LIBRARY
- NAMES samplerate libsamplerate
-)
-
-include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(SAMPLERATE DEFAULT_MSG
- SAMPLERATE_LIBRARY SAMPLERATE_INCLUDE_DIR
-)
-
-if(SAMPLERATE_FOUND)
- set(SAMPLERATE_INCLUDE_DIRS ${SAMPLERATE_INCLUDE_DIR})
- set(SAMPLERATE_LIBRARIES ${SAMPLERATE_LIBRARY})
-endif()
-
-mark_as_advanced(SAMPLERATE_INCLUDE_DIR SAMPLERATE_LIBRARY)
@@ -4,8 +4,8 @@ find_package(Qt4 COMPONENTS QtCore QtSql REQUIRED)
find_package(LibSamplerate REQUIRED)
find_package(LibFFTW3 REQUIRED)
-include_directories(${LIBFFTW3_INCLUDE_DIRS})
-include_directories(${LIBSAMPLERATE_INCLUDE_DIRS})
+include_directories(${LIBFFTW3_INCLUDE_DIR})
+include_directories(${LIBSAMPLERATE_INCLUDE_DIR})
include_directories(${QT_INCLUDES})
include_directories(${CMAKE_CURRENT_LIST_DIR}/..)

0 comments on commit ca4461b

Please sign in to comment.