fix conditional compilation of programs using CORE

This commit is contained in:
Sébastien Loriot 2024-03-14 11:30:14 +01:00
parent 44b7ec6f3a
commit 24015ce3a7
4 changed files with 12 additions and 10 deletions

View File

@ -55,12 +55,12 @@ inline int set_str(BigInt& a, const char* s) {
/// longValue /// longValue
inline long longValue(const BigInt& a) { inline long longValue(const BigInt& a) {
return a.convert_to<long>();; return a.convert_to<long>();
} }
/// doubleValue /// doubleValue
inline double doubleValue(const BigInt& a) { inline double doubleValue(const BigInt& a) {
return a.convert_to<double>();; return a.convert_to<double>();
} }
/// isEven /// isEven

View File

@ -138,7 +138,7 @@ foreach(comp ${CGAL_FIND_COMPONENTS})
message(FATAL_ERROR "The requested CGAL component ${comp} does not exist!") message(FATAL_ERROR "The requested CGAL component ${comp} does not exist!")
endif() endif()
if(comp MATCHES "Core" AND CGAL_DO_NOT_USE_BOOST_MP) if(comp MATCHES "Core" AND CGAL_DO_NOT_USE_BOOST_MP)
message("CGAL_Core needs Boost multiprecision support and won't be used.") message(STATUS "CGAL_Core needs Boost multiprecision support and won't be used.")
else() else()
list(APPEND CGAL_LIBRARIES CGAL_${comp}) list(APPEND CGAL_LIBRARIES CGAL_${comp})
endif() endif()

View File

@ -13,10 +13,6 @@ include_directories(BEFORE include)
create_single_source_cgal_program("bench_interval.cpp") create_single_source_cgal_program("bench_interval.cpp")
create_single_source_cgal_program("cpp_float.cpp") create_single_source_cgal_program("cpp_float.cpp")
create_single_source_cgal_program("constant.cpp") create_single_source_cgal_program("constant.cpp")
create_single_source_cgal_program("CORE_BigFloat.cpp")
create_single_source_cgal_program("CORE_BigInt.cpp")
create_single_source_cgal_program("CORE_BigRat.cpp")
create_single_source_cgal_program("CORE_Expr.cpp")
create_single_source_cgal_program("Counted_number.cpp") create_single_source_cgal_program("Counted_number.cpp")
create_single_source_cgal_program("double.cpp") create_single_source_cgal_program("double.cpp")
create_single_source_cgal_program("doubletst.cpp") create_single_source_cgal_program("doubletst.cpp")
@ -66,14 +62,17 @@ create_single_source_cgal_program("utilities.cpp")
create_single_source_cgal_program("Exact_rational.cpp") create_single_source_cgal_program("Exact_rational.cpp")
create_single_source_cgal_program("Mpzf_new.cpp") create_single_source_cgal_program("Mpzf_new.cpp")
find_package( GMP ) if( CGAL_CORE_FOUND )
if( GMP_FOUND AND NOT CGAL_DISABLE_GMP )
create_single_source_cgal_program( "CORE_Expr_ticket_4296.cpp" ) create_single_source_cgal_program( "CORE_Expr_ticket_4296.cpp" )
create_single_source_cgal_program("CORE_BigFloat.cpp")
create_single_source_cgal_program("CORE_BigInt.cpp")
create_single_source_cgal_program("CORE_BigRat.cpp")
create_single_source_cgal_program("CORE_Expr.cpp")
find_package(MPFI QUIET) find_package(MPFI QUIET)
if( MPFI_FOUND ) if( MPFI_FOUND )
include( ${MPFI_USE_FILE} ) include( ${MPFI_USE_FILE} )
endif() #MPFI_FOUND endif() #MPFI_FOUND
endif() #GMP_FOUND AND NOT CGAL_DISABLE_GMP endif() #CGAL_CORE_FOUND
if(NOT CGAL_DISABLE_GMP) if(NOT CGAL_DISABLE_GMP)
create_single_source_cgal_program( "Gmpfi.cpp" ) create_single_source_cgal_program( "Gmpfi.cpp" )

View File

@ -5,7 +5,10 @@
#include <CGAL/Lazy_exact_nt.h> #include <CGAL/Lazy_exact_nt.h>
#include <CGAL/Interval_nt.h> #include <CGAL/Interval_nt.h>
#include <CGAL/Sqrt_extension.h> #include <CGAL/Sqrt_extension.h>
#ifdef CGAL_USE_BOOST_MP
#include <CGAL/boost_mp.h> #include <CGAL/boost_mp.h>
#endif
#ifdef CGAL_USE_GMP #ifdef CGAL_USE_GMP
#include <CGAL/Gmpz.h> #include <CGAL/Gmpz.h>