mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Seems like I forgot to include the "CheckCSourceCompiles" macro before using it. Since it worked for me before, I'm wondering what made this happen. Anyway, it should now work correctly in all cases.
33 lines
683 B
CMake
33 lines
683 B
CMake
# Module that checks whether the compiler supports the
|
|
# quadruple precision floating point math
|
|
#
|
|
# Sets the following variables:
|
|
# HAVE_QUAD
|
|
# QUADMATH_LIBRARIES
|
|
#
|
|
# perform tests
|
|
include(CheckCSourceCompiles)
|
|
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()
|
|
|
|
if (HAVE_QUAD)
|
|
set(QUADMATH_LIBRARIES "quadmath")
|
|
endif()
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
find_package_handle_standard_args(QuadMath
|
|
DEFAULT_MSG
|
|
QUADMATH_LIBRARIES
|
|
HAVE_QUAD
|
|
)
|