Set WITH_GMPXX ON if GMPXX is found in the cmake options of cgal

This commit is contained in:
Maxime Gimeno 2019-10-03 13:28:10 +02:00
parent f46c9888e6
commit 60d3851a20
2 changed files with 11 additions and 6 deletions

View File

@ -644,9 +644,12 @@ 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()
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()

View File

@ -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: