diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d0496b1..05921f7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,6 +91,15 @@ if (UNIX) endif () check_symbol_exists (cosl math.h HAVE_COSL) check_symbol_exists (sinl math.h HAVE_SINL) +if (ENABLE_QUAD_PRECISION) + set(SAVE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") + set(CMAKE_REQUIRED_LIBRARIES "quadmath") + check_symbol_exists (sinq quadmath.h HAVE_QUADMATH) + set(CMAKE_REQUIRED_FLAGS "${SAVE_CMAKE_REQUIRED_FLAGS}") + if(NOT HAVE_QUADMATH) + MESSAGE(FATAL_ERROR "uad precision requires libquadmath for quad-precision trigonometric routines") + endif() +endif() include (CheckTypeSize) check_type_size ("float" SIZEOF_FLOAT) @@ -345,7 +354,9 @@ endif () if (HAVE_LIBM) target_link_libraries (${fftw3_lib} m) endif () - +if (ENABLE_QUAD_PRECISION) + target_link_libraries (${fftw3_lib} quadmath) +endif() set (subtargets ${fftw3_lib}) if (Threads_FOUND)