You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
987 B

  1. # Try to find GMP
  2. # Once done this will define:
  3. # - GMP_FOUND - True if the system has GMP
  4. # - GMP_INCLUDE_DIRS - include directories for compiling
  5. # - GMP_LIBRARIES - libraries for linking
  6. # - GMP_DEFINITIONS - cflags suggested by pkg-config
  7. find_package(PkgConfig)
  8. pkg_check_modules(PC_GMP QUIET gmp)
  9. set(GMP_INCLUDE "" CACHE PATH "include dir")
  10. set(GMP_LOCATION "" CACHE PATH "location dir")
  11. set(GMP_DEFINITIONS ${PC_GMP_CFLAGS_OTHER})
  12. find_path(GMP_INCLUDE_DIR gmp.h
  13. HINTS ${GMP_INCLUDE} ${PC_GMP_INCLUDEDIR} ${PC_GMP_INCLUDE_DIRS})
  14. find_library(GMP_LIBRARIES NAMES gmp libgmp
  15. HINTS ${GMP_LOCATION} ${PC_GMP_LIBDIR} ${PC_GMP_LIBRARY_DIRS} NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH)
  16. include(FindPackageHandleStandardArgs)
  17. # handle the QUIETLY and REQUIRED arguments and set GMP_FOUND to TRUE
  18. # if all listed variables are TRUE
  19. find_package_handle_standard_args(GMP DEFAULT_MSG GMP_LIBRARIES GMP_INCLUDE_DIR)
  20. mark_as_advanced(GMP_INCLUDE_DIR GMP_LIBRARIES)