diff --git a/Installation/cmake/modules/CGAL_SetupGMP.cmake b/Installation/cmake/modules/CGAL_SetupGMP.cmake index 757ca2637a7..ecd3fe59104 100644 --- a/Installation/cmake/modules/CGAL_SetupGMP.cmake +++ b/Installation/cmake/modules/CGAL_SetupGMP.cmake @@ -17,8 +17,17 @@ if(CGAL_SetupGMP_included OR CGAL_DISABLE_GMP) endif() set(CGAL_SetupGMP_included TRUE) -find_package(GMP) -find_package(MPFR) +find_package(GMP REQUIRED) +find_package(MPFR REQUIRED) + +if(NOT DEFINED WITH_GMPXX) + option(CGAL_WITH_GMPXX "Use CGAL with GMPXX: use C++ classes of GNU MP instead of CGAL wrappers" OFF) +endif() +set(CGAL_GMPXX_find_package_keyword QUIET) +if(WITH_GMPXX OR CGAL_WITH_GMPXX) + set(CGAL_GMPXX_find_package_keyword REQUIRED) +endif() +find_package(GMPXX ${CGAL_GMPXX_find_package_keyword}) #.rst: # Provided Functions @@ -45,6 +54,6 @@ function(use_CGAL_GMP_support target) return() endif() - target_include_directories(${target} SYSTEM ${keyword} ${GMP_INCLUDE_DIR} ${MPFR_INCLUDE_DIR}) - target_link_libraries(${target} ${keyword} ${GMP_LIBRARIES} ${MPFR_LIBRARIES}) + target_include_directories(${target} SYSTEM ${keyword} ${GMP_INCLUDE_DIR} ${GMPXX_INCLUDE_DIR} ${MPFR_INCLUDE_DIR}) + target_link_libraries(${target} ${keyword} ${GMP_LIBRARIES} ${GMPXX_LIBRARIES} ${MPFR_LIBRARIES}) endfunction()