summaryrefslogtreecommitdiff
path: root/src/cmake/modules/FindGMPXX.cmake
diff options
context:
space:
mode:
authorGard Spreemann <gspr@nonempty.org>2019-09-25 14:53:36 +0200
committerGard Spreemann <gspr@nonempty.org>2019-09-25 14:53:36 +0200
commit70ad5fc411b0e0a3d590ad281fc97d488994062b (patch)
treeb0ddd84d7ee935936787eee2b75f78f2e21c41f0 /src/cmake/modules/FindGMPXX.cmake
parentb50046e487ab42cdef19b02128a9f498d6a36482 (diff)
parent5ccee32ec2ba38743c6b96867db3e1b5151e45e4 (diff)
Merge branch 'dfsg/latest' into debian/sid
Diffstat (limited to 'src/cmake/modules/FindGMPXX.cmake')
-rw-r--r--src/cmake/modules/FindGMPXX.cmake48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/cmake/modules/FindGMPXX.cmake b/src/cmake/modules/FindGMPXX.cmake
new file mode 100644
index 00000000..dda302c0
--- /dev/null
+++ b/src/cmake/modules/FindGMPXX.cmake
@@ -0,0 +1,48 @@
+# - Try to find the GMPXX libraries
+# This module defines:
+# GMPXX_FOUND - system has GMPXX lib
+# GMPXX_INCLUDE_DIR - the GMPXX include directory
+# GMPXX_LIBRARIES - Libraries needed to use GMPXX
+
+# TODO: support Windows and MacOSX
+
+# GMPXX needs GMP
+
+find_package( GMP QUIET )
+
+if(GMP_FOUND)
+
+ if (GMPXX_INCLUDE_DIR AND GMPXX_LIBRARIES)
+ # Already in cache, be silent
+ set(GMPXX_FIND_QUIETLY TRUE)
+ endif()
+
+ find_path(GMPXX_INCLUDE_DIR NAMES gmpxx.h
+ HINTS ENV GMPXX_INC_DIR
+ ENV GMPXX_DIR
+ ${GMP_INCLUDE_DIR_SEARCH}
+ PATH_SUFFIXES include
+ DOC "The directory containing the GMPXX include files"
+ )
+
+ find_library(GMPXX_LIBRARIES NAMES gmpxx
+ HINTS ENV GMPXX_LIB_DIR
+ ENV GMPXX_DIR
+ ${GMP_LIBRARIES_DIR_SEARCH}
+ PATH_SUFFIXES lib
+ DOC "Path to the GMPXX library"
+ )
+
+ if ( GMPXX_LIBRARIES )
+ get_filename_component(GMPXX_LIBRARIES_DIR ${GMPXX_LIBRARIES} PATH CACHE )
+ endif()
+
+ include(FindPackageHandleStandardArgs)
+
+ find_package_handle_standard_args(GMPXX "DEFAULT_MSG" GMPXX_LIBRARIES GMPXX_INCLUDE_DIR )
+
+else()
+
+ message( FATAL_ERROR "GMPXX needs GMP")
+
+endif()