Skip to content

Commit

Permalink
Merge pull request #8108 from lrineau/CGAL-simplify_cmake-GF
Browse files Browse the repository at this point in the history
CMake: simplify, now that C++17 is required
  • Loading branch information
lrineau committed Apr 10, 2024
2 parents a71a735 + 04cf39b commit 8d5984b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 39 deletions.
4 changes: 1 addition & 3 deletions Point_set_3/examples/Point_set_3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
34 changes: 11 additions & 23 deletions Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
13 changes: 2 additions & 11 deletions Triangulation_3/test/Triangulation_3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 8d5984b

Please sign in to comment.