use CGAL::OpenMesh_support in examples and tests

This commit is contained in:
Jane Tournois 2024-08-27 14:02:37 +02:00
parent 603f6a5a03
commit 3f6083e6ff
15 changed files with 61 additions and 73 deletions

View File

@ -7,11 +7,11 @@ project(BGL_OpenMesh_Examples)
# CGAL and its components
find_package(CGAL REQUIRED)
find_package(OpenMesh)
find_package(OpenMesh CONFIG)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
create_single_source_cgal_program("TriMesh.cpp")
target_link_libraries(TriMesh PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(TriMesh PRIVATE CGAL::OpenMesh_support)
else()
message("NOTICE: This project requires OpenMesh and will not be compiled.")
endif()

View File

@ -16,10 +16,10 @@ create_single_source_cgal_program("range.cpp")
create_single_source_cgal_program("transform_iterator.cpp")
create_single_source_cgal_program("copy_polyhedron.cpp")
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
target_link_libraries(copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES})
target_compile_definitions(copy_polyhedron PRIVATE -DCGAL_USE_OPENMESH)
include(CGAL_OpenMesh_support)
target_link_libraries(copy_polyhedron PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: The example 'copy_polyhedron' will not use OpenMesh.")
endif()

View File

@ -40,28 +40,20 @@ create_single_source_cgal_program("bench_read_from_stream_vs_add_face_and_add_fa
create_single_source_cgal_program("graph_traits_inheritance.cpp" )
create_single_source_cgal_program("test_deprecated_io.cpp")
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
add_definitions(-DCGAL_USE_OPENMESH)
include(CGAL_OpenMesh_support)
target_link_libraries(test_clear PRIVATE ${OPENMESH_LIBRARIES})
target_compile_definitions(test_clear PRIVATE -DCGAL_USE_OPENMESH)
target_link_libraries(test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES})
target_compile_definitions(test_Euler_operations PRIVATE -DCGAL_USE_OPENMESH)
target_link_libraries(test_Collapse_edge PRIVATE ${OPENMESH_LIBRARIES})
target_compile_definitions(test_Collapse_edge PRIVATE -DCGAL_USE_OPENMESH)
target_link_libraries(test_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES})
target_compile_definitions(test_Face_filtered_graph PRIVATE -DCGAL_USE_OPENMESH)
target_link_libraries(test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} )
target_compile_definitions(test_graph_traits PRIVATE -DCGAL_USE_OPENMESH)
target_link_libraries(test_Properties PRIVATE ${OPENMESH_LIBRARIES})
target_compile_definitions(test_Properties PRIVATE -DCGAL_USE_OPENMESH)
target_link_libraries(test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES})
target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_OPENMESH)
target_link_libraries(test_clear PRIVATE CGAL::OpenMesh_support)
target_link_libraries(test_Euler_operations PRIVATE CGAL::OpenMesh_support)
target_link_libraries(test_Collapse_edge PRIVATE CGAL::OpenMesh_support)
target_link_libraries(test_Face_filtered_graph PRIVATE CGAL::OpenMesh_support)
target_link_libraries(test_graph_traits PRIVATE CGAL::OpenMesh_support )
target_link_libraries(test_Properties PRIVATE CGAL::OpenMesh_support)
target_link_libraries(test_bgl_read_write PRIVATE CGAL::OpenMesh_support)
create_single_source_cgal_program("graph_concept_OpenMesh.cpp")
target_link_libraries(graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(graph_concept_OpenMesh PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.")
endif()

View File

@ -27,14 +27,13 @@ cgal_add_compilation_test(Combinatorial_map_copy_test_index)
create_single_source_cgal_program(cmap_test_split_attribute.cpp)
# Link with OpenMesh if possible
find_package(OpenMesh QUIET)
if(TARGET OpenMesh::OpenMesh)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
message(STATUS "Found OpenMesh")
include(CGAL_OpenMesh_support)
target_link_libraries(Combinatorial_map_copy_test PRIVATE OpenMesh::OpenMesh)
target_compile_definitions(Combinatorial_map_copy_test PRIVATE -DCGAL_USE_OPENMESH)
target_link_libraries(Combinatorial_map_copy_test_index PRIVATE OpenMesh::OpenMesh)
target_compile_definitions(Combinatorial_map_copy_test_index PRIVATE -DCGAL_USE_OPENMESH)
target_link_libraries(Combinatorial_map_copy_test PRIVATE CGAL::OpenMesh_support)
target_link_libraries(Combinatorial_map_copy_test_index PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Tests will not use OpenMesh.")
endif()

View File

@ -19,15 +19,15 @@ create_single_source_cgal_program("quickhull_any_dim_3.cpp")
create_single_source_cgal_program("extreme_points_3_sm.cpp")
create_single_source_cgal_program("extreme_indices_3.cpp")
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
message(STATUS "Found OpenMesh")
create_single_source_cgal_program("quickhull_OM_3.cpp")
target_link_libraries(quickhull_OM_3 PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(quickhull_OM_3 PRIVATE CGAL::OpenMesh_support)
create_single_source_cgal_program("dynamic_hull_OM_3.cpp")
target_link_libraries(dynamic_hull_OM_3 PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(dynamic_hull_OM_3 PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.")
endif()

View File

@ -93,32 +93,31 @@ else()
message(STATUS "NOTICE: Examples that use Eigen will not be compiled.")
endif()
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
create_single_source_cgal_program("compute_normals_example_OM.cpp")
target_link_libraries(compute_normals_example_OM PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(compute_normals_example_OM PRIVATE CGAL::OpenMesh_support)
create_single_source_cgal_program("corefinement_OM_union.cpp")
target_link_libraries(corefinement_OM_union PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(corefinement_OM_union PRIVATE CGAL::OpenMesh_support)
if(TARGET CGAL::Eigen3_support)
create_single_source_cgal_program("hole_filling_example_OM.cpp")
target_link_libraries(hole_filling_example_OM PRIVATE CGAL::Eigen3_support ${OPENMESH_LIBRARIES})
target_link_libraries(hole_filling_example_OM PRIVATE CGAL::Eigen3_support CGAL::OpenMesh_support)
endif()
create_single_source_cgal_program("point_inside_example_OM.cpp")
target_link_libraries(point_inside_example_OM PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(point_inside_example_OM PRIVATE CGAL::OpenMesh_support)
create_single_source_cgal_program("stitch_borders_example_OM.cpp")
target_link_libraries(stitch_borders_example_OM PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(stitch_borders_example_OM PRIVATE CGAL::OpenMesh_support)
#create_single_source_cgal_program("remove_degeneracies_example.cpp")
#target_link_libraries(remove_degeneracies_example PRIVATE ${OPENMESH_LIBRARIES})
#target_compile_definitions(remove_degeneracies_example PRIVATE -DCGAL_USE_OPENMESH)
#target_link_libraries(remove_degeneracies_example PRIVATE CGAL::OpenMesh_support)
create_single_source_cgal_program("triangulate_faces_example_OM.cpp")
target_link_libraries(triangulate_faces_example_OM PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(triangulate_faces_example_OM PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.")
endif()

View File

@ -112,11 +112,11 @@ else()
message(STATUS "NOTICE: Intel TBB was not found. Tests will use sequential code.")
endif()
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
create_single_source_cgal_program("remeshing_test_P_SM_OM.cpp")
target_link_libraries(remeshing_test_P_SM_OM PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(remeshing_test_P_SM_OM PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.")
endif()

View File

@ -10,13 +10,11 @@ create_single_source_cgal_program("dynamic_properties_test.cpp")
create_single_source_cgal_program("kernel_converter_properties_test.cpp")
create_single_source_cgal_program("test_Property_container.cpp")
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
message(STATUS "Found OpenMesh")
include(UseOpenMesh)
target_link_libraries(dynamic_properties_test PRIVATE ${OPENMESH_LIBRARIES})
target_compile_definitions(dynamic_properties_test PRIVATE -DCGAL_USE_OPENMESH)
include(CGAL_OpenMesh_support)
target_link_libraries(dynamic_properties_test PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Tests will not use OpenMesh.")
endif()

View File

@ -61,13 +61,13 @@ if(TARGET CGAL::TBB_support)
target_link_libraries(test_for_each PUBLIC CGAL::TBB_support)
endif()
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
message(STATUS "Found OpenMesh")
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
create_single_source_cgal_program("test_hash_OpenMesh.cpp")
target_link_libraries(test_hash_OpenMesh PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(test_hash_OpenMesh PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.")
endif()

View File

@ -31,14 +31,14 @@ if(TARGET CGAL::Eigen3_support)
target_link_libraries(${target} PUBLIC CGAL::Eigen3_support)
endforeach()
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
message(STATUS "Found OpenMesh")
create_single_source_cgal_program("all_roi_assign_example_with_OpenMesh.cpp")
target_link_libraries(all_roi_assign_example_with_OpenMesh
PRIVATE ${OPENMESH_LIBRARIES} CGAL::Eigen3_support)
PRIVATE CGAL::OpenMesh_support CGAL::Eigen3_support)
else()
message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.")
endif()

View File

@ -16,14 +16,14 @@ if(TARGET CGAL::Eigen3_support)
create_single_source_cgal_program("Symmetry_test.cpp")
target_link_libraries(Symmetry_test PUBLIC CGAL::Eigen3_support)
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
message(STATUS "Found OpenMesh")
create_single_source_cgal_program("Cactus_deformation_session_OpenMesh.cpp")
target_link_libraries(Cactus_deformation_session_OpenMesh
PRIVATE ${OPENMESH_LIBRARIES} CGAL::Eigen3_support)
PRIVATE CGAL::OpenMesh_support CGAL::Eigen3_support)
else()
message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.")
endif()

View File

@ -15,13 +15,13 @@ create_single_source_cgal_program("segmentation_from_sdf_values_SM_example.cpp")
create_single_source_cgal_program("segmentation_from_sdf_values_LCC_example.cpp")
create_single_source_cgal_program("extract_segmentation_into_mesh_example.cpp")
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
message(STATUS "Found OpenMesh")
create_single_source_cgal_program("segmentation_from_sdf_values_OpenMesh_example.cpp")
target_link_libraries(segmentation_from_sdf_values_OpenMesh_example PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(segmentation_from_sdf_values_OpenMesh_example PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.")
endif()

View File

@ -13,13 +13,13 @@ create_single_source_cgal_program("shortest_paths_with_id.cpp")
create_single_source_cgal_program("shortest_paths.cpp")
create_single_source_cgal_program("shortest_path_with_locate.cpp")
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
message(STATUS "Found OpenMesh")
create_single_source_cgal_program("shortest_paths_OpenMesh.cpp")
target_link_libraries(shortest_paths_OpenMesh PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(shortest_paths_OpenMesh PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.")
endif()

View File

@ -28,13 +28,13 @@ else()
message(STATUS "NOTICE: Garland-Heckbert polices require the Eigen library, which has not been found; related examples will not be compiled.")
endif()
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
message(STATUS "Found OpenMesh")
create_single_source_cgal_program("edge_collapse_OpenMesh.cpp")
target_link_libraries(edge_collapse_OpenMesh PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(edge_collapse_OpenMesh PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.")
endif()

View File

@ -29,13 +29,13 @@ if(TARGET CGAL::Eigen3_support)
target_link_libraries(${target} PUBLIC CGAL::Eigen3_support)
endforeach()
find_package(OpenMesh QUIET)
find_package(OpenMesh CONFIG QUIET)
if(OpenMesh_FOUND)
include(UseOpenMesh)
include(CGAL_OpenMesh_support)
message(STATUS "Found OpenMesh")
create_single_source_cgal_program("MCF_Skeleton_om_example.cpp")
target_link_libraries(MCF_Skeleton_om_example PUBLIC CGAL::Eigen3_support PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(MCF_Skeleton_om_example PUBLIC CGAL::Eigen3_support PRIVATE CGAL::OpenMesh_support)
else()
message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.")
endif()