diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt index d11ac1444c9c..f461d55efb10 100644 --- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt +++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt @@ -9,9 +9,9 @@ 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) else() message("NOTICE: This project requires OpenMesh and will not be compiled.") endif() diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt index 7c901c71d8e9..eabe0b1bd405 100644 --- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt +++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt @@ -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() diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 074bce74ac25..2cf88ff3cbfd 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -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() diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index d0c26ec31c5e..8df873f5de3d 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -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() diff --git a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt index 4b6f08ba252d..add02f31d300 100644 --- a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt @@ -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() diff --git a/Installation/cmake/modules/CGAL_OpenMesh_support.cmake b/Installation/cmake/modules/CGAL_OpenMesh_support.cmake new file mode 100644 index 000000000000..97df95c8115b --- /dev/null +++ b/Installation/cmake/modules/CGAL_OpenMesh_support.cmake @@ -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() diff --git a/Installation/cmake/modules/FindOpenMesh.cmake b/Installation/cmake/modules/FindOpenMesh.cmake deleted file mode 100644 index 86b6eaebc9e1..000000000000 --- a/Installation/cmake/modules/FindOpenMesh.cmake +++ /dev/null @@ -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() diff --git a/Installation/cmake/modules/UseOpenMesh.cmake b/Installation/cmake/modules/UseOpenMesh.cmake deleted file mode 100644 index 23449d7cdf99..000000000000 --- a/Installation/cmake/modules/UseOpenMesh.cmake +++ /dev/null @@ -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 ) diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt index ce0dd87df2f3..986cd4f2fdb5 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt @@ -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) diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindOpenMesh.cmake b/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindOpenMesh.cmake deleted file mode 100644 index 98aefc13d236..000000000000 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/cmake/FindOpenMesh.cmake +++ /dev/null @@ -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() diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index 718ab1096a9d..69c6d25a52f1 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -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() diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index f814501997cf..0ac926c0f30e 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -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() diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt index 92a3eb097d5e..a51a39b66d00 100644 --- a/Property_map/test/Property_map/CMakeLists.txt +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -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() diff --git a/STL_Extension/test/STL_Extension/CMakeLists.txt b/STL_Extension/test/STL_Extension/CMakeLists.txt index ee9785300775..781a6285d451 100644 --- a/STL_Extension/test/STL_Extension/CMakeLists.txt +++ b/STL_Extension/test/STL_Extension/CMakeLists.txt @@ -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() diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt index ab336b9fb261..b6013ffce75d 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt @@ -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() diff --git a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt index 398dd703748b..e8819b7a22b3 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt @@ -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() diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt index 5ef633bb5397..e3f63874b1fd 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt @@ -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() diff --git a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt index 5238bd06c184..ba5a6455d263 100644 --- a/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt +++ b/Surface_mesh_shortest_path/examples/Surface_mesh_shortest_path/CMakeLists.txt @@ -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() diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt index 60135e84d4db..0f63efb7b068 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt @@ -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() diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt index 674ac89feff4..9b86386660b0 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt @@ -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()