# - Try to find FFTW3 
# Once done, it will define
#
# FFTW3_FOUND - system has FFTW3
# FFTW3_INCLUDE_DIRS - FFTW3 include directories
# FFTW3_DEFINITIONS - Compiler switches required for using FFTW3
# FFTW3_LIBRARIES - link these to use FFTW3

#include(LibFindMacros)


IF (CTEMPLATES_INCLUDE_DIRS AND CTEMPLATES_LIBRARIES)
   # in cache already
   SET(CTEMPLATES_FIND_QUIETLY TRUE)
ENDIF (CTEMPLATES_INCLUDE_DIRS AND CTEMPLATES_LIBRARIES)


IF (NOT WIN32)
  include(FindPkgConfig)
  pkg_check_modules(CTEMPLATES_PKGCONF ctemplates)
  SET(CTEMPLATES_DEFINITIONS ${CTEMPLATES_PKGCONF_CFLAGS_OTHER})
ENDIF (NOT WIN32)


INCLUDE(FindPackageHandleStandardArgs)

FIND_PACKAGE_HANDLE_STANDARD_ARGS(CTEMPLATES DEFAULT_MSG CTEMPLATES_LIBRARY_DIRS CTEMPLATES_INCLUDE_DIRS)

IF (CTEMPLATES_FOUND)
  set(CTEMPLATES_INCLUDE_DIRS ${CTEMPLATES_INCLUDE_DIRS})
  set(CTEMPLATES_LIBRARIES ${CTEMPLATES_LIBRARY_DIRS})
ELSE (CTEMPLATES_FOUND)
   MESSAGE("CTEMPLATES not found.")  
ENDIF (CTEMPLATES_FOUND)


MARK_AS_ADVANCED(CTEMPLATES_INCLUDE_DIRS CTEMPLATES_LIBRARIES)

