/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk

« back to all changes in this revision

Viewing changes to dict_hw/cmake/FindFFTW3.cmake

  • Committer: Suren A. Chilingaryan
  • Date: 2009-12-12 01:38:41 UTC
  • Revision ID: csa@dside.dyndns.org-20091212013841-feih3qa4i28x75j4
Provide stand-alone library

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
2
# Try to find FFTW3  library  
 
3
# (see www.fftw.org)
 
4
# Once run this will define: 
 
5
 
6
# FFTW3_FOUND
 
7
# FFTW3_INCLUDE_DIR 
 
8
# FFTW3_LIBRARIES
 
9
# FFTW3_LINK_DIRECTORIES
 
10
#
 
11
# You may set one of these options before including this file:
 
12
#  FFTW3_USE_SSE2
 
13
#
 
14
#  TODO: _F_ versions.
 
15
#
 
16
# Jan Woetzel 05/2004
 
17
# www.mip.informatik.uni-kiel.de
 
18
# --------------------------------
 
19
 
 
20
 FIND_PATH(FFTW3_INCLUDE_DIR fftw3.h
 
21
   ${FFTW3_DIR}/include
 
22
   ${FFTW3_HOME}/include
 
23
   ${FFTW3_DIR}
 
24
   ${FFTW3_HOME}
 
25
   $ENV{FFTW3_DIR}/include
 
26
   $ENV{FFTW3_HOME}/include
 
27
   $ENV{FFTW3_DIR}
 
28
   $ENV{FFTW3_HOME}
 
29
   /usr/include
 
30
   /usr/local/include
 
31
   $ENV{SOURCE_DIR}/fftw3
 
32
   $ENV{SOURCE_DIR}/fftw3/include
 
33
   $ENV{SOURCE_DIR}/fftw
 
34
   $ENV{SOURCE_DIR}/fftw/include
 
35
 )
 
36
#MESSAGE("DBG FFTW3_INCLUDE_DIR=${FFTW3_INCLUDE_DIR}")  
 
37
 
 
38
 
 
39
SET(FFTW3_POSSIBLE_LIBRARY_PATH
 
40
  ${FFTW3_DIR}/lib
 
41
  ${FFTW3_HOME}/lib
 
42
  ${FFTW3_DIR}
 
43
  ${FFTW3_HOME}  
 
44
  $ENV{FFTW3_DIR}/lib
 
45
  $ENV{FFTW3_HOME}/lib
 
46
  $ENV{FFTW3_DIR}
 
47
  $ENV{FFTW3_HOME}  
 
48
  /usr/lib
 
49
  /usr/local/lib
 
50
  $ENV{SOURCE_DIR}/fftw3
 
51
  $ENV{SOURCE_DIR}/fftw3/lib
 
52
  $ENV{SOURCE_DIR}/fftw
 
53
  $ENV{SOURCE_DIR}/fftw/lib
 
54
)
 
55
 
 
56
  
 
57
# the lib prefix is containe din filename onf W32, unfortuantely. JW
 
58
# teh "general" lib: 
 
59
FIND_LIBRARY(FFTW3_FFTW_LIBRARY
 
60
  NAMES fftw3 libfftw libfftw3 libfftw3-3
 
61
  PATHS 
 
62
  ${FFTW3_POSSIBLE_LIBRARY_PATH}
 
63
  )
 
64
#MESSAGE("DBG FFTW3_FFTW_LIBRARY=${FFTW3_FFTW_LIBRARY}")
 
65
 
 
66
FIND_LIBRARY(FFTW3_FFTWF_LIBRARY
 
67
  NAMES fftwf3 fftw3f fftwf libfftwf libfftwf3 libfftw3f libfftw3f-3
 
68
  PATHS 
 
69
  ${FFTW3_POSSIBLE_LIBRARY_PATH}
 
70
  )
 
71
#MESSAGE("DBG FFTW3_FFTWF_LIBRARY=${FFTW3_FFTWF_LIBRARY}")
 
72
 
 
73
FIND_LIBRARY(FFTW3_FFTWL_LIBRARY
 
74
  NAMES fftwl3 fftw3l fftwl libfftwl libfftwl3 libfftw3l libfftw3l-3
 
75
  PATHS 
 
76
  ${FFTW3_POSSIBLE_LIBRARY_PATH}
 
77
  )
 
78
#MESSAGE("DBG FFTW3_FFTWF_LIBRARY=${FFTW3_FFTWL_LIBRARY}")
 
79
 
 
80
 
 
81
FIND_LIBRARY(FFTW3_FFTW_SSE2_LIBRARY
 
82
  NAMES fftw_sse2 fftw3_sse2 libfftw_sse2 libfftw3_sse2
 
83
  PATHS 
 
84
  ${FFTW3_POSSIBLE_LIBRARY_PATH}
 
85
  )
 
86
#MESSAGE("DBG FFTW3_FFTW_SSE2_LIBRARY=${FFTW3_FFTW_SSE2_LIBRARY}")
 
87
 
 
88
FIND_LIBRARY(FFTW3_FFTWF_SSE_LIBRARY
 
89
  NAMES fftwf_sse fftwf3_sse fftw3f_sse libfftwf_sse libfftwf3_sse libfftw3f_sse
 
90
  PATHS 
 
91
  ${FFTW3_POSSIBLE_LIBRARY_PATH}
 
92
  )
 
93
#MESSAGE("DBG FFTW3_FFTWF_SSE_LIBRARY=${FFTW3_FFTWF_SSE_LIBRARY}")
 
94
 
 
95
 
 
96
# --------------------------------
 
97
# select one of the above
 
98
# default: 
 
99
IF (FFTW3_FFTW_LIBRARY)
 
100
  SET(FFTW3_LIBRARIES ${FFTW3_FFTW_LIBRARY})
 
101
ENDIF (FFTW3_FFTW_LIBRARY)
 
102
# specialized: 
 
103
IF (FFTW3_USE_SSE2 AND FFTW3_FFTW_SSE2_LIBRARY)
 
104
  SET(FFTW3_LIBRARIES ${FFTW3_FFTW_SSE2_LIBRARY})
 
105
ENDIF (FFTW3_USE_SSE2 AND FFTW3_FFTW_SSE2_LIBRARY)
 
106
 
 
107
# --------------------------------
 
108
 
 
109
IF(FFTW3_LIBRARIES)
 
110
  IF (FFTW3_INCLUDE_DIR)
 
111
 
 
112
    # OK, found all we need
 
113
    SET(FFTW3_FOUND TRUE)
 
114
    GET_FILENAME_COMPONENT(FFTW3_LINK_DIRECTORIES ${FFTW3_LIBRARIES} PATH)
 
115
    
 
116
  ELSE (FFTW3_INCLUDE_DIR)
 
117
    MESSAGE("FFTW3 include dir not found. Set FFTW3_DIR to find it.")
 
118
  ENDIF(FFTW3_INCLUDE_DIR)
 
119
ELSE(FFTW3_LIBRARIES)
 
120
  MESSAGE("FFTW3 lib not found. Set FFTW3_DIR to find it.")
 
121
ENDIF(FFTW3_LIBRARIES)
 
122
 
 
123
 
 
124
MARK_AS_ADVANCED(
 
125
  FFTW3_INCLUDE_DIR
 
126
  FFTW3_LIBRARIES
 
127
  FFTW3_FFTW_LIBRARY
 
128
  FFTW3_FFTW_SSE2_LIBRARY
 
129
  FFTW3_FFTWF_LIBRARY
 
130
  FFTW3_FFTWF_SSE_LIBRARY
 
131
  FFTW3_FFTWL_LIBRARY
 
132
  FFTW3_LINK_DIRECTORIES
 
133
)