diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index f16e99d4a1a..cfaff45d430 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -644,8 +644,11 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) list( FIND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "${lib}" POSITION ) if ( "${POSITION}" STRGREATER "-1" ) # if lib is essential option(WITH_${lib} "Select external library ${lib}" ON) - else() - option(WITH_${lib} "Select external library ${lib}" OFF) + else() #GMPXX set in CGAL_SetupGMP.cmake + string(COMPARE EQUAL "${lib}" "GMPXX" IS_LIB_GMPXX) + if(NOT ${IS_LIB_GMPXX}) + option(WITH_${lib} "Select external library ${lib}" OFF) + endif() endif() endforeach() diff --git a/Installation/cmake/modules/CGAL_SetupGMP.cmake b/Installation/cmake/modules/CGAL_SetupGMP.cmake index 1a8c28a3c13..26fc412e135 100644 --- a/Installation/cmake/modules/CGAL_SetupGMP.cmake +++ b/Installation/cmake/modules/CGAL_SetupGMP.cmake @@ -23,12 +23,14 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CGAL_MODULES_DIR}) find_package(GMP REQUIRED) find_package(MPFR REQUIRED) +find_package(GMPXX QUIET) -if(NOT DEFINED WITH_GMPXX) +if(NOT GMPXX_FOUND) option(CGAL_WITH_GMPXX "Use CGAL with GMPXX: use C++ classes of GNU MP instead of CGAL wrappers" OFF) -endif() -if(WITH_GMPXX OR CGAL_WITH_GMPXX) - find_package(GMPXX REQUIRED) + option(WITH_GMPXX "Select external library GMPXX" OFF) +else() + option(CGAL_WITH_GMPXX "Use CGAL with GMPXX: use C++ classes of GNU MP instead of CGAL wrappers" ON) + option(WITH_GMPXX "Select external library GMPXX" ON) endif() #.rst: