Merge remote-tracking branch 'mine/Installation-findOpenMesh-jtournois' into BGL-Openmesh_selection-GF

# Conflicts:
#	BGL/examples/BGL_OpenMesh/CMakeLists.txt
This commit is contained in:
Jane Tournois 2024-09-05 10:14:54 +02:00
commit 4324445fcb
20 changed files with 68 additions and 189 deletions

View File

@ -9,12 +9,12 @@ find_package(CGAL REQUIRED)
find_package(OpenMesh)
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)
create_single_source_cgal_program("PolyMesh.cpp")
target_link_libraries(PolyMesh PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries(PolyMesh PRIVATE CGAL::OpenMesh_support)
else()
message("NOTICE: This project requires OpenMesh and will not be compiled.")
endif()

View File

@ -18,8 +18,8 @@ create_single_source_cgal_program("copy_polyhedron.cpp")
find_package(OpenMesh 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

@ -42,26 +42,18 @@ create_single_source_cgal_program("test_deprecated_io.cpp")
find_package(OpenMesh 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

@ -28,13 +28,12 @@ create_single_source_cgal_program(cmap_test_split_attribute.cpp)
# Link with OpenMesh if possible
find_package(OpenMesh QUIET)
if(TARGET OpenMesh::OpenMesh)
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

@ -21,13 +21,13 @@ create_single_source_cgal_program("extreme_indices_3.cpp")
find_package(OpenMesh 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

@ -0,0 +1,17 @@
if(OpenMesh_FOUND AND NOT TARGET CGAL::OpenMesh_support)
add_library(CGAL::OpenMesh_support INTERFACE IMPORTED)
if(TARGET OpenMeshCore)
target_link_libraries(CGAL::OpenMesh_support INTERFACE OpenMeshCore)
endif()
if(TARGET OpenMeshTools)
target_link_libraries(CGAL::OpenMesh_support INTERFACE OpenMeshTools)
endif()
target_compile_definitions(CGAL::OpenMesh_support
INTERFACE "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES")
endif()

View File

@ -1,79 +0,0 @@
#This modules tries to find OpenMesh
# Once done this will define
#
# OpenMesh_FOUND - system has OpenMesh
# OPENMESH_INCLUDE_DIR - OpenMesh include directory
# OPENMESH_LIBRARIES - OpenMesh libraries
#
find_package(OpenMesh NO_MODULE QUIET)
# Is it already configured?
if (NOT OpenMesh_FOUND)
find_path(OPENMESH_INCLUDE_DIR
NAMES OpenMesh/Core/Mesh/ArrayKernel.hh
HINTS ENV OPENMESH_INC_DIR
ENV OPENMESH_DIR
/usr/include
/usr/local/include
PATH_SUFFIXES src
DOC "The directory containing the OpenMesh header files WITHOUT the OpenMesh prefix"
)
find_library(OPENMESH_LIBRARY_RELEASE NAMES "OpenMeshCore"
HINTS ENV OPENMESH_LIB_DIR
ENV OPENMESH_DIR
PATH_SUFFIXES lib
DOC "Path to the OpenMeshCore library"
)
find_library(OPENMESH_LIBRARY_DEBUG NAMES "OpenMeshCored"
HINTS ENV OPENMESH_LIB_DIR
ENV OPENMESH_DIR
PATH_SUFFIXES lib
DOC "Path to the OpenMeshCored library"
)
if(OPENMESH_LIBRARY_RELEASE)
if(OPENMESH_LIBRARY_DEBUG)
set(OPENMESH_LIBRARIES optimized ${OPENMESH_LIBRARY_RELEASE} debug ${OPENMESH_LIBRARY_DEBUG})
else()
set(OPENMESH_LIBRARIES ${OPENMESH_LIBRARY_RELEASE})
endif()
endif()
endif()
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args(OpenMesh
REQUIRED_VARS OPENMESH_INCLUDE_DIR OPENMESH_LIBRARIES
FOUND_VAR OpenMesh_FOUND
)
if(OpenMesh_FOUND AND NOT TARGET OpenMesh::OpenMesh)
add_library(OpenMesh::OpenMesh UNKNOWN IMPORTED)
if(TARGET OpenMeshCore)
target_link_libraries(OpenMesh::OpenMesh INTERFACE OpenMeshCore)
return()
endif()
set_target_properties(OpenMesh::OpenMesh PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_OPENMESH;NOMINMAX;_USE_MATH_DEFINES"
INTERFACE_INCLUDE_DIRECTORIES "${OPENMESH_INCLUDE_DIR}")
if(OPENMESH_LIBRARY_RELEASE)
set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY
IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(OpenMesh::OpenMesh PROPERTIES
IMPORTED_LOCATION_RELEASE "${OPENMESH_LIBRARY_RELEASE}")
endif()
if(OPENMESH_LIBRARY_DEBUG)
set_property(TARGET OpenMesh::OpenMesh APPEND PROPERTY
IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(OpenMesh::OpenMesh PROPERTIES
IMPORTED_LOCATION_DEBUG "${OPENMESH_LIBRARY_DEBUG}")
endif()
endif()

View File

@ -1,5 +0,0 @@
# This module setups the compiler for using the OpenMesh library.
# It assumes that find_package(OpenMesh) was already called.
include_directories ( ${OPENMESH_INCLUDE_DIR} )
add_definitions( -DNOMINMAX -D_USE_MATH_DEFINES )

View File

@ -18,10 +18,8 @@ include_directories(BEFORE "/usr/include/libxml2/")
# add_definitions("-g")
# OpenMesh
set(OPENMESH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/openmesh")
find_package(OpenMesh REQUIRED)
include_directories(${OPENMESH_INCLUDE_DIR})
link_directories(${OPENMESH_LIBRARY_DIR})
include(CGAL_OpenMesh_support)
# Polyhedron
add_executable(polyhedron_performance performance_2.h polyhedron_performance.h
@ -42,7 +40,7 @@ target_link_libraries(surface_mesh_performance surface_mesh)
# Open_mesh
add_executable(openmesh_performance performance_2.h openmesh_performance.h
openmesh_performance.cpp)
target_link_libraries(openmesh_performance ${OPENMESH_LIBRARIES})
target_link_libraries(openmesh_performance CGAL::OpenMesh_support)
# CGoGN
find_package(Qt REQUIRED)
@ -91,4 +89,4 @@ target_link_libraries(
Zinri
z
${QT_LIBRARIES}
${OPENMESH_LIBRARIES})
CGAL::OpenMesh_support)

View File

@ -1,40 +0,0 @@
# Find OpenMesh. If found, this will define
#
# OPENMESH_FOUND - Successfully found OpenMesh
# OPENMESH_INCLUDE_DIR - OpenMesh include directory
# OPENMESH_LIBRARIES - OpenMesh libraries
# OPENMESH_LIBRARY_DIR - OpenMesh library directory
#
if(DEFINED OPENMESH_INCLUDE_DIR)
set(OPENMESH_FIND_QUIETLY TRUE)
else()
find_path(OPENMESH_INCLUDE_DIR OpenMesh/Core/Mesh/PolyMeshT.hh
PATHS
/usr/local/include
/usr/include
$ENV{OPENMESH_DIR}/include
${OPENMESH_DIR}/include
)
if(DEFINED OPENMESH_INCLUDE_DIR)
message(STATUS "Found OpenMesh: " ${OPENMESH_INCLUDE_DIR})
set(OPENMESH_FOUND true)
if(WIN32)
set(OPENMESH_LIBRARY_DIR "${OPENMESH_INCLUDE_DIR}/../lib"
CACHE PATH "OpenMesh library directory")
else()
set(OPENMESH_LIBRARY_DIR "${OPENMESH_INCLUDE_DIR}/../lib/OpenMesh"
CACHE PATH "OpenMesh library directory")
endif()
set(OPENMESH_LIBRARIES "OpenMeshCore;OpenMeshTools"
CACHE STRING "OpenMesh libraries")
else()
set(OPENMESH_FOUND FALSE)
endif()
endif()

View File

@ -95,30 +95,29 @@ endif()
find_package(OpenMesh 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

@ -114,9 +114,9 @@ endif()
find_package(OpenMesh 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

@ -13,10 +13,8 @@ create_single_source_cgal_program("test_Property_container.cpp")
find_package(OpenMesh 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

@ -64,10 +64,10 @@ endif()
find_package(OpenMesh 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

@ -33,12 +33,12 @@ if(TARGET CGAL::Eigen3_support)
find_package(OpenMesh 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

@ -18,12 +18,12 @@ if(TARGET CGAL::Eigen3_support)
find_package(OpenMesh 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

@ -17,11 +17,11 @@ create_single_source_cgal_program("extract_segmentation_into_mesh_example.cpp")
find_package(OpenMesh 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

@ -15,11 +15,11 @@ create_single_source_cgal_program("shortest_path_with_locate.cpp")
find_package(OpenMesh 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

@ -30,11 +30,11 @@ endif()
find_package(OpenMesh 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

@ -31,11 +31,11 @@ if(TARGET CGAL::Eigen3_support)
find_package(OpenMesh 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()