File: FindFFTW.cmake

package info (click to toggle)
clfft 2.12.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 5,760 kB
  • sloc: cpp: 77,342; python: 1,058; ansic: 1,018; sh: 33; makefile: 24
file content (105 lines) | stat: -rw-r--r-- 3,222 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# ########################################################################
# Copyright 2013 Advanced Micro Devices, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ########################################################################


# Locate the FFTW (http://www.fftw.org/) Framework.
#
# Defines the following variables:
#
#   FFTW_FOUND - Found the FFTW framework
#   FFTW_INCLUDE_DIRS - Include directories
#
# Also defines the library variables below as normal
# variables.  These contain debug/optimized keywords when
# a debugging library is found.
#
#   FFTW_LIBRARIES - libfftw
#
# Accepts the following variables as input:
#
#   FFTW_ROOT - (as a CMake or environment variable)
#                The root directory of the fftw install prefix
#
#   FIND_LIBRARY_USE_LIB64_PATHS - Global property that controls whether 
#               findFFTW should search for 64bit or 32bit libs
#-----------------------------------------------
# Example Usage:
#
#    find_package(FFTW REQUIRED)
#    include_directories(${FFTW_INCLUDE_DIRS})
#
#    add_executable(foo foo.cc)
#    target_link_libraries(foo ${FFTW_LIBRARIES})
#
#-----------------------------------------------

find_path(FFTW_INCLUDE_DIRS
    NAMES fftw3.h
    HINTS
        ${FFTW_ROOT}/include
        ${FFTW_ROOT}/api
        ${FFTW_ROOT}
        $ENV{FFTW_ROOT}/include
        $ENV{FFTW_ROOT}/api
        ENV FFTW_ROOT
    PATHS
        /usr/include
        /usr/local/include
)
mark_as_advanced( FFTW_INCLUDE_DIRS )

find_library( FFTW_SINGLE_PRECISION_LIBRARIES
    NAMES fftw3f libfftw3f-3
    HINTS
        ${FFTW_ROOT}/lib
        ${FFTW_ROOT}/.libs
        ${FFTW_ROOT}
        $ENV{FFTW_ROOT}/lib
        $ENV{FFTW_ROOT}/.libs
        ENV FFTW_ROOT
    PATHS
        /usr/lib
        /usr/local/lib
    DOC "FFTW dynamic library"
)
mark_as_advanced( FFTW_SINGLE_PRECISION_LIBRARIES )

find_library( FFTW_DOUBLE_PRECISION_LIBRARIES
    NAMES fftw3 libfftw3-3
    HINTS
        ${FFTW_ROOT}/lib
        ${FFTW_ROOT}/.libs
        ${FFTW_ROOT}
        $ENV{FFTW_ROOT}/lib
        $ENV{FFTW_ROOT}/.libs
        ENV FFTW_ROOT
    PATHS
        /usr/lib
        /usr/local/lib
    DOC "FFTW dynamic library"
)
mark_as_advanced( FFTW_DOUBLE_PRECISION_LIBRARIES )

set( FFTW_LIBRARIES ${FFTW_SINGLE_PRECISION_LIBRARIES} ${FFTW_DOUBLE_PRECISION_LIBRARIES} )
mark_as_advanced( FFTW_LIBRARIES )

include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( FFTW DEFAULT_MSG FFTW_LIBRARIES FFTW_INCLUDE_DIRS )

if( NOT FFTW_FOUND )
    message( STATUS "FindFFTW looked for single precision libraries named: fftw3f or libfftw3f-3" )
    message( STATUS "FindFFTW looked for double precision libraries named: fftw3 or libfftw3-3" )
endif()