Skip to content

Commit 29c7186

Browse files
committed
another attempt
1 parent 3985925 commit 29c7186

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

toolchain/cmake/regular/FindFFTW.cmake

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
1-
# FindFFTW.cmake — robust FFTW detection for system installs & CI
1+
# Generic and robust FindFFTW.cmake
22

33
find_package(PkgConfig QUIET)
44
if(PkgConfig_FOUND)
55
pkg_check_modules(PC_FFTW QUIET fftw3)
66
endif()
77

8-
# Search for the include directory
8+
# Look for FFTW headers
99
find_path(FFTW_INCLUDE_DIR
1010
NAMES fftw3.h
1111
HINTS
1212
${PC_FFTW_INCLUDE_DIRS}
13+
PATHS
1314
/usr/include
1415
/usr/local/include
1516
/opt/include
17+
/usr/include/x86_64-linux-gnu
1618
)
1719

18-
# Search for the library
20+
# Look for FFTW library
1921
find_library(FFTW_LIBRARY
2022
NAMES fftw3
2123
HINTS
2224
${PC_FFTW_LIBRARY_DIRS}
25+
PATHS
2326
/usr/lib
2427
/usr/lib64
2528
/usr/local/lib
2629
/opt/lib
2730
/usr/lib/x86_64-linux-gnu
2831
)
2932

30-
# Import handling
3133
include(FindPackageHandleStandardArgs)
3234

35+
# Use version info only if it's defined and not empty
3336
if(DEFINED PC_FFTW_VERSION AND NOT "${PC_FFTW_VERSION}" STREQUAL "")
3437
find_package_handle_standard_args(FFTW
3538
REQUIRED_VARS FFTW_LIBRARY FFTW_INCLUDE_DIR
@@ -43,7 +46,7 @@ endif()
4346

4447
mark_as_advanced(FFTW_INCLUDE_DIR FFTW_LIBRARY)
4548

46-
# Optional modern target alias
49+
# Optional modern imported target
4750
if(FFTW_FOUND AND NOT TARGET FFTW::FFTW)
4851
add_library(FFTW::FFTW UNKNOWN IMPORTED)
4952
set_target_properties(FFTW::FFTW PROPERTIES

0 commit comments

Comments
 (0)