diff --git a/Installation/lib/cmake/CGAL/CGALConfig.cmake b/Installation/lib/cmake/CGAL/CGALConfig.cmake index b807ad3c412..7e0ae8a78ab 100644 --- a/Installation/lib/cmake/CGAL/CGALConfig.cmake +++ b/Installation/lib/cmake/CGAL/CGALConfig.cmake @@ -200,3 +200,15 @@ if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE ) # Do not use -isystem for CGAL include paths set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE) endif() + +#warning: the order in this list has to match the enum in Exact_type_selector +set(CGAL_CMAKE_EXACT_NT_BACKEND_OPTIONS GMP_BACKEND GMPXX_BACKEND BOOST_GMP_BACKEND BOOST_BACKEND LEDA_BACKEND MP_FLOAT_BACKEND Default) +set(CGAL_CMAKE_EXACT_NT_BACKEND "Default" CACHE STRING "Setting for advanced users that what to change the default number types used in filtered kernels. Some options might not be working depending on how you configured your build.") +#~ set_property(CACHE CGAL_CMAKE_EXACT_NT_BACKEND PROPERTY STRINGS GMP_BACKEND GMPXX_BACKEND BOOST_GMP_BACKEND BOOST_BACKEND LEDA_BACKEND MP_FLOAT_BACKEND) +set_property(CACHE CGAL_CMAKE_EXACT_NT_BACKEND PROPERTY STRINGS ${CGAL_CMAKE_EXACT_NT_BACKEND_OPTIONS}) + +if ( NOT "${CGAL_CMAKE_EXACT_NT_BACKEND}" STREQUAL "Default" ) + list(FIND CGAL_CMAKE_EXACT_NT_BACKEND_OPTIONS ${CGAL_CMAKE_EXACT_NT_BACKEND} DEB_VAL) + set_target_properties(CGAL PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "CMAKE_OVERRIDDEN_DEFAULT_ENT_BACKEND=${DEB_VAL}") +endif() diff --git a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h index ca85367e53b..3b54de0e0cc 100644 --- a/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h +++ b/Number_types/include/CGAL/Number_types/internal/Exact_type_selector.h @@ -54,7 +54,7 @@ namespace CGAL { namespace internal { // to answer predicates at the end of the filtering chain of predicates and EPECK uses // Exact_field_selector for as its exact number type. - +// Warning, the order in this list must match the one in Installation/lib/cmake/CGALConfig.cmake enum ENT_backend_choice { GMP_BACKEND, @@ -132,6 +132,7 @@ struct Exact_NT_backend typedef MP_Float Integer; }; +#ifndef CMAKE_OVERRIDDEN_DEFAULT_ENT_BACKEND constexpr ENT_backend_choice Default_exact_nt_backend = #if BOOST_VERSION > 107900 && defined(CGAL_USE_BOOST_MP) BOOST_BACKEND; @@ -150,6 +151,9 @@ constexpr ENT_backend_choice Default_exact_nt_backend = MP_FLOAT_BACKEND; #endif #endif // BOOST_VERSION > 107900 +#else +constexpr ENT_backend_choice Default_exact_nt_backend = static_cast(CMAKE_OVERRIDDEN_DEFAULT_ENT_BACKEND); +#endif template < typename > struct Exact_field_selector