Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,15 @@ MACRO_LOG_FEATURE(JANSSON_FOUND
"Essential: JSON support"
"http://www.digip.org/jansson/"
TRUE)

FIND_PACKAGE(MPFR)
INCLUDE_DIRECTORIES(${MPFR_INCLUDE_DIR})
MACRO_LOG_FEATURE(MPFR_FOUND
"MPFR"
"High precision computation"
"http://www.mpfr.org/"
TRUE)


IF (NOT DISABLE_PYTHON)
MESSAGE (STATUS "Searching for a Python installation")
Expand Down
47 changes: 47 additions & 0 deletions cmake/modules/FindMPFR.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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

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 (NOT MPFR_in_cache)

find_path(MPFR_INCLUDE_DIR
NAMES mpfr.h
HINTS ENV MPFR_INC_DIR
ENV MPFR_DIR
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
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()

endif()

find_package_handle_standard_args(MPFR "DEFAULT_MSG" MPFR_LIBRARIES MPFR_INCLUDE_DIR)
2 changes: 1 addition & 1 deletion engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ ADD_LIBRARY("regina-engine" SHARED ${SOURCES} )
# that build against libregina-engine.
# Note: PUBLIC and PRIVATE only appeard in CMake 2.8.12.
# For compatibility back to 2.8.7 we use LINK_PUBLIC and LINK_PRIVATE instead.
SET(ENGINE_LINK_LIBRARIES ${LIBXML2_LIBRARIES} ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
SET(ENGINE_LINK_LIBRARIES ${LIBXML2_LIBRARIES} ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${MPFR_LIBRARIES})
TARGET_LINK_LIBRARIES(regina-engine
LINK_PUBLIC ${ENGINE_LINK_LIBRARIES}
LINK_PRIVATE ${STDFS_LIBRARY} "${ICONV_LIBRARY}" ${ZLIB_LIBRARIES} ${JANSSON_LIBRARIES} ${KVSTORE_LIBRARIES})
Expand Down
1 change: 1 addition & 0 deletions engine/maths/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ if (${REGINA_INSTALL_DEV})
matrix.h
matrix2.h
matrixops.h
mfloat.h
numbertheory.h
perm.h
perm-impl.h
Expand Down
Loading