Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
d68e3d1e
Unverified
Commit
d68e3d1e
authored
5 years ago
by
Van Herck, Walter
Committed by
GitHub
5 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request
#853
from gpospelov/develop
Simplify CMake search of fftw3
parents
f83d37e9
13879125
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cmake/generic/modules/FindFFTW.cmake
+31
-52
31 additions, 52 deletions
cmake/generic/modules/FindFFTW.cmake
with
31 additions
and
52 deletions
cmake/generic/modules/FindFFTW.cmake
+
31
−
52
View file @
d68e3d1e
# Find the FFTW includes and library.
# Find the FFTW includes and library.
#
#
# This module defines
# This module defines
# FFTW_INCLUDE_DIR, where to locate fftw3.h file
# FFTW_INCLUDE_DIR, where to locate fftw3.h file
# FFTW_LIBRARIES, the libraries to link against to use fftw3
# FFTW_LIBRARIES, the libraries to link against to use fftw3
# FFTW_FOUND. If false, you cannot build anything that requires fftw3.
# FFTW_LIBRARY, where to find the libfftw3 library.
# FFTW_LIBRARY, where to find the libfftw3 library.
set
(
FFTW_FOUND 0
)
# --- Looking for headers -----
if
(
FFTW_LIBRARY AND FFTW_INCLUDE_DIR
)
set
(
FFTW_FIND_QUIETLY TRUE
)
find_path
(
FFTW_INCLUDE_DIR fftw3.h
)
if
(
NOT FFTW_INCLUDE_DIR
)
message
(
ERROR
" Missed dependency. Can't find FFTW headers, please make sure that you've installed FFTW development version."
)
endif
()
endif
()
if
(
NOT WIN32
)
# --- Looking for library -----
find_path
(
FFTW_INCLUDE_DIR fftw3.h
$ENV{FFTW_DIR}/include
$ENV{FFTW3} $ENV{FFTW3}/include $ENV{FFTW3}/api
/usr/local/include
/usr/include
/opt/fftw3/include
/opt/local/include
DOC
"Specify the directory containing fftw3.h"
)
find_library
(
FFTW_LIBRARY NAMES fftw3 fftw3-3 PATHS
set
(
FFTW_NAMES
${
FFTW_NAMES
}
fftw3 fftw3-3 libfftw3-3
)
$ENV{FFTW_DIR}/lib
set
(
ba_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES
${
CMAKE_FIND_LIBRARY_SUFFIXES
}
)
$ENV{FFTW3} $ENV{FFTW3}/lib $ENV{FFTW3}/.libs
/usr/local/lib
/usr/lib
/opt/fftw3/lib
HINTS /opt/local/lib
DOC
"Specify the fttw3 library here."
)
else
()
find_path
(
FFTW_INCLUDE_DIR fftw3.h
HINTS ENV PATH
PATHS
"C:/opt/local_x64/include"
# if fftw cannot be found in env path
PATH_SUFFIXES ../include
NO_DEFAULT_PATH
)
# message("XXX ${FFTW_INCLUDE_DIR}")
find_library
(
FFTW_LIBRARY libfftw3-3
if
(
NOT APPLE AND NOT WIN32
)
HINTS ENV PATH
set
(
CMAKE_FIND_LIBRARY_SUFFIXES .so
)
# require shared version of library
PATHS
"C:/opt/local_x64/lib"
# if fftw cannot be found in env path
endif
()
NO_DEFAULT_PATH
)
find_library
(
FFTW_LIBRARY NAMES
${
FFTW_NAMES
}
QUIET
)
set
(
CMAKE_FIND_LIBRARY_SUFFIXES
${
ba_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES
}
)
if
(
WIN31
)
string
(
REPLACE
".lib"
".dll"
FFTW_LIBRARY_DLL
"
${
FFTW_LIBRARY
}
"
)
string
(
REPLACE
".lib"
".dll"
FFTW_LIBRARY_DLL
"
${
FFTW_LIBRARY
}
"
)
if
(
NOT EXISTS
${
FFTW_LIBRARY_DLL
}
)
if
(
NOT EXISTS
${
FFTW_LIBRARY_DLL
}
)
message
(
FATAL_ERROR
"File
${
FFTW_LIBRARY_DLL
}
does not exist"
)
message
(
FATAL_ERROR
"File
${
FFTW_LIBRARY_DLL
}
does not exist"
)
endif
(
NOT EXISTS
${
FFTW_LIBRARY_DLL
}
)
endif
(
NOT EXISTS
${
FFTW_LIBRARY_DLL
}
)
endif
()
endif
()
if
(
FFTW_INCLUDE_DIR AND FFTW_LIBRARY
)
# --- Processing variables -----
set
(
FFTW_FOUND 1
)
if
(
NOT FFTW_FIND_QUIETLY
)
message
(
STATUS
"Found fftw3 includes at
${
FFTW_INCLUDE_DIR
}
"
)
message
(
STATUS
"Found fftw3 library at
${
FFTW_LIBRARY
}
"
)
endif
()
endif
()
include
(
FindPackageHandleStandardArgs
)
FIND_PACKAGE_HANDLE_STANDARD_ARGS
(
FFTW REQUIRED_VARS FFTW_LIBRARY FFTW_INCLUDE_DIR
)
if
(
NOT FFTW_FOUND
)
if
(
FFTW_FOUND
)
if
(
FFTW_FIND_REQUIRED
)
set
(
FFTW_LIBRARIES
${
FFTW_LIBRARY
}
)
message
(
FATAL_ERROR
"FindFFTW: can't find fftw3 header or library"
)
endif
()
endif
()
endif
()
if
(
FFTW_FOUND
)
message
(
STATUS
"Found FFTW: includes at
${
FFTW_INCLUDE_DIR
}
, libraries at
${
FFTW_LIBRARIES
}
"
)
else
()
message
(
STATUS
"Cant'f find fftw3 library:
${
FFTW_INCLUDE_DIR
}
,
${
FFTW_LIBRARIES
}
."
)
if
(
NOT WIN32 AND NOT APPLE
)
message
(
STATUS
"Please note, that shared version of FFTW library is required (use enable-shared during configuration phase)."
)
endif
()
endif
()
set
(
FFTW_LIBRARIES
${
FFTW_LIBRARY
}
)
mark_as_advanced
(
FFTW_INCLUDE_DIR FFTW_LIBRARY FFTW_LIBRARY_DLL
)
mark_as_advanced
(
FFTW_FOUND FFTW_LIBRARY FFTW_INCLUDE_DIR FFTW_LIBRARY_DLL
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment