From 00219bc0169f802fb8d4c015e2e1710df6f14b85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 17:38:30 +0100 Subject: [PATCH 01/18] default arithmetic kernel when only boost mp is here --- Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h | 9 +++++++++ .../include/CGAL/BOOST_MP_arithmetic_kernel.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h index a01c7b70240..335d9e19d5d 100644 --- a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h @@ -59,6 +59,15 @@ typedef GMP_arithmetic_kernel Arithmetic_kernel; #endif // CGAL_USE_GMP #endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL +#ifndef CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL +#include +#if defined(CGAL_HAS_BOOST_MP_ARITHMETIC_KERNEL) +namespace CGAL{ +typedef BOOST_cpp_arithmetic_kernel Arithmetic_kernel; +}// namespace CGAL +#define CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL 1 +#endif // CGAL_USE_BOOST_MP +#endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL // Macro to snap typedefs in Arithmetic_kernel #define CGAL_SNAP_ARITHMETIC_KERNEL_TYPEDEFS(AT) \ diff --git a/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h index b1c1b1532e8..597e350bfd1 100644 --- a/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h @@ -25,6 +25,8 @@ //#include //#endif +#define CGAL_HAS_BOOST_MP_ARITHMETIC_KERNEL + // FIXME: the could be several kernels based on Boost.Multiprecision. namespace CGAL { From 40e624c0ae4dfbc5e6a6b8fcec86bdf584d96939 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:04:32 +0100 Subject: [PATCH 02/18] handle when LEDA is not present --- .../Arrangement_on_surface_2/cgal_test.cmake | 25 +++++++++++++------ .../cgal_test_with_cmake | 25 +++++++++++++------ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index 6ce6ad5b5d3..eb78143e7a9 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -72,13 +72,24 @@ if(CGAL_DISABLE_GMP) endif() if(CGAL_DISABLE_GMP) - message(STATUS "GMP is disable. Try to use LEDA instead.") - set(GMPZ_NT ${LEDA_INT_NT}) - set(QUOTIENT_CGAL_GMPZ_NT ${LEDA_RAT_NT}) - set(CGAL_GMPQ_NT ${LEDA_RAT_NT}) - set(LAZY_CGAL_GMPQ_NT ${LAZY_LEDA_RAT_NT}) - set(LAZY_GMPZ_NT ${LAZY_LEDA_RAT_NT}) - set(CGAL_GMPZ_NT ${LEDA_INT_NT}) + message(STATUS "GMP is disable.) + if (CGAL_USE_LEDA) + message(STATUS "Try to use LEDA instead.") + set(GMPZ_NT ${LEDA_INT_NT}) + set(QUOTIENT_CGAL_GMPZ_NT ${LEDA_RAT_NT}) + set(CGAL_GMPQ_NT ${LEDA_RAT_NT}) + set(LAZY_CGAL_GMPQ_NT ${LAZY_LEDA_RAT_NT}) + set(LAZY_GMPZ_NT ${LAZY_LEDA_RAT_NT}) + set(CGAL_GMPZ_NT ${LEDA_INT_NT}) + else() + message(STATUS "Try to use MP float instead.") + set(GMPZ_NT ${MP_FLOAT_NT}) + set(QUOTIENT_CGAL_GMPZ_NT ${QUOTIENT_MP_FLOAT_NT}) + set(CGAL_GMPQ_NT ${QUOTIENT_MP_FLOAT_NT}) + set(LAZY_CGAL_GMPQ_NT ${LAZY_QUOTIENT_MP_FLOAT_NT}) + set(LAZY_GMPZ_NT ${LAZY_QUOTIENT_MP_FLOAT_NT}) + set(CGAL_GMPZ_NT ${MP_FLOAT_NT}) + endif() endif() set(COMPARE 1) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake index 4d62ce61777..acf5c73f486 100755 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake @@ -78,13 +78,24 @@ CORE_INT_NT=15 CORE_RAT_NT=16 if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo GMP is disable. Try to use LEDA instead. - GMPZ_NT=$LEDA_INT_NT - QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT - CGAL_GMPQ_NT=$LEDA_RAT_NT - LAZY_CGAL_GMPQ_NT=$LAZY_LEDA_RAT_NT - LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT - CGAL_GMPZ_NT=$LEDA_INT_NT + echo GMP is disable. + if [ -n "CGAL_USE_LEDA" ]; then + echo Try to use LEDA instead. + GMPZ_NT=$LEDA_INT_NT + QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT + CGAL_GMPQ_NT=$LEDA_RAT_NT + LAZY_CGAL_GMPQ_NT=$LAZY_LEDA_RAT_NT + LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT + CGAL_GMPZ_NT=$LEDA_INT_NT + else + echo Try to use MP float instead. + GMPZ_NT=$MP_FLOAT_NT + QUOTIENT_CGAL_GMPZ_NT=$QUOTIENT_MP_FLOAT_NT + CGAL_GMPQ_NT=$QUOTIENT_MP_FLOAT_NT + LAZY_CGAL_GMPQ_NT=$LAZY_QUOTIENT_MP_FLOAT_NT + LAZY_GMPZ_NT=$LAZY_QUOTIENT_MP_FLOAT_NT + CGAL_GMPZ_NT=$MP_FLOAT_NT + fi fi COMPARE=1 From 4f9791a40b1ed37e06bf3d4515f201d8b7f15436 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:11:50 +0100 Subject: [PATCH 03/18] fix dependencies --- .../examples/Cone_spanners_2/CMakeLists.txt | 19 ++++-------------- .../test/Cone_spanners_2/CMakeLists.txt | 20 +++++++++++-------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt index ded37dfad08..99442720fc1 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt @@ -5,21 +5,10 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) find_package(LEDA QUIET) if(CGAL_Core_FOUND OR LEDA_FOUND) - if(MSVC) - # Turn off a boost related warning that appears with VC2015 - # boost_1_65_1\boost\graph\named_function_params.hpp(240) : - # warning C4172: returning address of local variable or temporary - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4172") - endif() - - # create a target per cppfile - file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") - endforeach() + create_single_source_cgal_program("compute_cones.cpp") + create_single_source_cgal_program("theta_io.cpp") else() message("NOTICE: This program requires the CGAL_Core library (or LEDA), and will not be compiled.") endif() + +create_single_source_cgal_program("dijkstra_theta.cpp") diff --git a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt index 462edfc7819..17c47060a82 100644 --- a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt @@ -5,12 +5,16 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Cone_spanners_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") -endforeach() +create_single_source_cgal_program("cones_inexact.cpp") +create_single_source_cgal_program("theta_inexact.cpp") +create_single_source_cgal_program("yao_inexact.cpp") + +if(CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("cones_exact.cpp") + create_single_source_cgal_program("theta_exact.cpp") + create_single_source_cgal_program("yao_exact.cpp") +else() + message("NOTICE: Some tests require the CGAL_Core library (or LEDA), and will not be compiled.") +endif() From 82fbb895098cf584a518de972415ddaecde92942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:14:47 +0100 Subject: [PATCH 04/18] encode LEDA/Core dependency --- .../Hyperbolic_triangulation_2/CMakeLists.txt | 9 +++++++-- .../Hyperbolic_triangulation_2/CMakeLists.txt | 19 ++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt index e5a66d69733..15433a72b16 100644 --- a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt @@ -5,6 +5,11 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Hyperbolic_triangulation_2_Examples) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) -create_single_source_cgal_program("ht2_example.cpp") -create_single_source_cgal_program("ht2_example_color.cpp") +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("ht2_example.cpp") + create_single_source_cgal_program("ht2_example_color.cpp") +else() + message("NOTICE: Examples require CGAL_Core (or LEDA), and will not be compiled.") +endif() diff --git a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt index 451ccac8d32..b61314c788b 100644 --- a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt @@ -5,11 +5,16 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Hyperbolic_triangulation_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) -create_single_source_cgal_program("ht2_test_clear.cpp") -create_single_source_cgal_program("ht2_test_locate.cpp") -create_single_source_cgal_program("ht2_test_remove.cpp") -create_single_source_cgal_program("ht2_test_swap.cpp") -create_single_source_cgal_program("ht2_test_copy.cpp") -create_single_source_cgal_program("ht2_test_hyperbolic_circulator.cpp") -create_single_source_cgal_program("ht2_test_insert_degenerate.cpp") +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("ht2_test_clear.cpp") + create_single_source_cgal_program("ht2_test_locate.cpp") + create_single_source_cgal_program("ht2_test_remove.cpp") + create_single_source_cgal_program("ht2_test_swap.cpp") + create_single_source_cgal_program("ht2_test_copy.cpp") + create_single_source_cgal_program("ht2_test_hyperbolic_circulator.cpp") + create_single_source_cgal_program("ht2_test_insert_degenerate.cpp") +else() + message("NOTICE: Tests require CGAL_Core (or LEDA), and will not be compiled.") +endif() From 3a8ced2ec99b6e14d5487d60bb0407ed06938a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:18:42 +0100 Subject: [PATCH 05/18] skip if neither core nor leda are present --- Kernel_23/test/Kernel_23/test_Has_conversion.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Kernel_23/test/Kernel_23/test_Has_conversion.cpp b/Kernel_23/test/Kernel_23/test_Has_conversion.cpp index c6f393a502d..2ef8186000a 100644 --- a/Kernel_23/test/Kernel_23/test_Has_conversion.cpp +++ b/Kernel_23/test/Kernel_23/test_Has_conversion.cpp @@ -14,7 +14,9 @@ #include #include +#if defined(CGAL_USE_CORE) || defined(CGAL_USE_LEDA) #include +#endif #include #include @@ -36,13 +38,16 @@ int main() typedef CGAL::Simple_homogeneous SH; typedef CGAL::Filtered_kernel FSH; +#if defined(CGAL_USE_CORE) || defined(CGAL_USE_LEDA) typedef CGAL::Exact_predicates_exact_constructions_kernel_with_kth_root EPECK; + CGAL_USE_TYPE(EPECK); +#endif CGAL_USE_TYPE(ASC); CGAL_USE_TYPE(FSC); CGAL_USE_TYPE(SH); CGAL_USE_TYPE(FSH); - CGAL_USE_TYPE(EPECK); + assert((CGAL::Has_conversion::value)); assert((CGAL::Has_conversion::value)); @@ -55,10 +60,12 @@ int main() assert((CGAL::Has_conversion::value)); assert((CGAL::Has_conversion::value)); +#if defined(CGAL_USE_CORE) || defined(CGAL_USE_LEDA) assert((CGAL::Has_conversion::value)); assert((CGAL::Has_conversion::value)); assert(!(CGAL::Has_conversion::value)); +#endif assert(!(CGAL::Has_conversion::value)); // below will produce static assert failures From 6decd7abfcd4ffb70854abd34f2b1e8a53e32d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:21:57 +0100 Subject: [PATCH 06/18] use exact integer --- Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp b/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp index e429bab74f2..0a63acc5c5c 100644 --- a/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp +++ b/Nef_S2/test/Nef_S2/Nef_polyhedron_S2-test.cpp @@ -1,14 +1,9 @@ #include #include #include +#include -#ifdef CGAL_USE_LEDA -#include -typedef leda_integer NT; -#else -#include -typedef CGAL::Gmpz NT; -#endif +typedef CGAL::Exact_integer NT; typedef CGAL::Homogeneous Kernel; typedef CGAL::Nef_polyhedron_S2 Nef_polyhedron; From ed3539f5fe1f3b3d3f76a5d4e4f4b4426d71036d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:33:54 +0100 Subject: [PATCH 07/18] add missing includes --- Number_types/test/Number_types/to_interval_test.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Number_types/test/Number_types/to_interval_test.cpp b/Number_types/test/Number_types/to_interval_test.cpp index 59752059bf6..553199db0a0 100644 --- a/Number_types/test/Number_types/to_interval_test.cpp +++ b/Number_types/test/Number_types/to_interval_test.cpp @@ -16,6 +16,11 @@ #include #endif + +#include +#include +#include + #if 0 #ifdef CGAL_USE_CLN #include From 1b0447eab7c66e5871ec9858df963d7450e812f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:36:34 +0100 Subject: [PATCH 08/18] EPECK_with_sqrt is actually disabled --- .../Polygon_mesh_processing/pmp_compute_normals_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp index 88a70ee95c0..ef45266f71d 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp @@ -15,10 +15,10 @@ #include typedef CGAL::Exact_predicates_inexact_constructions_kernel EPICK; -typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK; +//typedef CGAL::Exact_predicates_exact_constructions_kernel_with_sqrt EPECK; typedef CGAL::Surface_mesh EPICK_SM; -typedef CGAL::Surface_mesh EPECK_SM; +//typedef CGAL::Surface_mesh EPECK_SM; namespace PMP = CGAL::Polygon_mesh_processing; @@ -100,8 +100,8 @@ void test(const Mesh& mesh, { if (PMP::is_degenerate_triangle_face(f, mesh)) { - if (std::is_same()) - assert(get(fnormals, f) == CGAL::NULL_VECTOR); +// if (std::is_same()) +// assert(get(fnormals, f) == CGAL::NULL_VECTOR); } else assert(get(fnormals, f) != CGAL::NULL_VECTOR); From a10f7948319cefb04edf9eadbe1b597ae08ce933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:45:14 +0100 Subject: [PATCH 09/18] encode CORE/LEDA dependency --- .../Straight_skeleton_2/extrude_skeleton.cpp | 2 +- .../test/Straight_skeleton_2/CMakeLists.txt | 35 ++++++++++++------- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/extrude_skeleton.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/extrude_skeleton.cpp index cc73aa7493b..6fb5ad59dd4 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/extrude_skeleton.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/extrude_skeleton.cpp @@ -1,6 +1,6 @@ #include #include -#include +//#include #include #include diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt index 6138c50d054..ed7ce5a1282 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt @@ -5,23 +5,34 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Straight_skeleton_2_Tests) find_package(CGAL REQUIRED COMPONENTS Qt6 Core) +find_package(LEDA QUIET) include_directories(BEFORE "include") -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") -endforeach() +create_single_source_cgal_program("issue4533.cpp")") +create_single_source_cgal_program("issue4684.cpp") +create_single_source_cgal_program("test_sls.cpp") +create_single_source_cgal_program("test_sls_previous_issues.cpp") +create_single_source_cgal_program("test_sls_traits.cpp") +create_single_source_cgal_program("test_straight_skeleton_copy.cpp") if(CGAL_Qt6_FOUND) target_link_libraries(issue4684 PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(issue7149 PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(issue7284 PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(test_sls_previous_issues PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(test_sls_offset PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(test_sls_weighted_polygons_with_holes PUBLIC CGAL::CGAL_Basic_viewer) +endif() + +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("test_sls_offset.cpp") + create_single_source_cgal_program("issue7284.cpp") + create_single_source_cgal_program("test_sls_simple.cpp") + create_single_source_cgal_program("test_sls_weighted_polygons_with_holes.cpp") + create_single_source_cgal_program("issue7149.cpp") + if(CGAL_Qt6_FOUND) + target_link_libraries(issue7149 PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(issue7284 PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_offset PUBLIC CGAL::CGAL_Basic_viewer) + target_link_libraries(test_sls_weighted_polygons_with_holes PUBLIC CGAL::CGAL_Basic_viewer) + endif() +else() + message("NOTICE: Some test require CGAL_Core (or LEDA), and will not be compiled.") endif() From 8c17676886e549d3f4a79dea86386c77d0d42ac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:47:23 +0100 Subject: [PATCH 10/18] test requires Core or Leda --- .../CMakeLists.txt | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt b/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt index 8dd920fdf64..bfc26d7ea20 100644 --- a/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt +++ b/Straight_skeleton_extrusion_2/test/Straight_skeleton_extrusion_2/CMakeLists.txt @@ -5,18 +5,15 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Straight_skeleton_extrusion_2_Tests) find_package(CGAL REQUIRED COMPONENTS Qt6 Core) +find_package(LEDA QUIET) include_directories(BEFORE "include") -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") -endforeach() - -if(CGAL_Qt6_FOUND) - target_link_libraries(test_sls_extrude PUBLIC CGAL::CGAL_Basic_viewer) +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program("test_sls_extrude.cpp") + if(CGAL_Qt6_FOUND) + target_link_libraries(test_sls_extrude PUBLIC CGAL::CGAL_Basic_viewer) + endif() +else() + message("NOTICE: Tests require CGAL_Core (or LEDA), and will not be compiled.") endif() From dcc3617c088ffe496e40b8094a0105d66bae1c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:50:34 +0100 Subject: [PATCH 11/18] a test and an example requires Leda or Core --- .../examples/Triangulation_on_sphere_2/CMakeLists.txt | 8 +++++++- .../test/Triangulation_on_sphere_2/CMakeLists.txt | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt index 3d3d7367f53..65ed31daad1 100644 --- a/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/examples/Triangulation_on_sphere_2/CMakeLists.txt @@ -3,9 +3,15 @@ cmake_minimum_required(VERSION 3.1...3.23) project( Triangulation_on_sphere_2_Examples ) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) create_single_source_cgal_program( "triang_on_sphere.cpp" ) create_single_source_cgal_program( "triang_on_sphere_range.cpp" ) -create_single_source_cgal_program( "triang_on_sphere_exact.cpp" ) create_single_source_cgal_program( "triang_on_sphere_proj.cpp" ) create_single_source_cgal_program( "triang_on_sphere_geo.cpp" ) + +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program( "triang_on_sphere_exact.cpp" ) +else() + message("NOTICE: Some tests require CGAL_Core (or LEDA), and will not be compiled.") +endif() diff --git a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt index 6e26394bee1..0353327dfbe 100644 --- a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt @@ -3,14 +3,20 @@ cmake_minimum_required(VERSION 3.1...3.23) project( Triangulation_on_sphere_2_Tests ) find_package(CGAL REQUIRED COMPONENTS Core) +find_package(LEDA QUIET) create_single_source_cgal_program( "test_dtos.cpp" ) create_single_source_cgal_program( "test_dtos2_remove.cpp" ) -create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) create_single_source_cgal_program( "test_dtos_illegal_points.cpp" ) create_single_source_cgal_program( "test_dtos_projection_traits.cpp" ) create_single_source_cgal_program( "test_dtos_traits.cpp" ) +if (CGAL_Core_FOUND OR LEDA_FOUND) + create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) +else() + message("NOTICE: Some tests require CGAL_Core (or LEDA), and will not be compiled.") +endif() + find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) From ded0e2b5e8774b8c17a681144376aa36496e974c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Wed, 3 Jan 2024 18:57:05 +0100 Subject: [PATCH 12/18] typos --- .../test/Arrangement_on_surface_2/cgal_test.cmake | 2 +- Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index eb78143e7a9..80d8fcf3fa9 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -72,7 +72,7 @@ if(CGAL_DISABLE_GMP) endif() if(CGAL_DISABLE_GMP) - message(STATUS "GMP is disable.) + message(STATUS "GMP is disable.") if (CGAL_USE_LEDA) message(STATUS "Try to use LEDA instead.") set(GMPZ_NT ${LEDA_INT_NT}) diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt index ed7ce5a1282..20fdb058a7b 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(LEDA QUIET) include_directories(BEFORE "include") -create_single_source_cgal_program("issue4533.cpp")") +create_single_source_cgal_program("issue4533.cpp") create_single_source_cgal_program("issue4684.cpp") create_single_source_cgal_program("test_sls.cpp") create_single_source_cgal_program("test_sls_previous_issues.cpp") From d8ee730a4dae1f909708d51ff496958fd96840ca Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Thu, 4 Jan 2024 09:58:55 +0100 Subject: [PATCH 13/18] Revert "default arithmetic kernel when only boost mp is here" This reverts commit 00219bc0169f802fb8d4c015e2e1710df6f14b85. --- Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h | 9 --------- .../include/CGAL/BOOST_MP_arithmetic_kernel.h | 2 -- 2 files changed, 11 deletions(-) diff --git a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h index 335d9e19d5d..a01c7b70240 100644 --- a/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/Arithmetic_kernel.h @@ -59,15 +59,6 @@ typedef GMP_arithmetic_kernel Arithmetic_kernel; #endif // CGAL_USE_GMP #endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL -#ifndef CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL -#include -#if defined(CGAL_HAS_BOOST_MP_ARITHMETIC_KERNEL) -namespace CGAL{ -typedef BOOST_cpp_arithmetic_kernel Arithmetic_kernel; -}// namespace CGAL -#define CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL 1 -#endif // CGAL_USE_BOOST_MP -#endif // CGAL_HAS_DEFAULT_ARITHMETIC_KERNEL // Macro to snap typedefs in Arithmetic_kernel #define CGAL_SNAP_ARITHMETIC_KERNEL_TYPEDEFS(AT) \ diff --git a/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h b/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h index 597e350bfd1..b1c1b1532e8 100644 --- a/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h +++ b/Arithmetic_kernel/include/CGAL/BOOST_MP_arithmetic_kernel.h @@ -25,8 +25,6 @@ //#include //#endif -#define CGAL_HAS_BOOST_MP_ARITHMETIC_KERNEL - // FIXME: the could be several kernels based on Boost.Multiprecision. namespace CGAL { From 1d7cd990f9f3ed1c6cb6a7041e1685814c651e71 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Thu, 4 Jan 2024 10:15:03 +0100 Subject: [PATCH 14/18] more fixes when neither Core nor Leda is present --- Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h | 4 ++-- .../include/CGAL/Cone_spanners_2/Less_by_direction_2.h | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h index 74e12a8f4db..7e820e12a76 100644 --- a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h +++ b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h @@ -30,7 +30,6 @@ #include #include // CGAL_PI is defined there #include -#include #include namespace CGAL { @@ -111,7 +110,7 @@ public: }; - +#if defined(CGAL_USE_LEDA) || defined(CGAL_USE_CORE) /* The specialised functor for computing the directions of cone boundaries exactly with a given cone number and a given initial direction. @@ -209,6 +208,7 @@ public: } // end of operator() }; // end of functor specialization: Compute_cone_..._2 +#endif } // namespace CGAL diff --git a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Less_by_direction_2.h b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Less_by_direction_2.h index 6ba9f53652e..e36137df8fb 100644 --- a/Cone_spanners_2/include/CGAL/Cone_spanners_2/Less_by_direction_2.h +++ b/Cone_spanners_2/include/CGAL/Cone_spanners_2/Less_by_direction_2.h @@ -22,7 +22,6 @@ #include #include #include -#include #include #include From 7139a34f444344c5126a873a42d741e37a795393 Mon Sep 17 00:00:00 2001 From: Sebastien Loriot Date: Thu, 4 Jan 2024 10:20:16 +0100 Subject: [PATCH 15/18] hide non used header --- .../test/Polygon_mesh_processing/pmp_compute_normals_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp index ef45266f71d..3517709a72a 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/pmp_compute_normals_test.cpp @@ -1,7 +1,7 @@ // #define CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP #include -#include +//#include #include #include From b59250bfeb5e1a7ea1e05a7563331c0aca03b95a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 14:44:27 +0100 Subject: [PATCH 16/18] conditional compilation --- Envelope_3/test/Envelope_3/CMakeLists.txt | 15 +++++++-------- Envelope_3/test/Envelope_3/spheres_test.cpp | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Envelope_3/test/Envelope_3/CMakeLists.txt b/Envelope_3/test/Envelope_3/CMakeLists.txt index b087dba97ef..c5eb08f87fa 100644 --- a/Envelope_3/test/Envelope_3/CMakeLists.txt +++ b/Envelope_3/test/Envelope_3/CMakeLists.txt @@ -6,11 +6,10 @@ project(Envelope_3_Tests) find_package(CGAL REQUIRED COMPONENTS Core) -# create a target per cppfile -file( - GLOB cppfiles - RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) -foreach(cppfile ${cppfiles}) - create_single_source_cgal_program("${cppfile}") -endforeach() +create_single_source_cgal_program("triangles_test.cpp") + +if (CGAL_Core_FOUND) + create_single_source_cgal_program("spheres_test.cpp") +else() + message("NOTICE: A test requires CGAL_Core, and will not be compiled.") +endif() diff --git a/Envelope_3/test/Envelope_3/spheres_test.cpp b/Envelope_3/test/Envelope_3/spheres_test.cpp index 7fd2634e1a9..2d45e12526a 100644 --- a/Envelope_3/test/Envelope_3/spheres_test.cpp +++ b/Envelope_3/test/Envelope_3/spheres_test.cpp @@ -5,7 +5,7 @@ int main () { - bool UNTESTED_TRAITS_AS_CORE_IS_NOT_ISTALLED; + bool UNTESTED_TRAITS_AS_CORE_IS_NOT_INSTALLED; std::cout << std::endl << "WARNING: Core is not installed, " << "skipping the test ..." From 336a8f39dc77f7667681a65a35a83909231c12b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Thu, 4 Jan 2024 15:15:23 +0100 Subject: [PATCH 17/18] please CI --- Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h index 7e820e12a76..4256fd0dc17 100644 --- a/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h +++ b/Cone_spanners_2/include/CGAL/Compute_cone_boundaries_2.h @@ -30,6 +30,9 @@ #include #include // CGAL_PI is defined there #include +#if defined(CGAL_USE_LEDA) || defined(CGAL_USE_CORE) +#include +#endif #include namespace CGAL { From fbd15aa2ae773855565cf5d4373c69bf8a7c8b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Fri, 19 Jan 2024 13:55:53 +0100 Subject: [PATCH 18/18] make it cleaner --- .../test/Arrangement_on_surface_2/cgal_test.cmake | 5 ++--- .../test/Arrangement_on_surface_2/cgal_test_with_cmake | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake index 80d8fcf3fa9..59f174e0ba6 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test.cmake @@ -72,9 +72,8 @@ if(CGAL_DISABLE_GMP) endif() if(CGAL_DISABLE_GMP) - message(STATUS "GMP is disable.") if (CGAL_USE_LEDA) - message(STATUS "Try to use LEDA instead.") + message(STATUS "GMP is disabled, try to use LEDA instead.") set(GMPZ_NT ${LEDA_INT_NT}) set(QUOTIENT_CGAL_GMPZ_NT ${LEDA_RAT_NT}) set(CGAL_GMPQ_NT ${LEDA_RAT_NT}) @@ -82,7 +81,7 @@ if(CGAL_DISABLE_GMP) set(LAZY_GMPZ_NT ${LAZY_LEDA_RAT_NT}) set(CGAL_GMPZ_NT ${LEDA_INT_NT}) else() - message(STATUS "Try to use MP float instead.") + message(STATUS "GMP is disabled, try to use MP float instead.") set(GMPZ_NT ${MP_FLOAT_NT}) set(QUOTIENT_CGAL_GMPZ_NT ${QUOTIENT_MP_FLOAT_NT}) set(CGAL_GMPQ_NT ${QUOTIENT_MP_FLOAT_NT}) diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake index acf5c73f486..d8c26c68390 100755 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/cgal_test_with_cmake @@ -78,9 +78,8 @@ CORE_INT_NT=15 CORE_RAT_NT=16 if [ -n "${CGAL_DISABLE_GMP}" ]; then - echo GMP is disable. if [ -n "CGAL_USE_LEDA" ]; then - echo Try to use LEDA instead. + echo GMP is disabled, try to use LEDA instead. GMPZ_NT=$LEDA_INT_NT QUOTIENT_CGAL_GMPZ_NT=$LEDA_RAT_NT CGAL_GMPQ_NT=$LEDA_RAT_NT @@ -88,7 +87,7 @@ if [ -n "${CGAL_DISABLE_GMP}" ]; then LAZY_GMPZ_NT=$LAZY_LEDA_RAT_NT CGAL_GMPZ_NT=$LEDA_INT_NT else - echo Try to use MP float instead. + echo GMP is disabled, try to use MP float instead. GMPZ_NT=$MP_FLOAT_NT QUOTIENT_CGAL_GMPZ_NT=$QUOTIENT_MP_FLOAT_NT CGAL_GMPQ_NT=$QUOTIENT_MP_FLOAT_NT