diff options
author | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-12-05 16:01:45 +0100 |
---|---|---|
committer | ROUVREAU Vincent <vincent.rouvreau@inria.fr> | 2019-12-05 16:01:45 +0100 |
commit | 9fc45aafa4588b86ccd903b9173a8cdf48db68a1 (patch) | |
tree | cadafca9f37d6f11fae6f839ae3cd0d9aafbd31f /src/cmake/modules/FindMPFR.cmake | |
parent | 7df0113ddf2892b0cccf025a836214021b301072 (diff) |
Add MPFR dependency for python module. Use Epeck_d by default for Alpha complex. Add boolean exact version mechanism
Diffstat (limited to 'src/cmake/modules/FindMPFR.cmake')
-rw-r--r-- | src/cmake/modules/FindMPFR.cmake | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/src/cmake/modules/FindMPFR.cmake b/src/cmake/modules/FindMPFR.cmake new file mode 100644 index 00000000..6c963272 --- /dev/null +++ b/src/cmake/modules/FindMPFR.cmake @@ -0,0 +1,51 @@ +# Try to find the MPFR libraries +# MPFR_FOUND - system has MPFR lib +# MPFR_INCLUDE_DIR - the MPFR include directory +# MPFR_LIBRARIES_DIR - Directory where the MPFR libraries are located +# MPFR_LIBRARIES - the MPFR libraries + +# TODO: support MacOSX + +include(FindPackageHandleStandardArgs) + +if(MPFR_INCLUDE_DIR) + set(MPFR_in_cache TRUE) +else() + set(MPFR_in_cache FALSE) +endif() +if(NOT MPFR_LIBRARIES) + set(MPFR_in_cache FALSE) +endif() + +# Is it already configured? +if (MPFR_in_cache) + set(MPFR_FOUND TRUE) +else() + find_path(MPFR_INCLUDE_DIR + NAMES mpfr.h + HINTS ENV MPFR_INC_DIR + ENV MPFR_DIR + ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/include + PATH_SUFFIXES include + DOC "The directory containing the MPFR header files" + ) + + find_library(MPFR_LIBRARIES NAMES mpfr libmpfr-4 libmpfr-1 + HINTS ENV MPFR_LIB_DIR + ENV MPFR_DIR + ${CGAL_INSTALLATION_PACKAGE_DIR}/auxiliary/gmp/lib + PATH_SUFFIXES lib + DOC "Path to the MPFR library" + ) + + if ( MPFR_LIBRARIES ) + get_filename_component(MPFR_LIBRARIES_DIR ${MPFR_LIBRARIES} PATH CACHE ) + endif() + + # Attempt to load a user-defined configuration for MPFR if couldn't be found + if ( NOT MPFR_INCLUDE_DIR OR NOT MPFR_LIBRARIES_DIR ) + include( MPFRConfig OPTIONAL ) + endif() + + find_package_handle_standard_args(MPFR "DEFAULT_MSG" MPFR_LIBRARIES MPFR_INCLUDE_DIR) +endif() |