From a2d4a327366517fbc3d7dae8cd4a46b3e0b010dd Mon Sep 17 00:00:00 2001 From: Andreas Lauser Date: Tue, 13 Aug 2013 14:58:26 +0200 Subject: [PATCH] make the build system link to the "quadmath" library if it is supported Thanks a lot to Roland Kaufmann for the support. --- cmake/Modules/FindQuadmath.cmake | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/cmake/Modules/FindQuadmath.cmake b/cmake/Modules/FindQuadmath.cmake index 63f181283..4752e478e 100644 --- a/cmake/Modules/FindQuadmath.cmake +++ b/cmake/Modules/FindQuadmath.cmake @@ -1,8 +1,9 @@ # Module that checks whether the compiler supports the # quadruple precision floating point math # -# Sets the following variable: +# Sets the following variables: # HAVE_QUAD +# QUADMATH_LIBRARIES # # perform tests include(CheckCXXSourceCompiles) @@ -17,3 +18,14 @@ int main(void){ __float128 foo = sqrtq(123.456); }" HAVE_QUAD) cmake_pop_check_state() + +if (HAVE_QUAD) + set(QUADMATH_LIBRARIES "quadmath") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(QuadMath + DEFAULT_MSG + QUADMATH_LIBRARIES + HAVE_QUAD + )