2013-08-09 10:44:38 -05:00
|
|
|
# Module that checks whether the compiler supports the
|
|
|
|
# quadruple precision floating point math
|
|
|
|
#
|
2013-08-13 07:58:26 -05:00
|
|
|
# Sets the following variables:
|
2013-08-09 10:44:38 -05:00
|
|
|
# HAVE_QUAD
|
2013-08-13 07:58:26 -05:00
|
|
|
# QUADMATH_LIBRARIES
|
2013-08-09 10:44:38 -05:00
|
|
|
#
|
|
|
|
# perform tests
|
|
|
|
include(CheckCXXSourceCompiles)
|
|
|
|
include(CMakePushCheckState)
|
|
|
|
|
|
|
|
cmake_push_check_state()
|
|
|
|
list(APPEND CMAKE_REQUIRED_LIBRARIES "quadmath")
|
|
|
|
CHECK_C_SOURCE_COMPILES("
|
|
|
|
#include <quadmath.h>
|
|
|
|
|
|
|
|
int main(void){
|
|
|
|
__float128 foo = sqrtq(123.456);
|
|
|
|
}" HAVE_QUAD)
|
|
|
|
cmake_pop_check_state()
|
2013-08-13 07:58:26 -05:00
|
|
|
|
|
|
|
if (HAVE_QUAD)
|
|
|
|
set(QUADMATH_LIBRARIES "quadmath")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(QuadMath
|
|
|
|
DEFAULT_MSG
|
|
|
|
QUADMATH_LIBRARIES
|
|
|
|
HAVE_QUAD
|
|
|
|
)
|