From 04cf39bd8cbd8bea6c16965a2ce92791cf3912ce Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 28 Mar 2024 18:34:26 +0100 Subject: [PATCH] CMake: simplify, now that C++17 is required --- .../examples/Point_set_3/CMakeLists.txt | 4 +-- .../Polygon_mesh_processing/CMakeLists.txt | 4 +-- .../demo/Polyhedron/Plugins/IO/CMakeLists.txt | 34 ++++++------------- .../test/Triangulation_3/CMakeLists.txt | 13 ++----- 4 files changed, 16 insertions(+), 39 deletions(-) diff --git a/Point_set_3/examples/Point_set_3/CMakeLists.txt b/Point_set_3/examples/Point_set_3/CMakeLists.txt index 747ba9d79922..833fb5097194 100644 --- a/Point_set_3/examples/Point_set_3/CMakeLists.txt +++ b/Point_set_3/examples/Point_set_3/CMakeLists.txt @@ -11,9 +11,7 @@ create_single_source_cgal_program("point_set.cpp") create_single_source_cgal_program("point_set_property.cpp") create_single_source_cgal_program("point_set_read_xyz.cpp") create_single_source_cgal_program("point_set_advanced.cpp") - -set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates) -create_single_source_cgal_program("point_set_read_ply.cpp" CXX_FEATURES ${needed_cxx_features}) +create_single_source_cgal_program("point_set_read_ply.cpp") find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index 455e1ce2be7a..d66c727f73d9 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -14,8 +14,8 @@ create_single_source_cgal_program("polyhedral_envelope_of_triangle_soup.cpp" ) create_single_source_cgal_program("polyhedral_envelope_mesh_containment.cpp" ) create_single_source_cgal_program("self_intersections_example.cpp" ) create_single_source_cgal_program("stitch_borders_example.cpp" ) -create_single_source_cgal_program("compute_normals_example_Polyhedron.cpp" CXX_FEATURES cxx_range_for ) -create_single_source_cgal_program("compute_normals_example.cpp" CXX_FEATURES cxx_range_for cxx_auto_type ) +create_single_source_cgal_program("compute_normals_example_Polyhedron.cpp") +create_single_source_cgal_program("compute_normals_example.cpp") create_single_source_cgal_program("point_inside_example.cpp") create_single_source_cgal_program("triangulate_faces_example.cpp") create_single_source_cgal_program("triangulate_faces_split_visitor_example.cpp") diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt index ec7b583d8a28..d80560ab5d4a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt @@ -79,30 +79,18 @@ endif() polyhedron_demo_plugin(xyz_plugin XYZ_io_plugin KEYWORDS Viewer PointSetProcessing Classification) target_link_libraries(xyz_plugin PUBLIC scene_points_with_normal_item) -list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_rvalue_references has_cxx_rvalues) -list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_variadic_templates has_cxx_variadic) - -if(has_cxx_rvalues LESS 0 OR has_cxx_variadic LESS 0) - message(STATUS "NOTICE: LAS/PLY IO examples require a C++11 compiler and will not be compiled.") -else() - set(needed_cxx_features cxx_rvalue_references cxx_variadic_templates) - - polyhedron_demo_plugin(ply_plugin PLY_io_plugin KEYWORDS Viewer PointSetProcessing Classification PMP) - target_link_libraries(ply_plugin PUBLIC scene_points_with_normal_item scene_polygon_soup_item scene_surface_mesh_item scene_textured_item) - target_compile_features(ply_plugin PRIVATE ${needed_cxx_features}) - - if (TARGET CGAL::LASLIB_support) - polyhedron_demo_plugin(las_plugin LAS_io_plugin KEYWORDS Viewer PointSetProcessing Classification) - target_link_libraries(las_plugin PUBLIC scene_points_with_normal_item CGAL::LASLIB_support) - target_compile_features(las_plugin PRIVATE ${needed_cxx_features}) - if(MSVC) - target_compile_definitions( - las_plugin - PUBLIC "-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS") - endif() - else() - message(STATUS "NOTICE: the LAS IO plugin needs LAS libraries and will not be compiled.") +polyhedron_demo_plugin(ply_plugin PLY_io_plugin KEYWORDS Viewer PointSetProcessing Classification PMP) +target_link_libraries(ply_plugin PUBLIC scene_points_with_normal_item scene_polygon_soup_item scene_surface_mesh_item scene_textured_item) +if (TARGET CGAL::LASLIB_support) + polyhedron_demo_plugin(las_plugin LAS_io_plugin KEYWORDS Viewer PointSetProcessing Classification) + target_link_libraries(las_plugin PUBLIC scene_points_with_normal_item CGAL::LASLIB_support) + if(MSVC) + target_compile_definitions( + las_plugin + PUBLIC "-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS") endif() +else() + message(STATUS "NOTICE: the LAS IO plugin needs LAS libraries and will not be compiled.") endif() find_path( diff --git a/Triangulation_3/test/Triangulation_3/CMakeLists.txt b/Triangulation_3/test/Triangulation_3/CMakeLists.txt index 4998791123e5..85fff794a2f2 100644 --- a/Triangulation_3/test/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/test/Triangulation_3/CMakeLists.txt @@ -23,17 +23,8 @@ create_single_source_cgal_program("test_RT_cell_base_with_weighted_circumcenter_ create_single_source_cgal_program("test_robust_weighted_circumcenter.cpp") create_single_source_cgal_program("test_simplex_3.cpp") create_single_source_cgal_program("test_segment_simplex_traverser_3.cpp" ) -if(cxx_std_17 IN_LIST CMAKE_CXX_COMPILE_FEATURES) - create_single_source_cgal_program("test_simplex_iterator_3.cpp" ) - create_single_source_cgal_program("test_segment_cell_traverser_3.cpp" ) - target_compile_features(test_simplex_iterator_3 PRIVATE cxx_std_17) - target_compile_features(test_segment_simplex_traverser_3 PRIVATE cxx_std_17) -else() - message( - STATUS - "NOTICE: test_simplex_iterator_3.cpp and test_segment_simplex_traverser_3.cpp require C++17 and will not be compiled." - ) -endif() +create_single_source_cgal_program("test_simplex_iterator_3.cpp" ) +create_single_source_cgal_program("test_segment_cell_traverser_3.cpp" ) create_single_source_cgal_program("test_static_filters.cpp") create_single_source_cgal_program("test_triangulation_3.cpp") create_single_source_cgal_program("test_io_triangulation_3.cpp")