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,8 +644,11 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES})
list( FIND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "${lib}" POSITION ) list( FIND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "${lib}" POSITION )
if ( "${POSITION}" STRGREATER "-1" ) # if lib is essential if ( "${POSITION}" STRGREATER "-1" ) # if lib is essential
option(WITH_${lib} "Select external library ${lib}" ON) option(WITH_${lib} "Select external library ${lib}" ON)
else() else() #GMPXX set in CGAL_SetupGMP.cmake
option(WITH_${lib} "Select external library ${lib}" OFF) string(COMPARE EQUAL "${lib}" "GMPXX" IS_LIB_GMPXX)
if(NOT ${IS_LIB_GMPXX})
option(WITH_${lib} "Select external library ${lib}" OFF)
endif()
endif() endif()
endforeach() endforeach()

View File

@ -23,12 +23,14 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CGAL_MODULES_DIR})
find_package(GMP REQUIRED) find_package(GMP REQUIRED)
find_package(MPFR 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) option(CGAL_WITH_GMPXX "Use CGAL with GMPXX: use C++ classes of GNU MP instead of CGAL wrappers" OFF)
endif() option(WITH_GMPXX "Select external library GMPXX" OFF)
if(WITH_GMPXX OR CGAL_WITH_GMPXX) else()
find_package(GMPXX REQUIRED) 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() endif()
#.rst: #.rst: