From 9c15f2c9dc9721c1c0ce17f356fa241837fdd87b Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 4 Aug 2020 12:46:17 +0200 Subject: [PATCH 1/8] Use FeatureSummary in the demo, and remove CGAL_FOUND --- AABB_tree/benchmark/AABB_tree/CMakeLists.txt | 9 +- AABB_tree/demo/AABB_tree/CMakeLists.txt | 63 +- AABB_tree/examples/AABB_tree/CMakeLists.txt | 28 +- AABB_tree/test/AABB_tree/CMakeLists.txt | 30 +- .../CMakeLists.txt | 28 +- .../CMakeLists.txt | 28 +- .../Algebraic_foundations/CMakeLists.txt | 28 +- .../test/Algebraic_foundations/CMakeLists.txt | 30 +- .../Algebraic_kernel_d/CMakeLists.txt | 33 +- .../test/Algebraic_kernel_d/CMakeLists.txt | 72 +- .../CMakeLists.txt | 30 +- .../CMakeLists.txt | 30 +- .../examples/Alpha_shapes_2/CMakeLists.txt | 28 +- .../test/Alpha_shapes_2/CMakeLists.txt | 28 +- .../demo/Alpha_shapes_3/CMakeLists.txt | 29 +- .../examples/Alpha_shapes_3/CMakeLists.txt | 28 +- .../test/Alpha_shapes_3/CMakeLists.txt | 30 +- .../Apollonius_graph_2/CMakeLists.txt | 30 +- .../test/Apollonius_graph_2/CMakeLists.txt | 30 +- .../test/Arithmetic_kernel/CMakeLists.txt | 57 +- .../Arrangement_on_surface_2/CMakeLists.txt | 52 +- .../tests/CMakeLists.txt | 7 +- .../Arrangement_on_surface_2/CMakeLists.txt | 30 +- .../Arrangement_on_surface_2/CMakeLists.txt | 39 +- BGL/examples/BGL_LCC/CMakeLists.txt | 25 +- BGL/examples/BGL_OpenMesh/CMakeLists.txt | 34 +- BGL/examples/BGL_arrangement_2/CMakeLists.txt | 27 +- BGL/examples/BGL_graphcut/CMakeLists.txt | 29 +- BGL/examples/BGL_polyhedron_3/CMakeLists.txt | 61 +- BGL/examples/BGL_surface_mesh/CMakeLists.txt | 35 +- .../BGL_triangulation_2/CMakeLists.txt | 27 +- BGL/test/BGL/CMakeLists.txt | 107 +- .../Barycentric_coordinates_2/CMakeLists.txt | 28 +- .../Barycentric_coordinates_2/CMakeLists.txt | 28 +- .../CMakeLists.txt | 33 +- .../Boolean_set_operations_2/CMakeLists.txt | 30 +- .../Boolean_set_operations_2/CMakeLists.txt | 28 +- .../CMakeLists.txt | 46 +- .../examples/Min_annulus_d/CMakeLists.txt | 27 +- .../examples/Min_circle_2/CMakeLists.txt | 27 +- .../examples/Min_ellipse_2/CMakeLists.txt | 27 +- .../Min_quadrilateral_2/CMakeLists.txt | 27 +- .../examples/Min_sphere_d/CMakeLists.txt | 27 +- .../Min_sphere_of_spheres_d/CMakeLists.txt | 27 +- .../Rectangular_p_center_2/CMakeLists.txt | 27 +- .../test/Bounding_volumes/CMakeLists.txt | 50 +- .../Box_intersection_d/CMakeLists.txt | 28 +- .../test/Box_intersection_d/CMakeLists.txt | 27 +- CGAL_Core/examples/Core/CMakeLists.txt | 23 +- CGAL_Core/src/CGAL_Core/CMakeLists.txt | 3 +- .../archive/demo/CGALimageIO/CMakeLists.txt | 32 +- .../examples/CGALimageIO/CMakeLists.txt | 16 +- CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt | 8 +- CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt | 25 +- CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt | 302 ++--- .../examples/CGAL_ipelets/CMakeLists.txt | 28 +- CMakeLists.txt | 41 +- .../examples/Circular_kernel_2/CMakeLists.txt | 28 +- .../test/Circular_kernel_2/CMakeLists.txt | 38 +- .../demo/Circular_kernel_3/CMakeLists.txt | 21 +- .../examples/Circular_kernel_3/CMakeLists.txt | 28 +- .../test/Circular_kernel_3/CMakeLists.txt | 32 +- Circulator/examples/Circulator/CMakeLists.txt | 28 +- Circulator/test/Circulator/CMakeLists.txt | 28 +- .../examples/Classification/CMakeLists.txt | 110 +- .../test/Classification/CMakeLists.txt | 51 +- .../examples/Combinatorial_map/CMakeLists.txt | 27 +- .../test/Combinatorial_map/CMakeLists.txt | 34 +- .../examples/Cone_spanners_2/CMakeLists.txt | 22 +- .../test/Cone_spanners_2/CMakeLists.txt | 23 +- .../Convex_decomposition_3/CMakeLists.txt | 28 +- .../Convex_decomposition_3/CMakeLists.txt | 28 +- .../examples/Convex_hull_2/CMakeLists.txt | 30 +- .../test/Convex_hull_2/CMakeLists.txt | 30 +- .../demo/Convex_hull_3/CMakeLists.txt | 16 +- .../examples/Convex_hull_3/CMakeLists.txt | 56 +- .../test/Convex_hull_3/CMakeLists.txt | 40 +- .../test/Convex_hull_d/CMakeLists.txt | 30 +- Distance_2/test/Distance_2/CMakeLists.txt | 28 +- Distance_3/test/Distance_3/CMakeLists.txt | 38 +- Documentation/doc/CMakeLists.txt | 246 ++-- Envelope_2/examples/Envelope_2/CMakeLists.txt | 28 +- Envelope_2/test/Envelope_2/CMakeLists.txt | 28 +- Envelope_3/examples/Envelope_3/CMakeLists.txt | 30 +- Envelope_3/test/Envelope_3/CMakeLists.txt | 30 +- .../benchmark/Filtered_kernel/CMakeLists.txt | 41 +- .../examples/Filtered_kernel/CMakeLists.txt | 28 +- .../test/Filtered_kernel/CMakeLists.txt | 28 +- .../examples/Generalized_map/CMakeLists.txt | 27 +- .../test/Generalized_map/CMakeLists.txt | 24 +- Generator/benchmark/Generator/CMakeLists.txt | 30 +- Generator/examples/Generator/CMakeLists.txt | 47 +- Generator/test/Generator/CMakeLists.txt | 44 +- Geomview/demo/Geomview/CMakeLists.txt | 20 +- Geomview/test/Geomview/CMakeLists.txt | 28 +- .../demo/Alpha_shapes_2/CMakeLists.txt | 51 +- .../demo/Apollonius_graph_2/CMakeLists.txt | 48 +- .../demo/Bounding_volumes/CMakeLists.txt | 54 +- .../demo/Circular_kernel_2/CMakeLists.txt | 25 +- GraphicsView/demo/Generator/CMakeLists.txt | 22 +- GraphicsView/demo/GraphicsView/CMakeLists.txt | 16 +- .../demo/L1_Voronoi_diagram_2/CMakeLists.txt | 52 +- .../demo/Largest_empty_rect_2/CMakeLists.txt | 24 +- .../Periodic_2_triangulation_2/CMakeLists.txt | 71 +- GraphicsView/demo/Polygon/CMakeLists.txt | 37 +- .../Segment_Delaunay_graph_2/CMakeLists.txt | 57 +- .../CMakeLists.txt | 57 +- .../demo/Snap_rounding_2/CMakeLists.txt | 46 +- .../demo/Spatial_searching_2/CMakeLists.txt | 26 +- .../demo/Stream_lines_2/CMakeLists.txt | 46 +- .../demo/Triangulation_2/CMakeLists.txt | 64 +- GraphicsView/src/CGAL_Qt5/CMakeLists.txt | 39 +- HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt | 28 +- HalfedgeDS/test/HalfedgeDS/CMakeLists.txt | 28 +- Hash_map/benchmark/Hash_map/CMakeLists.txt | 32 +- Hash_map/test/Hash_map/CMakeLists.txt | 30 +- .../examples/Heat_method_3/CMakeLists.txt | 49 +- .../test/Heat_method_3/CMakeLists.txt | 45 +- .../Hyperbolic_triangulation_2/CMakeLists.txt | 21 +- .../Hyperbolic_triangulation_2/CMakeLists.txt | 25 +- .../Hyperbolic_triangulation_2/CMakeLists.txt | 23 +- .../Hyperbolic_triangulation_2/CMakeLists.txt | 33 +- .../examples/Inscribed_areas/CMakeLists.txt | 28 +- .../test/Inscribed_areas/CMakeLists.txt | 28 +- Installation/CMakeLists.txt | 1084 ++++++++++------- Installation/demo/CMakeLists.txt | 25 +- Installation/examples/CMakeLists.txt | 25 +- Installation/src/CGAL/CMakeLists.txt | 7 +- Installation/src/CMakeLists.txt | 230 ++-- Installation/test/CMakeLists.txt | 25 +- Installation/test/Installation/CMakeLists.txt | 184 +-- .../demo/Interpolation/CMakeLists.txt | 18 +- .../examples/Interpolation/CMakeLists.txt | 28 +- .../test/Interpolation/CMakeLists.txt | 30 +- .../test/Intersections_2/CMakeLists.txt | 28 +- .../test/Intersections_3/CMakeLists.txt | 27 +- .../Interval_skip_list/CMakeLists.txt | 28 +- .../test/Interval_skip_list/CMakeLists.txt | 28 +- .../test/Interval_support/CMakeLists.txt | 30 +- Inventor/test/Inventor/CMakeLists.txt | 28 +- .../examples/Jet_fitting_3/CMakeLists.txt | 65 +- .../test/Jet_fitting_3/CMakeLists.txt | 32 +- Kernel_23/examples/Kernel_23/CMakeLists.txt | 28 +- Kernel_23/test/Kernel_23/CMakeLists.txt | 32 +- Kernel_d/test/Kernel_d/CMakeLists.txt | 30 +- .../Linear_cell_complex_2/CMakeLists.txt | 65 +- .../Linear_cell_complex_3/CMakeLists.txt | 61 +- .../demo/Linear_cell_complex/CMakeLists.txt | 52 +- .../Linear_cell_complex/CMakeLists.txt | 41 +- .../test/Linear_cell_complex/CMakeLists.txt | 35 +- .../examples/Matrix_search/CMakeLists.txt | 28 +- .../test/Matrix_search/CMakeLists.txt | 28 +- Mesh_2/demo/Mesh_2/CMakeLists.txt | 36 +- Mesh_2/examples/Mesh_2/CMakeLists.txt | 26 +- Mesh_2/test/Mesh_2/CMakeLists.txt | 30 +- Mesh_3/archive/applications/CMakeLists.txt | 54 +- Mesh_3/benchmark/Mesh_3/CMakeLists.txt | 120 +- Mesh_3/examples/Mesh_3/CMakeLists.txt | 167 +-- Mesh_3/test/Mesh_3/CMakeLists.txt | 213 ++-- .../examples/Minkowski_sum_2/CMakeLists.txt | 30 +- .../test/Minkowski_sum_2/CMakeLists.txt | 29 +- .../examples/Minkowski_sum_3/CMakeLists.txt | 28 +- .../test/Minkowski_sum_3/CMakeLists.txt | 28 +- Modifier/test/Modifier/CMakeLists.txt | 28 +- .../Modular_arithmetic/CMakeLists.txt | 28 +- .../test/Modular_arithmetic/CMakeLists.txt | 30 +- Nef_2/examples/Nef_2/CMakeLists.txt | 28 +- Nef_2/test/Nef_2/CMakeLists.txt | 30 +- Nef_3/examples/Nef_3/CMakeLists.txt | 34 +- Nef_3/test/Nef_3/CMakeLists.txt | 55 +- Nef_S2/examples/Nef_S2/CMakeLists.txt | 30 +- Nef_S2/test/Nef_S2/CMakeLists.txt | 30 +- NewKernel_d/test/NewKernel_d/CMakeLists.txt | 34 +- Number_types/test/Number_types/CMakeLists.txt | 161 ++- .../Optimal_bounding_box/CMakeLists.txt | 16 +- .../Optimal_bounding_box/CMakeLists.txt | 22 +- .../test/Optimal_bounding_box/CMakeLists.txt | 21 +- .../CMakeLists.txt | 106 +- .../CMakeLists.txt | 23 +- .../CMakeLists.txt | 29 +- .../examples/Partition_2/CMakeLists.txt | 28 +- Partition_2/test/Partition_2/CMakeLists.txt | 28 +- .../Periodic_2_triangulation_2/CMakeLists.txt | 31 +- .../Periodic_2_triangulation_2/CMakeLists.txt | 30 +- .../examples/Periodic_3_mesh_3/CMakeLists.txt | 46 +- .../test/Periodic_3_mesh_3/CMakeLists.txt | 43 +- .../Periodic_3_triangulation_3/CMakeLists.txt | 82 +- .../demo/Periodic_Lloyd_3/CMakeLists.txt | 65 +- .../Periodic_3_triangulation_3/CMakeLists.txt | 28 +- .../Periodic_3_triangulation_3/CMakeLists.txt | 54 +- .../CMakeLists.txt | 25 +- .../CMakeLists.txt | 31 +- .../CMakeLists.txt | 17 +- .../CMakeLists.txt | 33 +- .../examples/Point_set_2/CMakeLists.txt | 28 +- Point_set_2/test/Point_set_2/CMakeLists.txt | 28 +- .../examples/Point_set_3/CMakeLists.txt | 40 +- Point_set_3/test/Point_set_3/CMakeLists.txt | 26 +- .../Point_set_processing_3/CMakeLists.txt | 232 ++-- .../Point_set_processing_3/CMakeLists.txt | 159 +-- .../CMakeLists.txt | 81 +- .../CMakeLists.txt | 63 +- Polygon/examples/Polygon/CMakeLists.txt | 36 +- Polygon/test/Polygon/CMakeLists.txt | 28 +- .../Polygon_mesh_processing/CMakeLists.txt | 24 +- .../Polygon_mesh_processing/CMakeLists.txt | 150 +-- .../Polygon_mesh_processing/CMakeLists.txt | 165 +-- .../CMakeLists.txt | 61 +- .../CMakeLists.txt | 56 +- Polyhedron/demo/Polyhedron/CMakeLists.txt | 497 +++++--- .../Plugins/AABB_tree/CMakeLists.txt | 10 +- .../Plugins/Camera_position/CMakeLists.txt | 13 +- .../Plugins/Classification/CMakeLists.txt | 91 +- .../Convex_decomposition/CMakeLists.txt | 4 +- .../Plugins/Convex_hull/CMakeLists.txt | 9 +- .../Polyhedron/Plugins/Display/CMakeLists.txt | 12 +- .../demo/Polyhedron/Plugins/IO/CMakeLists.txt | 128 +- .../Polyhedron/Plugins/Mesh_2/CMakeLists.txt | 11 +- .../Polyhedron/Plugins/Mesh_3/CMakeLists.txt | 118 +- .../Operations_on_polyhedra/CMakeLists.txt | 37 +- .../Polyhedron/Plugins/PCA/CMakeLists.txt | 38 +- .../Polyhedron/Plugins/PMP/CMakeLists.txt | 212 ++-- .../Plugins/Point_set/CMakeLists.txt | 292 +++-- .../Subdivision_methods/CMakeLists.txt | 3 +- .../Plugins/Surface_mesh/CMakeLists.txt | 69 +- .../Surface_mesh_deformation/CMakeLists.txt | 12 +- .../Tetrahedral_remeshing/CMakeLists.txt | 19 +- .../Plugins/Three_examples/CMakeLists.txt | 20 +- .../implicit_functions/CMakeLists.txt | 35 +- Polyhedron/examples/Polyhedron/CMakeLists.txt | 32 +- Polyhedron/test/Polyhedron/CMakeLists.txt | 28 +- .../demo/Polyhedron_IO/CMakeLists.txt | 18 +- .../examples/Polyhedron_IO/CMakeLists.txt | 28 +- .../test/Polyhedron_IO/CMakeLists.txt | 28 +- .../Polyline_simplification_2/CMakeLists.txt | 40 +- .../Polyline_simplification_2/CMakeLists.txt | 28 +- .../Polyline_simplification_2/CMakeLists.txt | 28 +- Polynomial/examples/Polynomial/CMakeLists.txt | 28 +- Polynomial/test/Polynomial/CMakeLists.txt | 32 +- .../Polytope_distance_d/CMakeLists.txt | 28 +- .../test/Polytope_distance_d/CMakeLists.txt | 28 +- .../CMakeLists.txt | 54 +- .../CMakeLists.txt | 41 +- .../CMakeLists.txt | 41 +- .../examples/Profiling_tools/CMakeLists.txt | 28 +- .../test/Profiling_tools/CMakeLists.txt | 28 +- .../examples/Property_map/CMakeLists.txt | 27 +- Property_map/test/Property_map/CMakeLists.txt | 40 +- QP_solver/examples/QP_solver/CMakeLists.txt | 28 +- QP_solver/test/QP_solver/CMakeLists.txt | 28 +- .../test/Random_numbers/CMakeLists.txt | 28 +- Ridges_3/examples/Ridges_3/CMakeLists.txt | 68 +- Ridges_3/test/Ridges_3/CMakeLists.txt | 32 +- .../CMakeLists.txt | 19 +- .../benchmark/copy_n_benchmark/CMakeLists.txt | 22 +- .../examples/STL_Extension/CMakeLists.txt | 28 +- .../test/STL_Extension/CMakeLists.txt | 83 +- .../CMakeLists.txt | 69 +- .../examples/RangeSegmentTrees/CMakeLists.txt | 27 +- .../test/RangeSegmentTrees/CMakeLists.txt | 17 +- .../Segment_Delaunay_graph_2/CMakeLists.txt | 26 +- .../Segment_Delaunay_graph_2/CMakeLists.txt | 28 +- .../Segment_Delaunay_graph_2/CMakeLists.txt | 32 +- .../CMakeLists.txt | 23 +- .../CMakeLists.txt | 34 +- .../CMakeLists.txt | 32 +- .../Set_movable_separability_2/CMakeLists.txt | 25 +- .../Set_movable_separability_2/CMakeLists.txt | 26 +- .../benchmark/Shape_detection/CMakeLists.txt | 34 +- .../examples/Shape_detection/CMakeLists.txt | 83 +- .../test/Shape_detection/CMakeLists.txt | 130 +- .../examples/Skin_surface_3/CMakeLists.txt | 55 +- .../test/Skin_surface_3/CMakeLists.txt | 28 +- .../examples/Snap_rounding_2/CMakeLists.txt | 28 +- .../test/Snap_rounding_2/CMakeLists.txt | 67 +- .../examples/Solver_interface/CMakeLists.txt | 79 +- .../Spatial_searching/CMakeLists.txt | 80 +- .../Spatial_searching/tools/CMakeLists.txt | 21 +- .../examples/Spatial_searching/CMakeLists.txt | 68 +- .../test/Spatial_searching/CMakeLists.txt | 28 +- .../benchmark/Spatial_sorting/CMakeLists.txt | 20 +- .../examples/Spatial_sorting/CMakeLists.txt | 34 +- .../test/Spatial_sorting/CMakeLists.txt | 25 +- .../Straight_skeleton_2/CMakeLists.txt | 30 +- .../test/Straight_skeleton_2/CMakeLists.txt | 32 +- .../examples/Stream_lines_2/CMakeLists.txt | 28 +- .../test/Stream_lines_2/CMakeLists.txt | 28 +- .../benchmark/Stream_support/CMakeLists.txt | 27 +- .../examples/Stream_support/CMakeLists.txt | 35 +- .../test/Stream_support/CMakeLists.txt | 62 +- .../Subdivision_method_3/CMakeLists.txt | 28 +- .../test/Subdivision_method_3/CMakeLists.txt | 28 +- Surface_mesh/benchmark/CMakeLists.txt | 25 +- .../examples/Surface_mesh/CMakeLists.txt | 50 +- Surface_mesh/test/Surface_mesh/CMakeLists.txt | 28 +- .../Surface_mesh_approximation/CMakeLists.txt | 34 +- .../Surface_mesh_approximation/CMakeLists.txt | 44 +- .../Surface_mesh_approximation/CMakeLists.txt | 49 +- .../optimal_rotation/CMakeLists.txt | 28 +- .../Surface_mesh_deformation/CMakeLists.txt | 28 +- .../Surface_mesh_deformation/CMakeLists.txt | 84 +- .../Surface_mesh_deformation/CMakeLists.txt | 50 +- .../CMakeLists.txt | 123 +- .../CMakeLists.txt | 32 +- .../Surface_mesh_segmentation/CMakeLists.txt | 52 +- .../Surface_mesh_segmentation/CMakeLists.txt | 28 +- .../Surface_mesh_shortest_path/CMakeLists.txt | 40 +- .../Surface_mesh_shortest_path/CMakeLists.txt | 40 +- .../CMakeLists.txt | 63 +- .../CMakeLists.txt | 17 +- .../CMakeLists.txt | 25 +- .../CMakeLists.txt | 61 +- .../CMakeLists.txt | 33 +- .../Surface_mesh_topology/CMakeLists.txt | 12 +- .../Surface_mesh_topology/CMakeLists.txt | 40 +- .../test/Surface_mesh_topology/CMakeLists.txt | 35 +- .../demo/Surface_mesher/CMakeLists.txt | 84 +- .../examples/Surface_mesher/CMakeLists.txt | 18 +- .../test/Surface_mesher/CMakeLists.txt | 28 +- .../examples/Surface_sweep_2/CMakeLists.txt | 20 +- .../test/Surface_sweep_2/CMakeLists.txt | 78 +- TDS_2/test/TDS_2/CMakeLists.txt | 30 +- TDS_3/examples/TDS_3/CMakeLists.txt | 28 +- TDS_3/test/TDS_3/CMakeLists.txt | 24 +- .../Tetrahedral_remeshing/CMakeLists.txt | 27 +- .../test/Tetrahedral_remeshing/CMakeLists.txt | 43 +- .../applications/Triangulation/CMakeLists.txt | 24 +- .../benchmark/Triangulation/CMakeLists.txt | 36 +- .../examples/Triangulation/CMakeLists.txt | 66 +- .../test/Triangulation/CMakeLists.txt | 54 +- .../examples/Triangulation_2/CMakeLists.txt | 37 +- .../test/Triangulation_2/CMakeLists.txt | 56 +- .../benchmark/Triangulation_3/CMakeLists.txt | 46 +- .../demo/Triangulation_3/CMakeLists.txt | 71 +- .../CMakeLists.txt | 22 +- .../examples/Triangulation_3/CMakeLists.txt | 73 +- .../test/Triangulation_3/CMakeLists.txt | 82 +- Union_find/test/Union_find/CMakeLists.txt | 30 +- .../examples/Visibility_2/CMakeLists.txt | 28 +- Visibility_2/test/Visibility_2/CMakeLists.txt | 30 +- .../examples/Voronoi_diagram_2/CMakeLists.txt | 33 +- .../test/Voronoi_diagram_2/CMakeLists.txt | 30 +- 342 files changed, 7733 insertions(+), 8565 deletions(-) diff --git a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt index 1a0f49a76f4..a96858dda08 100644 --- a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt +++ b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt @@ -2,10 +2,9 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.14) -project( AABB_traits_benchmark ) +project(AABB_traits_benchmark) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) - -create_single_source_cgal_program( "test.cpp" ) -create_single_source_cgal_program( "tree_construction.cpp" ) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) +create_single_source_cgal_program("test.cpp") +create_single_source_cgal_program("tree_construction.cpp") diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index 0200865f89e..7c006dec292 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -1,7 +1,7 @@ # This is the CMake script for compiling the AABB tree demo. cmake_minimum_required(VERSION 3.1...3.15) -project( AABB_tree_Demo ) +project(AABB_tree_Demo) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -17,58 +17,56 @@ if(POLICY CMP0071) endif() # Include this package's headers first -include_directories( BEFORE ./ ./include ) +include_directories(BEFORE ./ ./include) # Find CGAL and CGAL Qt5 -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg) -if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) - qt5_wrap_ui( UI_FILES MainWindow.ui ) + qt5_wrap_ui(UI_FILES MainWindow.ui) include(AddFileDependencies) - qt5_generate_moc( "MainWindow.h" "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" ) - add_file_dependencies( MainWindow_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.h" ) + qt5_generate_moc("MainWindow.h" + "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp") + add_file_dependencies(MainWindow_moc.cpp + "${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.h") - qt5_generate_moc( "Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" ) - add_file_dependencies( Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h" ) + qt5_generate_moc("Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp") + add_file_dependencies(Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h") - qt5_generate_moc( "Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" ) - add_file_dependencies( Scene_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Scene.h" ) + qt5_generate_moc("Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp") + add_file_dependencies(Scene_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Scene.h") - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES AABB_demo.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES AABB_demo.qrc) - add_file_dependencies( AABB_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" - "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" - "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" ) + add_file_dependencies( + AABB_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp") - add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} + add_executable( + AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} #${CGAL_Qt5_MOC_FILES} - ) + ) # Link with Qt libraries - target_link_libraries( AABB_demo PRIVATE - Qt5::OpenGL Qt5::Gui Qt5::Xml - CGAL::CGAL - CGAL::CGAL_Qt5 - ) + target_link_libraries(AABB_demo PRIVATE Qt5::OpenGL Qt5::Gui Qt5::Xml + CGAL::CGAL CGAL::CGAL_Qt5) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS AABB_demo) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(AABB_demo) -else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) +else(CGAL_Qt5_FOUND + AND Qt5_FOUND) set(AABB_MISSING_DEPS "") - if(NOT CGAL_FOUND) - set(AABB_MISSING_DEPS "the CGAL library, ${AABB_MISSING_DEPS}") - endif() - if(NOT CGAL_Qt5_FOUND) set(AABB_MISSING_DEPS "CGAL_Qt5, ${AABB_MISSING_DEPS}") endif() @@ -77,6 +75,11 @@ else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}") endif() - message(STATUS "NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires ${AABB_MISSING_DEPS}and will not be compiled." + ) -endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +endif( + CGAL_Qt5_FOUND + AND Qt5_FOUND) diff --git a/AABB_tree/examples/AABB_tree/CMakeLists.txt b/AABB_tree/examples/AABB_tree/CMakeLists.txt index b66f7ec5f15..9f11b3ae5c0 100644 --- a/AABB_tree/examples/AABB_tree/CMakeLists.txt +++ b/AABB_tree/examples/AABB_tree/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( AABB_tree_Examples ) +project(AABB_tree_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/AABB_tree/test/AABB_tree/CMakeLists.txt b/AABB_tree/test/AABB_tree/CMakeLists.txt index 997be1089d0..47c63198ba2 100644 --- a/AABB_tree/test/AABB_tree/CMakeLists.txt +++ b/AABB_tree/test/AABB_tree/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( AABB_tree_Tests ) +project(AABB_tree_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include( ${CGAL_USE_FILE} ) # Kept to test the old behaviour. - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) # Kept to test the old behaviour. +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt index e62cfe0689a..d494c037fae 100644 --- a/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt +++ b/Advancing_front_surface_reconstruction/examples/Advancing_front_surface_reconstruction/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Advancing_front_surface_reconstruction_Examples ) +project(Advancing_front_surface_reconstruction_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt index 07b424ed360..c16decef5c2 100644 --- a/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt +++ b/Advancing_front_surface_reconstruction/test/Advancing_front_surface_reconstruction/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Advancing_front_surface_reconstruction_Tests ) +project(Advancing_front_surface_reconstruction_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt b/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt index c616d6befdc..b86aa4c60bc 100644 --- a/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt +++ b/Algebraic_foundations/examples/Algebraic_foundations/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Algebraic_foundations_Examples ) +project(Algebraic_foundations_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt b/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt index 682fa668f93..a2286014e09 100644 --- a/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt +++ b/Algebraic_foundations/test/Algebraic_foundations/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Algebraic_foundations_Tests ) +project(Algebraic_foundations_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt index 02f1ac1c563..63cf6965333 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt @@ -1,28 +1,27 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Algebraic_kernel_d_Examples ) +project(Algebraic_kernel_d_Examples) +find_package(CGAL REQUIRED COMPONENTS Core) +find_package(MPFI QUIET) -find_package(CGAL QUIET COMPONENTS Core) +if(MPFI_FOUND) -if ( CGAL_FOUND ) - find_package(MPFI QUIET) -endif() + include(${CGAL_USE_FILE}) + include(${MPFI_USE_FILE}) + include(CGAL_VersionUtils) -if( CGAL_FOUND AND MPFI_FOUND) - - include( ${CGAL_USE_FILE} ) - include( ${MPFI_USE_FILE} ) - include( CGAL_VersionUtils ) - - create_single_source_cgal_program( "Compare_1.cpp" ) - create_single_source_cgal_program( "Construct_algebraic_real_1.cpp" ) - create_single_source_cgal_program( "Isolate_1.cpp" ) - create_single_source_cgal_program( "Sign_at_1.cpp" ) - create_single_source_cgal_program( "Solve_1.cpp" ) + create_single_source_cgal_program("Compare_1.cpp") + create_single_source_cgal_program("Construct_algebraic_real_1.cpp") + create_single_source_cgal_program("Isolate_1.cpp") + create_single_source_cgal_program("Sign_at_1.cpp") + create_single_source_cgal_program("Solve_1.cpp") else() - message(STATUS "This program requires the CGAL library and MPFI, and will not be compiled.") + message( + STATUS + "This program requires the CGAL library and MPFI, and will not be compiled." + ) endif() diff --git a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt index 73b7294442b..b48f6a7e334 100644 --- a/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/test/Algebraic_kernel_d/CMakeLists.txt @@ -1,67 +1,65 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Algebraic_kernel_d_Tests ) - - +project(Algebraic_kernel_d_Tests) # CGAL and its components -find_package( CGAL QUIET COMPONENTS Core) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED COMPONENTS Core) find_package(RS3 QUIET) if(MPFI_FOUND) - include( ${MPFI_USE_FILE} ) + include(${MPFI_USE_FILE}) endif() if(RS3_FOUND) - include( ${RS3_USE_FILE} ) + include(${RS3_USE_FILE}) endif() # Boost and its components -find_package( Boost ) +find_package(Boost) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() # include for local directory -include_directories( BEFORE include ) +include_directories(BEFORE include) -include( ${CGAL_USE_FILE} ) +include(${CGAL_USE_FILE}) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "cyclic.cpp" ) -create_single_source_cgal_program( "Algebraic_curve_kernel_2.cpp" ) -create_single_source_cgal_program( "algebraic_curve_kernel_2_tools.cpp" ) -create_single_source_cgal_program( "Algebraic_kernel_d_1_LEDA.cpp" ) +create_single_source_cgal_program("cyclic.cpp") +create_single_source_cgal_program("Algebraic_curve_kernel_2.cpp") +create_single_source_cgal_program("algebraic_curve_kernel_2_tools.cpp") +create_single_source_cgal_program("Algebraic_kernel_d_1_LEDA.cpp") -create_single_source_cgal_program( "Algebraic_kernel_d_1_CORE_Integer_rational.cpp" ) -create_single_source_cgal_program( "Algebraic_kernel_d_1_CORE_SqrtII_rational.cpp" ) -create_single_source_cgal_program( "Algebraic_kernel_d_1_CORE_SqrtRI_rational.cpp" ) -create_single_source_cgal_program( "Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp" ) +create_single_source_cgal_program( + "Algebraic_kernel_d_1_CORE_Integer_rational.cpp") +create_single_source_cgal_program( + "Algebraic_kernel_d_1_CORE_SqrtII_rational.cpp") +create_single_source_cgal_program( + "Algebraic_kernel_d_1_CORE_SqrtRI_rational.cpp") +create_single_source_cgal_program( + "Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp") -create_single_source_cgal_program( "Algebraic_kernel_d_1_GMP.cpp" ) -create_single_source_cgal_program( "Algebraic_kernel_d_2.cpp" ) -create_single_source_cgal_program( "Algebraic_real_d_1.cpp" ) -create_single_source_cgal_program( "Bitstream_descartes.cpp" ) -create_single_source_cgal_program( "Curve_analysis_2.cpp" ) -create_single_source_cgal_program( "Curve_pair_analysis_2.cpp" ) -create_single_source_cgal_program( "Descartes.cpp" ) -create_single_source_cgal_program( "Real_embeddable_traits_extension.cpp" ) +create_single_source_cgal_program("Algebraic_kernel_d_1_GMP.cpp") +create_single_source_cgal_program("Algebraic_kernel_d_2.cpp") +create_single_source_cgal_program("Algebraic_real_d_1.cpp") +create_single_source_cgal_program("Bitstream_descartes.cpp") +create_single_source_cgal_program("Curve_analysis_2.cpp") +create_single_source_cgal_program("Curve_pair_analysis_2.cpp") +create_single_source_cgal_program("Descartes.cpp") +create_single_source_cgal_program("Real_embeddable_traits_extension.cpp") if(RS_FOUND) - create_single_source_cgal_program( "Algebraic_kernel_rs_gmpq_d_1.cpp" ) - create_single_source_cgal_program( "Algebraic_kernel_rs_gmpz_d_1.cpp" ) + create_single_source_cgal_program("Algebraic_kernel_rs_gmpq_d_1.cpp") + create_single_source_cgal_program("Algebraic_kernel_rs_gmpz_d_1.cpp") else() - message(STATUS "NOTICE: Some tests require the RS library, and will not be compiled.") + message( + STATUS + "NOTICE: Some tests require the RS library, and will not be compiled.") endif() diff --git a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt index c02ce4ff14d..006778479a8 100644 --- a/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt +++ b/Algebraic_kernel_for_circles/test/Algebraic_kernel_for_circles/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Algebraic_kernel_for_circles_Tests ) +project(Algebraic_kernel_for_circles_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt index 284554d7787..48dbc34d1d6 100644 --- a/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt +++ b/Algebraic_kernel_for_spheres/test/Algebraic_kernel_for_spheres/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Algebraic_kernel_for_spheres_Tests ) +project(Algebraic_kernel_for_spheres_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt b/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt index 318bbe1dcc3..aa0182a2fc3 100644 --- a/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt +++ b/Alpha_shapes_2/examples/Alpha_shapes_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Alpha_shapes_2_Examples ) +project(Alpha_shapes_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt b/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt index 5b6cea7e446..a14ae249da7 100644 --- a/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt +++ b/Alpha_shapes_2/test/Alpha_shapes_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Alpha_shapes_2_Tests ) +project(Alpha_shapes_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt index 15a15504881..ede9b5e1367 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Alpha_shapes_3_Demo) +project(Alpha_shapes_3_Demo) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -16,35 +16,38 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) - # include(${QT_USE_FILE}) - include_directories (BEFORE ./ ) + # include(${QT_USE_FILE}) + include_directories(BEFORE ./) # ui file, created wih Qt Designer - qt5_wrap_ui( uis MainWindow.ui ) + qt5_wrap_ui(uis MainWindow.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Alpha_shape_3.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Alpha_shape_3.qrc) - add_executable ( Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Alpha_shape_3 ) + add_executable( + Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Alpha_shape_3) - target_link_libraries( Alpha_shape_3 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 - Qt5::OpenGL Qt5::Gui ) + target_link_libraries(Alpha_shape_3 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::OpenGL Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Alpha_shape_3) else() - message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." + ) endif() diff --git a/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt index bd91f6c8705..b059a33c683 100644 --- a/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/examples/Alpha_shapes_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Alpha_shapes_3_Examples ) +project(Alpha_shapes_3_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt index 98bae1eaab9..31551f22a36 100644 --- a/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/test/Alpha_shapes_3/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Alpha_shapes_3_Tests ) +project(Alpha_shapes_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt b/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt index 86194af24b3..9486b94e36d 100644 --- a/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt +++ b/Apollonius_graph_2/examples/Apollonius_graph_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Apollonius_graph_2_Examples ) +project(Apollonius_graph_2_Examples) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt b/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt index 8a0318d270d..f67cd40b98a 100644 --- a/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt +++ b/Apollonius_graph_2/test/Apollonius_graph_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Apollonius_graph_2_Tests ) +project(Apollonius_graph_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt index 82660d4b397..1568cf2d61c 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt +++ b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt @@ -1,56 +1,53 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Arithmetic_kernel_Tests ) +project(Arithmetic_kernel_Tests) - - - -find_package(CGAL QUIET COMPONENTS Core) +find_package(CGAL REQUIRED COMPONENTS Core) find_package(GMP QUIET) -if ( CGAL_FOUND AND GMP_FOUND ) +if(GMP_FOUND) include(${CGAL_USE_FILE}) - include( CGAL_VersionUtils ) + include(CGAL_VersionUtils) - get_dependency_version( GMP ) + get_dependency_version(GMP) - IS_VERSION_LESS("${GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) + is_version_less("${GMP_VERSION}" "4.2.0" _IS_GMP_VERSION_TO_LOW) include_directories(include) - find_package( MPFI ) + find_package(MPFI) - if( MPFI_FOUND ) - include( ${MPFI_USE_FILE} ) + if(MPFI_FOUND) + include(${MPFI_USE_FILE}) # for the testsuite, the version of MPFI shipped with RS is used; this # version needs GMP>=4.2, so we require this dependency only here and # not in FindMPFI.cmake - if( _IS_GMP_VERSION_TO_LOW ) - message( STATUS - "MPFI tests need GMP>=4.2, some of the tests will not be compiled" ) - else( _IS_GMP_VERSION_TO_LOW ) - include( ${MPFI_USE_FILE} ) - create_single_source_cgal_program( "GMP_arithmetic_kernel.cpp" ) - endif( _IS_GMP_VERSION_TO_LOW ) - else( MPFI_FOUND ) - message( STATUS - "MPFI is not present, some of the tests will not be compiled." ) - endif( MPFI_FOUND ) + if(_IS_GMP_VERSION_TO_LOW) + message( + STATUS + "MPFI tests need GMP>=4.2, some of the tests will not be compiled") + else(_IS_GMP_VERSION_TO_LOW) + include(${MPFI_USE_FILE}) + create_single_source_cgal_program("GMP_arithmetic_kernel.cpp") + endif(_IS_GMP_VERSION_TO_LOW) + else(MPFI_FOUND) + message( + STATUS "MPFI is not present, some of the tests will not be compiled.") + endif(MPFI_FOUND) - create_single_source_cgal_program( "Arithmetic_kernel.cpp" ) - create_single_source_cgal_program( "LEDA_arithmetic_kernel.cpp" ) - create_single_source_cgal_program( "CORE_arithmetic_kernel.cpp" ) - create_single_source_cgal_program( "Get_arithmetic_kernel.cpp" ) + create_single_source_cgal_program("Arithmetic_kernel.cpp") + create_single_source_cgal_program("LEDA_arithmetic_kernel.cpp") + create_single_source_cgal_program("CORE_arithmetic_kernel.cpp") + create_single_source_cgal_program("Get_arithmetic_kernel.cpp") else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") + message( + STATUS "This program requires the CGAL library, and will not be compiled.") endif() - diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt index 2bed310a6e0..363daa85550 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/CMakeLists.txt @@ -1,7 +1,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Arrangement_on_surface_2_Demo ) +project(Arrangement_on_surface_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,28 +12,27 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Core Qt5 ) +find_package(CGAL REQUIRED COMPONENTS Core Qt5) -find_package( Qt5 QUIET COMPONENTS Gui Widgets) +find_package(Qt5 QUIET COMPONENTS Gui Widgets) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) +if(CGAL_Qt5_FOUND + AND Qt5_FOUND + AND CGAL_Core_FOUND) include(${CGAL_USE_FILE}) - include_directories( ./ ) + include_directories(./) # Arrangement package includes add_definitions(-DQT_NO_KEYWORDS) - qt5_wrap_ui( arrangement_2_uis - ArrangementDemoWindow.ui - NewTabDialog.ui - OverlayDialog.ui - ArrangementDemoPropertiesDialog.ui - ) - qt5_wrap_cpp( CGAL_Qt5_MOC_FILES + qt5_wrap_ui(arrangement_2_uis ArrangementDemoWindow.ui NewTabDialog.ui + OverlayDialog.ui ArrangementDemoPropertiesDialog.ui) + qt5_wrap_cpp( + CGAL_Qt5_MOC_FILES ArrangementDemoWindow.h ArrangementDemoTab.h Callback.h -# NewTabDialog.h + # NewTabDialog.h OverlayDialog.h ArrangementDemoPropertiesDialog.h ColorItemEditor.h @@ -41,10 +40,9 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) PropertyValueDelegate.h #PropertyValueDelegate.cpp ) - qt5_add_resources( CGAL_Qt5_RESOURCE_FILES - ArrangementDemoWindow.qrc - ) - add_executable( arrangement_2 + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ArrangementDemoWindow.qrc) + add_executable( + arrangement_2 arrangement_2.cpp ArrangementGraphicsItem.cpp ArrangementDemoWindow.cpp @@ -67,22 +65,22 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) DeleteCurveModeItemEditor.cpp PointsGraphicsItem.cpp VerticalRayGraphicsItem.cpp - ${CGAL_Qt5_MOC_FILES} - ${arrangement_2_uis} - ${CGAL_Qt5_RESOURCE_FILES} - ) - target_link_libraries( arrangement_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_Core - Qt5::Gui - ) + ${CGAL_Qt5_MOC_FILES} + ${arrangement_2_uis} + ${CGAL_Qt5_RESOURCE_FILES}) + target_link_libraries(arrangement_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + CGAL::CGAL_Core Qt5::Gui) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS arrangement_2 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS arrangement_2) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(arrangement_2) else() - message(STATUS "NOTICE: This demo requires CGAL, CGAL-Core and Qt5, and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires CGAL, CGAL-Core and Qt5, and will not be compiled." + ) endif() diff --git a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/CMakeLists.txt b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/CMakeLists.txt index 4c9fdacfcc5..ff78e203585 100644 --- a/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/CMakeLists.txt +++ b/Arrangement_on_surface_2/demo/Arrangement_on_surface_2/tests/CMakeLists.txt @@ -1,4 +1,3 @@ -add_executable( Test Test.cpp ) -add_executable( TestRayPL TestRayPL.cpp ) -add_executable( TestAlgebraic TestAlgebraic.cpp ) - +add_executable(Test Test.cpp) +add_executable(TestRayPL TestRayPL.cpp) +add_executable(TestAlgebraic TestAlgebraic.cpp) diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt index 86ff8829a38..226e1c6fab2 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Arrangement_on_surface_2_Examples ) +project(Arrangement_on_surface_2_Examples) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt index 0ffdc893571..bc3f1b89e7a 100644 --- a/Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt +++ b/Arrangement_on_surface_2/test/Arrangement_on_surface_2/CMakeLists.txt @@ -1,35 +1,28 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Arrangement_on_surface_2_Tests ) +project(Arrangement_on_surface_2_Tests) enable_testing() +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - if(COMMAND target_compile_options) - # Since CMake-2.8.12: New CMake script, that defines the targets and - # the CTest test cases. - include( ${CMAKE_CURRENT_SOURCE_DIR}/cgal_test.cmake ) - else() - # If CMake version is <= 2.8.11, use the usual CMake script. - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - endif() +include(${CGAL_USE_FILE}) +if(COMMAND target_compile_options) + # Since CMake-2.8.12: New CMake script, that defines the targets and + # the CTest test cases. + include(${CMAKE_CURRENT_SOURCE_DIR}/cgal_test.cmake) else() + # If CMake version is <= 2.8.11, use the usual CMake script. - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + # create a target per cppfile + file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) + foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") + endforeach() endif() diff --git a/BGL/examples/BGL_LCC/CMakeLists.txt b/BGL/examples/BGL_LCC/CMakeLists.txt index fea37899fae..0c2bc149e12 100644 --- a/BGL/examples/BGL_LCC/CMakeLists.txt +++ b/BGL/examples/BGL_LCC/CMakeLists.txt @@ -2,26 +2,18 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( BGL_LCC_Examples ) - - +project(BGL_LCC_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -33,7 +25,10 @@ endif() # ########################################################## # create a target per cppfile -file(GLOB_RECURSE cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) +file( + GLOB_RECURSE cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + *.cpp) foreach(cppfile ${cppfiles}) create_single_source_cgal_program("${cppfile}") endforeach() diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt index 685f9bc7367..e23d15c960a 100644 --- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt +++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt @@ -2,38 +2,31 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( BGL_OpenMesh_Examples ) - - +project(BGL_OpenMesh_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() -find_package( OpenMesh QUIET ) +find_package(OpenMesh QUIET) -if ( OpenMesh_FOUND ) -include( UseOpenMesh ) +if(OpenMesh_FOUND) + include(UseOpenMesh) else() - message(STATUS "NOTICE: These examples require OpenMesh and will not be compiled.") + message( + STATUS "NOTICE: These examples require OpenMesh and will not be compiled.") return() endif() @@ -46,7 +39,6 @@ endif() # ########################################################## if(OpenMesh_FOUND) - create_single_source_cgal_program( "TriMesh.cpp" ) - target_link_libraries( TriMesh PRIVATE ${OPENMESH_LIBRARIES} ) + create_single_source_cgal_program("TriMesh.cpp") + target_link_libraries(TriMesh PRIVATE ${OPENMESH_LIBRARIES}) endif() - diff --git a/BGL/examples/BGL_arrangement_2/CMakeLists.txt b/BGL/examples/BGL_arrangement_2/CMakeLists.txt index 31b9e348019..b4a1dcb0228 100644 --- a/BGL/examples/BGL_arrangement_2/CMakeLists.txt +++ b/BGL/examples/BGL_arrangement_2/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( BGL_arrangement_2_Examples ) +project(BGL_arrangement_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/BGL/examples/BGL_graphcut/CMakeLists.txt b/BGL/examples/BGL_graphcut/CMakeLists.txt index 56ee0be7a92..0119b961465 100644 --- a/BGL/examples/BGL_graphcut/CMakeLists.txt +++ b/BGL/examples/BGL_graphcut/CMakeLists.txt @@ -3,26 +3,18 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( BGL_graphcut_Examples ) - +project(BGL_graphcut_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() - +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -32,12 +24,9 @@ endif() # include for local package - # Creating entries for all C++ files with "main" routine # ########################################################## - -create_single_source_cgal_program( "alpha_expansion_example.cpp" ) -create_single_source_cgal_program( "face_selection_borders_regularization_example.cpp" ) - - +create_single_source_cgal_program("alpha_expansion_example.cpp") +create_single_source_cgal_program( + "face_selection_borders_regularization_example.cpp") diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt index 01378916001..7052dc314bb 100644 --- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt +++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt @@ -2,46 +2,38 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( BGL_polyhedron_3_Examples ) - - +project(BGL_polyhedron_3_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() -find_package( OpenMesh QUIET ) +find_package(OpenMesh QUIET) -if ( OpenMesh_FOUND ) - include( UseOpenMesh ) - add_definitions( -DCGAL_USE_OPENMESH ) +if(OpenMesh_FOUND) + include(UseOpenMesh) + add_definitions(-DCGAL_USE_OPENMESH) else() message(STATUS "Examples that use OpenMesh will not be compiled.") endif() -find_package( METIS ) +find_package(METIS) -if( METIS_FOUND ) - include_directories(${METIS_INCLUDE_DIRS} ) +if(METIS_FOUND) + include_directories(${METIS_INCLUDE_DIRS}) else() - message( STATUS "Examples that use the METIS library will not be compiled." ) + message(STATUS "Examples that use the METIS library will not be compiled.") endif() # include for local directory @@ -51,28 +43,27 @@ endif() # Creating entries for all C++ files with "main" routine # ########################################################## -create_single_source_cgal_program( "distance.cpp" ) +create_single_source_cgal_program("distance.cpp") -create_single_source_cgal_program( "incident_vertices.cpp" ) +create_single_source_cgal_program("incident_vertices.cpp") -create_single_source_cgal_program( "kruskal.cpp" ) +create_single_source_cgal_program("kruskal.cpp") -create_single_source_cgal_program( "kruskal_with_stored_id.cpp" ) +create_single_source_cgal_program("kruskal_with_stored_id.cpp") -create_single_source_cgal_program( "normals.cpp" ) +create_single_source_cgal_program("normals.cpp") -create_single_source_cgal_program( "range.cpp" ) +create_single_source_cgal_program("range.cpp") -create_single_source_cgal_program( "transform_iterator.cpp" ) +create_single_source_cgal_program("transform_iterator.cpp") -create_single_source_cgal_program( "copy_polyhedron.cpp" ) +create_single_source_cgal_program("copy_polyhedron.cpp") if(OpenMesh_FOUND) - target_link_libraries( copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES} ) + target_link_libraries(copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES}) endif() -if( METIS_FOUND ) - create_single_source_cgal_program( "polyhedron_partition.cpp" ) - target_link_libraries( polyhedron_partition PRIVATE ${METIS_LIBRARIES} ) +if(METIS_FOUND) + create_single_source_cgal_program("polyhedron_partition.cpp") + target_link_libraries(polyhedron_partition PRIVATE ${METIS_LIBRARIES}) endif() - diff --git a/BGL/examples/BGL_surface_mesh/CMakeLists.txt b/BGL/examples/BGL_surface_mesh/CMakeLists.txt index 13ba8575799..92d4c226359 100644 --- a/BGL/examples/BGL_surface_mesh/CMakeLists.txt +++ b/BGL/examples/BGL_surface_mesh/CMakeLists.txt @@ -1,31 +1,24 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( BGL_surface_mesh_Examples ) +project(BGL_surface_mesh_Examples) - -find_package( CGAL QUIET ) - -if ( NOT CGAL_FOUND ) - message( STATUS "This project requires the CGAL library, and will not be compiled." ) - return() -endif() +find_package(CGAL REQUIRED) # include for local package -create_single_source_cgal_program( "prim.cpp" ) -create_single_source_cgal_program( "gwdwg.cpp" ) -create_single_source_cgal_program( "seam_mesh.cpp" ) -create_single_source_cgal_program( "write_inp.cpp" ) -create_single_source_cgal_program( "surface_mesh_dual.cpp" ) -create_single_source_cgal_program( "connected_components.cpp" ) +create_single_source_cgal_program("prim.cpp") +create_single_source_cgal_program("gwdwg.cpp") +create_single_source_cgal_program("seam_mesh.cpp") +create_single_source_cgal_program("write_inp.cpp") +create_single_source_cgal_program("surface_mesh_dual.cpp") +create_single_source_cgal_program("connected_components.cpp") -find_package( METIS ) +find_package(METIS) -if( METIS_FOUND ) - include_directories(${METIS_INCLUDE_DIRS} ) +if(METIS_FOUND) + include_directories(${METIS_INCLUDE_DIRS}) - create_single_source_cgal_program( "surface_mesh_partition.cpp" ) - target_link_libraries( surface_mesh_partition PRIVATE ${METIS_LIBRARIES} ) + create_single_source_cgal_program("surface_mesh_partition.cpp") + target_link_libraries(surface_mesh_partition PRIVATE ${METIS_LIBRARIES}) else() - message( STATUS "Examples that use the METIS library will not be compiled." ) + message(STATUS "Examples that use the METIS library will not be compiled.") endif() - diff --git a/BGL/examples/BGL_triangulation_2/CMakeLists.txt b/BGL/examples/BGL_triangulation_2/CMakeLists.txt index 55eb169ecff..9fa3903f234 100644 --- a/BGL/examples/BGL_triangulation_2/CMakeLists.txt +++ b/BGL/examples/BGL_triangulation_2/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( BGL_triangulation_2_Examples ) +project(BGL_triangulation_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 2f9e1bb404e..febec4096a0 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -2,113 +2,102 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( BGL_Tests ) - - - - +project(BGL_Tests) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost ) +find_package(Boost) -if ( NOT Boost_FOUND ) - message(STATUS "This project requires the Boost library, and will not be compiled.") +if(NOT Boost_FOUND) + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() -find_package( OpenMesh QUIET ) +find_package(OpenMesh QUIET) -if ( OpenMesh_FOUND ) - include( UseOpenMesh ) - add_definitions( -DCGAL_USE_OPENMESH ) +if(OpenMesh_FOUND) + include(UseOpenMesh) + add_definitions(-DCGAL_USE_OPENMESH) else() message(STATUS "Examples that use OpenMesh will not be compiled.") endif() - - # include for local package # Creating entries for all .cpp/.C files with "main" routine # ########################################################## if(OpenMesh_FOUND) - create_single_source_cgal_program( "graph_concept_OpenMesh.cpp" ) - target_link_libraries( graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} ) + create_single_source_cgal_program("graph_concept_OpenMesh.cpp") + target_link_libraries(graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) endif() -create_single_source_cgal_program( "next.cpp" ) +create_single_source_cgal_program("next.cpp") -create_single_source_cgal_program( "test_circulator.cpp" ) +create_single_source_cgal_program("test_circulator.cpp") -create_single_source_cgal_program( "test_Gwdwg.cpp" ) +create_single_source_cgal_program("test_Gwdwg.cpp") -create_single_source_cgal_program( "test_bgl_dual.cpp" ) +create_single_source_cgal_program("test_bgl_dual.cpp") -create_single_source_cgal_program( "graph_concept_Polyhedron_3.cpp" ) +create_single_source_cgal_program("graph_concept_Polyhedron_3.cpp") -create_single_source_cgal_program( "graph_concept_Dual.cpp" ) +create_single_source_cgal_program("graph_concept_Dual.cpp") -create_single_source_cgal_program( "graph_concept_Triangulation_2.cpp" ) +create_single_source_cgal_program("graph_concept_Triangulation_2.cpp") -create_single_source_cgal_program( "graph_concept_Surface_mesh.cpp" ) +create_single_source_cgal_program("graph_concept_Surface_mesh.cpp") -create_single_source_cgal_program( "graph_concept_Seam_mesh_Surface_mesh.cpp" ) +create_single_source_cgal_program("graph_concept_Seam_mesh_Surface_mesh.cpp") -create_single_source_cgal_program( "graph_concept_Gwdwg_Surface_mesh.cpp" ) +create_single_source_cgal_program("graph_concept_Gwdwg_Surface_mesh.cpp") -create_single_source_cgal_program( "graph_concept_Linear_cell_complex.cpp" ) +create_single_source_cgal_program("graph_concept_Linear_cell_complex.cpp") -create_single_source_cgal_program( "graph_concept_Arrangement_2.cpp" ) +create_single_source_cgal_program("graph_concept_Arrangement_2.cpp") -create_single_source_cgal_program( "test_clear.cpp" ) +create_single_source_cgal_program("test_clear.cpp") -create_single_source_cgal_program( "test_helpers.cpp" ) +create_single_source_cgal_program("test_helpers.cpp") -create_single_source_cgal_program( "test_Has_member_clear.cpp" ) +create_single_source_cgal_program("test_Has_member_clear.cpp") -create_single_source_cgal_program( "test_Has_member_id.cpp" ) +create_single_source_cgal_program("test_Has_member_id.cpp") -create_single_source_cgal_program( "test_cgal_bgl_named_params.cpp" ) +create_single_source_cgal_program("test_cgal_bgl_named_params.cpp") -create_single_source_cgal_program( "test_bgl_read_write.cpp" ) +create_single_source_cgal_program("test_bgl_read_write.cpp") -create_single_source_cgal_program( "graph_concept_Face_filtered_graph.cpp" ) +create_single_source_cgal_program("graph_concept_Face_filtered_graph.cpp") -create_single_source_cgal_program( "test_Manifold_face_removal.cpp") +create_single_source_cgal_program("test_Manifold_face_removal.cpp") -create_single_source_cgal_program( "test_Regularize_face_selection_borders.cpp") +create_single_source_cgal_program("test_Regularize_face_selection_borders.cpp") -create_single_source_cgal_program( "test_Face_filtered_graph.cpp" ) +create_single_source_cgal_program("test_Face_filtered_graph.cpp") -create_single_source_cgal_program( "test_Euler_operations.cpp" ) +create_single_source_cgal_program("test_Euler_operations.cpp") -create_single_source_cgal_program( "test_Collapse_edge.cpp" ) +create_single_source_cgal_program("test_Collapse_edge.cpp") -create_single_source_cgal_program( "test_graph_traits.cpp" ) +create_single_source_cgal_program("test_graph_traits.cpp") -create_single_source_cgal_program( "test_Properties.cpp" ) +create_single_source_cgal_program("test_Properties.cpp") -create_single_source_cgal_program( "test_wrl.cpp" ) +create_single_source_cgal_program("test_wrl.cpp") -create_single_source_cgal_program( "bench_read_from_stream_vs_add_face_and_add_faces.cpp" ) +create_single_source_cgal_program( + "bench_read_from_stream_vs_add_face_and_add_faces.cpp") if(OpenMesh_FOUND) - target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES}) - target_link_libraries( test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES}) - target_link_libraries( test_Collapse_edge PRIVATE ${OPENMESH_LIBRARIES}) - target_link_libraries( test_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES}) - target_link_libraries( test_graph_traits PRIVATE ${OPENMESH_LIBRARIES} ) - target_link_libraries( test_Properties PRIVATE ${OPENMESH_LIBRARIES}) - target_link_libraries( test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(test_clear PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(test_Collapse_edge PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(test_Face_filtered_graph PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(test_graph_traits PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(test_Properties PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES}) endif() diff --git a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt index fe29d09d8af..dd081fc1f23 100644 --- a/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/examples/Barycentric_coordinates_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Barycentric_coordinates_2_Examples ) +project(Barycentric_coordinates_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt index 1e5b96696b2..3af8199b60a 100644 --- a/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt +++ b/Barycentric_coordinates_2/test/Barycentric_coordinates_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Barycentric_coordinates_2_Tests ) +project(Barycentric_coordinates_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt index dac559d6846..b02cec7624c 100644 --- a/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt +++ b/Boolean_set_operations_2/archive/demo/Boolean_set_operations_2_GraphicsView/CMakeLists.txt @@ -2,42 +2,49 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Boolean_set_operations_2_GraphicsView_Demo ) +project(Boolean_set_operations_2_GraphicsView_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. cmake_policy(SET CMP0053 OLD) endif() -find_package(CGAL COMPONENTS Qt5 Core ) +find_package(CGAL COMPONENTS Qt5 Core) -set( QT_USE_QTMAIN TRUE ) +set(QT_USE_QTMAIN TRUE) find_package(Qt5 QUIET COMPONENTS Widgets Script Svg) -include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include ) +include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND ) -set(CMAKE_AUTOMOC ON) +if(CGAL_Qt5_FOUND + AND Qt5_FOUND + AND CGAL_Core_FOUND) + set(CMAKE_AUTOMOC ON) # UI files (Qt Designer files) - qt5_wrap_ui( CDT_UI_FILES boolean_operations_2.ui ) + qt5_wrap_ui(CDT_UI_FILES boolean_operations_2.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.qrc) # use the Qt MOC preprocessor on classes that derives from QObject - # The executable itself. - add_executable ( boolean_operations_2 ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.cpp ${CGAL_Qt5_MOC_FILES} ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ) + add_executable( + boolean_operations_2 + ${CMAKE_CURRENT_SOURCE_DIR}/boolean_operations_2.cpp ${CGAL_Qt5_MOC_FILES} + ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}) # Link with Qt libraries - target_link_libraries( boolean_operations_2 Qt5::Widgets Qt5::Script Qt5::Svg ) + target_link_libraries(boolean_operations_2 Qt5::Widgets Qt5::Script Qt5::Svg) # Link with CGAL - target_link_libraries( boolean_operations_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) + target_link_libraries(boolean_operations_2 ${CGAL_LIBRARIES} + ${CGAL_3RD_PARTY_LIBRARIES}) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt b/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt index f3a59f95641..38c8d696c74 100644 --- a/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt +++ b/Boolean_set_operations_2/examples/Boolean_set_operations_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Boolean_set_operations_2_Examples ) +project(Boolean_set_operations_2_Examples) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt b/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt index f346e2183ec..166a39cef9a 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Boolean_set_operations_2_Tests ) +project(Boolean_set_operations_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt b/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt index 9c066bd6cf4..08e699ac285 100644 --- a/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Approximate_min_ellipsoid_d/CMakeLists.txt @@ -1,31 +1,25 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Approximate_min_ellipsoid_d_Examples ) +project(Approximate_min_ellipsoid_d_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +# Use Eigen +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) +include(CGAL_Eigen_support) -if ( CGAL_FOUND ) - - # Use Eigen - find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) - include(CGAL_Eigen_support) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - if(NOT (${cppfile} STREQUAL "ellipsoid.cpp") OR TARGET CGAL::Eigen_support) - get_filename_component(target ${cppfile} NAME_WE) - add_executable(${target} ${cppfile}) - if (TARGET CGAL::Eigen_support) - target_link_libraries(${target} CGAL::CGAL CGAL::Eigen_support) - else() - target_link_libraries(${target} CGAL::CGAL) - endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + if(NOT (${cppfile} STREQUAL "ellipsoid.cpp") OR TARGET CGAL::Eigen_support) + get_filename_component(target ${cppfile} NAME_WE) + add_executable(${target} ${cppfile}) + if(TARGET CGAL::Eigen_support) + target_link_libraries(${target} CGAL::CGAL CGAL::Eigen_support) + else() + target_link_libraries(${target} CGAL::CGAL) endif() - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() + endif() +endforeach() diff --git a/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt b/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt index d6c37a90755..ad8fe4ddf0b 100644 --- a/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_annulus_d/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Min_annulus_d_Examples ) +project(Min_annulus_d_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt b/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt index 5de341bd9de..2ff0b1cff21 100644 --- a/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_circle_2/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Min_circle_2_Examples ) +project(Min_circle_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt b/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt index 2cd8f3660b5..6d361aa34df 100644 --- a/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_ellipse_2/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Min_ellipse_2_Examples ) +project(Min_ellipse_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt b/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt index ff63e20a54e..c953eb3cd15 100644 --- a/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_quadrilateral_2/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Min_quadrilateral_2_Examples ) +project(Min_quadrilateral_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt b/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt index d6192ef5da1..bbf53300d8c 100644 --- a/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_sphere_d/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Min_sphere_d_Examples ) +project(Min_sphere_d_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt b/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt index 1e04215d3b6..de68529c5cd 100644 --- a/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt +++ b/Bounding_volumes/examples/Min_sphere_of_spheres_d/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Min_sphere_of_spheres_d_Examples ) +project(Min_sphere_of_spheres_d_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt b/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt index 52756958264..0e43e5b4e8b 100644 --- a/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt +++ b/Bounding_volumes/examples/Rectangular_p_center_2/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Rectangular_p_center_2_Examples ) +project(Rectangular_p_center_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt b/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt index 5a29e19f887..54875af2ee2 100644 --- a/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt +++ b/Bounding_volumes/test/Bounding_volumes/CMakeLists.txt @@ -1,37 +1,31 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Bounding_volumes_Tests ) +project(Bounding_volumes_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) +include(${CGAL_USE_FILE}) -if ( CGAL_FOUND ) +# Use Eigen +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) +include(CGAL_Eigen_support) - include(${CGAL_USE_FILE}) - - # Use Eigen - find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) - include(CGAL_Eigen_support) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - if(NOT (${cppfile} STREQUAL "Approximate_min_ellipsoid_d.cpp") OR TARGET CGAL::Eigen_support) - get_filename_component(target ${cppfile} NAME_WE) - add_executable(${target} ${cppfile}) - if (TARGET CGAL::Eigen_support) - target_link_libraries(${target} CGAL::CGAL CGAL::Eigen_support) - else() - target_link_libraries(${target} CGAL::CGAL) - endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + if(NOT (${cppfile} STREQUAL "Approximate_min_ellipsoid_d.cpp") + OR TARGET CGAL::Eigen_support) + get_filename_component(target ${cppfile} NAME_WE) + add_executable(${target} ${cppfile}) + if(TARGET CGAL::Eigen_support) + target_link_libraries(${target} CGAL::CGAL CGAL::Eigen_support) + else() + target_link_libraries(${target} CGAL::CGAL) endif() - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() + endif() +endforeach() diff --git a/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt b/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt index 6b17fe83e29..8c14f8e3813 100644 --- a/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt +++ b/Box_intersection_d/examples/Box_intersection_d/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Box_intersection_d_Examples ) +project(Box_intersection_d_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt index de7955c4208..5d214d0151d 100644 --- a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt +++ b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt @@ -1,27 +1,22 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Box_intersection_d_Tests ) +project(Box_intersection_d_Tests) -find_package( CGAL QUIET ) +find_package(CGAL REQUIRED) -find_package( TBB ) +find_package(TBB) include(CGAL_TBB_support) -if ( CGAL_FOUND ) +create_single_source_cgal_program("automated_test.cpp") +create_single_source_cgal_program("benchmark_box_intersection.cpp") +create_single_source_cgal_program("random_set_test.cpp") +create_single_source_cgal_program("test_box_grid.cpp") - create_single_source_cgal_program( "automated_test.cpp" ) - create_single_source_cgal_program( "benchmark_box_intersection.cpp" ) - create_single_source_cgal_program( "random_set_test.cpp" ) - create_single_source_cgal_program( "test_box_grid.cpp" ) - - if(TARGET CGAL::TBB_support) - target_link_libraries(test_box_grid PUBLIC CGAL::TBB_support) - else() - message( STATUS "NOTICE: Intel TBB was not found. Sequential code will be used." ) - endif() +if(TARGET CGAL::TBB_support) + target_link_libraries(test_box_grid PUBLIC CGAL::TBB_support) else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") + message( + STATUS "NOTICE: Intel TBB was not found. Sequential code will be used.") endif() diff --git a/CGAL_Core/examples/Core/CMakeLists.txt b/CGAL_Core/examples/Core/CMakeLists.txt index 1ff71a69b29..96bf8fcbfde 100644 --- a/CGAL_Core/examples/Core/CMakeLists.txt +++ b/CGAL_Core/examples/Core/CMakeLists.txt @@ -1,26 +1,25 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Core_Examples ) - - - - +project(Core_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS Core ) +find_package(CGAL REQUIRED COMPONENTS Core) -if ( NOT CGAL_Core_FOUND ) +if(NOT CGAL_Core_FOUND) - message(STATUS "This project requires the CGAL_Core library, and will not be compiled.") + message( + STATUS + "This project requires the CGAL_Core library, and will not be compiled.") return() endif() # Boost and its components -find_package( Boost ) +find_package(Boost) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -34,4 +33,4 @@ include(${CGAL_USE_FILE}) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "delaunay.cpp" ) +create_single_source_cgal_program("delaunay.cpp") diff --git a/CGAL_Core/src/CGAL_Core/CMakeLists.txt b/CGAL_Core/src/CGAL_Core/CMakeLists.txt index 0ce25c586ca..182b102f6b6 100644 --- a/CGAL_Core/src/CGAL_Core/CMakeLists.txt +++ b/CGAL_Core/src/CGAL_Core/CMakeLists.txt @@ -11,8 +11,7 @@ if(CGAL_Core_FOUND) set(keyword PUBLIC) endif() - CGAL_setup_CGAL_Core_dependencies(CGAL_Core ${keyword}) + cgal_setup_cgal_core_dependencies(CGAL_Core ${keyword}) message("libCGAL_Core is configured") endif() - diff --git a/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt b/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt index cebf419d28a..08e42e919b7 100644 --- a/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt +++ b/CGAL_ImageIO/archive/demo/CGALimageIO/CMakeLists.txt @@ -6,24 +6,21 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) cmake_policy(SET CMP0053 OLD) endif() - set(PACKAGE_ROOT ../..) # Add several CGAL packages to the include and link paths, # if they lie in ${PACKAGE_ROOT}/. -foreach(INC_DIR ${PACKAGE_ROOT}/include - ${PACKAGE_ROOT}/../CGAL_ImageIO/include ) +foreach(INC_DIR ${PACKAGE_ROOT}/include ${PACKAGE_ROOT}/../CGAL_ImageIO/include) if(EXISTS ${INC_DIR}) - include_directories (BEFORE ${INC_DIR}) + include_directories(BEFORE ${INC_DIR}) endif() endforeach() foreach(LIB_DIR ${PACKAGE_ROOT}/../CGAL_ImageIO/src/CGAL_ImageIO) - if (EXISTS ${LIB_DIR}) - link_directories (${LIB_DIR}) + if(EXISTS ${LIB_DIR}) + link_directories(${LIB_DIR}) endif() endforeach() - find_package(CGAL REQUIRED ImageIO) find_package(VTK QUIET NO_MODULE) @@ -35,19 +32,24 @@ if(VTK_FOUND) include(${VTK_USE_FILE}) find_package(Qt${VTK_QT_VERSION} COMPONENTS QtGui) if(NOT TARGET Qt${VTK_QT_VERSION}::QtGui) - message(STATUS "NOTICE: vtkRenderingQt needs Qt${VTK_QT_VERSION}, and will not be compiled.") + message( + STATUS + "NOTICE: vtkRenderingQt needs Qt${VTK_QT_VERSION}, and will not be compiled." + ) return() endif() - add_executable( image_to_vtk_viewer image_to_vtk_viewer.cpp ) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS image_to_vtk_viewer ) + add_executable(image_to_vtk_viewer image_to_vtk_viewer.cpp) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS image_to_vtk_viewer) - target_link_libraries( image_to_vtk_viewer - ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} - ${VTK_LIBRARIES} Qt${VTK_QT_VERSION}::QtGui - ) + target_link_libraries( + image_to_vtk_viewer ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} + ${VTK_LIBRARIES} Qt${VTK_QT_VERSION}::QtGui) else() - message(STATUS "NOTICE: This demo needs vtkRenderingQt and vtkFiltersModeling, and will not be compiled.") + message( + STATUS + "NOTICE: This demo needs vtkRenderingQt and vtkFiltersModeling, and will not be compiled." + ) endif() else() message(STATUS "NOTICE: This demo needs VTK, and will not be compiled.") diff --git a/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt b/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt index 06327048deb..388320a6938 100644 --- a/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt +++ b/CGAL_ImageIO/examples/CGALimageIO/CMakeLists.txt @@ -2,21 +2,23 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( CGALimageIO_Examples ) - +project(CGALimageIO_Examples) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() -find_package(CGAL QUIET COMPONENTS ImageIO ) +find_package(CGAL REQUIRED COMPONENTS ImageIO) if(CGAL_ImageIO_FOUND) include(${CGAL_USE_FILE}) - create_single_source_cgal_program( "convert_raw_image_to_inr.cpp" ) - create_single_source_cgal_program( "test_imageio.cpp" ) - create_single_source_cgal_program( "extract_a_sub_image.cpp" ) + create_single_source_cgal_program("convert_raw_image_to_inr.cpp") + create_single_source_cgal_program("test_imageio.cpp") + create_single_source_cgal_program("extract_a_sub_image.cpp") else() - message(STATUS "NOTICE: This demo needs the CGAL ImageIO library, and will not be compiled.") + message( + STATUS + "NOTICE: This demo needs the CGAL ImageIO library, and will not be compiled." + ) endif() diff --git a/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt b/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt index f9c2a7eeac9..f24e6d39961 100644 --- a/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt +++ b/CGAL_ImageIO/src/CGAL_ImageIO/CMakeLists.txt @@ -1,6 +1,6 @@ message("Configuring libCGAL_ImageIO") -collect_cgal_library( CGAL_ImageIO "") +collect_cgal_library(CGAL_ImageIO "") include(CGAL_SetupCGAL_ImageIODependencies) @@ -8,11 +8,11 @@ if(CGAL_HEADER_ONLY) set(keyword "INTERFACE") endif() -CGAL_setup_CGAL_ImageIO_dependencies(CGAL_ImageIO ${keyword}) +cgal_setup_cgal_imageio_dependencies(CGAL_ImageIO ${keyword}) if(COMMAND add_config_flag) - set( CGAL_HAS_IMAGEIO TRUE ) - add_config_flag( CGAL_HAS_IMAGEIO ) + set(CGAL_HAS_IMAGEIO TRUE) + add_config_flag(CGAL_HAS_IMAGEIO) endif() if(ZLIB_FOUND) diff --git a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt index 0efc7671551..870df23d064 100644 --- a/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt +++ b/CGAL_ImageIO/test/CGAL_ImageIO/CMakeLists.txt @@ -1,29 +1,22 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( CGAL_ImageIO_Tests ) - +project(CGAL_ImageIO_Tests) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() -find_package(CGAL QUIET COMPONENTS ImageIO ) +find_package(CGAL REQUIRED COMPONENTS ImageIO) -if ( CGAL_FOUND ) - include(${CGAL_USE_FILE}) - - if (WITH_CGAL_ImageIO) - create_single_source_cgal_program( "test_trilinear_interpolation.cpp" ) - else() - message(STATUS "NOTICE: Some tests require the CGAL_ImageIO library, and will not be compiled.") - endif() +include(${CGAL_USE_FILE}) +if(WITH_CGAL_ImageIO) + create_single_source_cgal_program("test_trilinear_interpolation.cpp") else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: Some tests require the CGAL_ImageIO library, and will not be compiled." + ) endif() - diff --git a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt index 6e6749d8619..6bfda2f562d 100644 --- a/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt +++ b/CGAL_ipelets/demo/CGAL_ipelets/CMakeLists.txt @@ -6,162 +6,172 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) cmake_policy(SET CMP0053 OLD) endif() -macro( remove_leading_zero var ) +macro(remove_leading_zero var) string(SUBSTRING "${${var}}" 0 1 ONECHAR) string(COMPARE EQUAL "${ONECHAR}" "0" ISZERO) - if (${ISZERO}) + if(${ISZERO}) string(SUBSTRING "${${var}}" 1 1 ONECHAR) set(${var} ${ONECHAR}) endif() endmacro() - - #path where to build libraries set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") -find_package(CGAL QUIET COMPONENTS Core) +find_package(CGAL REQUIRED COMPONENTS Core) -if ( CGAL_FOUND ) +include(${CGAL_USE_FILE}) - include(${CGAL_USE_FILE}) - - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if (NOT TARGET CGAL::Eigen_support) - message(STATUS "NOTICE: This project requires the Eigen library, and will not be compiled.") - return() - endif() - - find_package(IPE 6) - - if ( IPE_FOUND ) - include_directories(BEFORE ${IPE_INCLUDE_DIR}) - - if (${IPE_VERSION} EQUAL "7") - set(WITH_IPE_7 ON) - elseif(${IPE_VERSION} EQUAL "6") - set(WITH_IPE_7 OFF) - else() - message("-- Error: ${IPE_VERSION} is not a supported version of IPE (only 6 and 7 are).") - set(IPE_FOUND FALSE) - endif() - # starting ipe 7.2.1, a compiler with c++11 must be used to compile ipelets - if (${IPE_VERSION} EQUAL "7" AND - ${IPE_MINOR_VERSION_1} GREATER "1" AND - ${IPE_MINOR_VERSION_2} GREATER "0") - message(STATUS "Starting from Ipe 7.2.1 a compiler with c++11 support must be used") - - list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11) - if(has_cpp11 LESS 0) - message(STATUS "NOTICE: This demo requires a C++11 compiler and will not be compiled.") - return() - endif() - - # Use C++11 for this directory and its sub-directories. - set(CMAKE_CXX_STANDARD 11) - set(CMAKE_CXX_STANDARD_REQUIRED TRUE) - - endif() - endif() - - if ( IPE_FOUND AND IPE_VERSION) - if (WITH_IPE_7) - add_definitions(-DCGAL_USE_IPE_7) - endif() - - message("-- Using IPE version ${IPE_VERSION} compatibility.") - - #setting installation directory - get_filename_component(IPE_LIBRARY_DIR ${IPE_LIBRARIES} PATH) - if (IPE_FOUND AND NOT IPELET_INSTALL_DIR) - if (WITH_IPE_7) - remove_leading_zero(IPE_MINOR_VERSION_1) - remove_leading_zero(IPE_MINOR_VERSION_2) - set(INSTALL_PATHS "${IPE_LIBRARY_DIR}/ipe/7.${IPE_MINOR_VERSION_1}.${IPE_MINOR_VERSION_2}/ipelets/") - find_path(IPELET_INSTALL_DIR - NAMES libgoodies.lua goodies.lua - PATHS ${INSTALL_PATHS} - DOC "The folder where ipelets will be installed" - ENV IPELETPATH - ) - else() - foreach (VER RANGE 28 40) - string(REPLACE XX ${VER} PATHC "${IPE_LIBRARY_DIR}/ipe/6.0preXX/ipelets/" ) - set(INSTALL_PATHS ${INSTALL_PATHS} ${PATHC}) - endforeach() - set(INSTALL_PATHS ${INSTALL_PATHS} ${PATHC}) - set(INSTALL_PATHS ${INSTALL_PATHS} /usr/lib64/ipe/6.0/ipelets) - set(INSTALL_PATHS ${INSTALL_PATHS} /usr/lib/ipe/6.0/ipelets) - - - find_library(IPELET_INSTALL_DIR_FILES - NAMES align - PATHS ${INSTALL_PATHS} - ENV IPELETPATH - ) - if (IPELET_INSTALL_DIR_FILES) - get_filename_component(IPELET_INSTALL_DIR ${IPELET_INSTALL_DIR_FILES} PATH) - endif() - endif() - endif() - - set(CGAL_IPELETS ${CGAL_IPELETS}) - set(CGAL_IPELETS ${CGAL_IPELETS} alpha_shapes) - set(CGAL_IPELETS ${CGAL_IPELETS} arrangement) - set(CGAL_IPELETS ${CGAL_IPELETS} bbox_restriction) - set(CGAL_IPELETS ${CGAL_IPELETS} diagrams) - set(CGAL_IPELETS ${CGAL_IPELETS} hilbert_sort) - set(CGAL_IPELETS ${CGAL_IPELETS} hull) - set(CGAL_IPELETS ${CGAL_IPELETS} generator) - set(CGAL_IPELETS ${CGAL_IPELETS} mesh_2) - set(CGAL_IPELETS ${CGAL_IPELETS} minkowski) - set(CGAL_IPELETS ${CGAL_IPELETS} mst) - set(CGAL_IPELETS ${CGAL_IPELETS} multi_delaunay) - set(CGAL_IPELETS ${CGAL_IPELETS} multi_regular) - set(CGAL_IPELETS ${CGAL_IPELETS} partition) - set(CGAL_IPELETS ${CGAL_IPELETS} pca) - set(CGAL_IPELETS ${CGAL_IPELETS} skeleton) - set(CGAL_IPELETS ${CGAL_IPELETS} svdlinf) - set(CGAL_IPELETS ${CGAL_IPELETS} triangulation) - set(CGAL_IPELETS ${CGAL_IPELETS} circle_pencils) - set(CGAL_IPELETS ${CGAL_IPELETS} hyperbolic) - set(CGAL_IPELETS ${CGAL_IPELETS} distance) - if(CGAL_Core_FOUND) - set(CGAL_IPELETS ${CGAL_IPELETS} cone_spanners) - endif() - - - if ( IPELET_INSTALL_DIR ) - message(STATUS "Set Ipelets install dir: ${IPELET_INSTALL_DIR}") - endif() - - include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) - - foreach(IPELET ${CGAL_IPELETS}) - add_library(CGAL_${IPELET} MODULE ${IPELET}.cpp) - add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_${IPELET}) - target_link_libraries(CGAL_${IPELET} PRIVATE CGAL::CGAL CGAL::Eigen_support ${IPE_LIBRARIES}) - if ( IPELET_INSTALL_DIR ) - install(TARGETS CGAL_${IPELET} DESTINATION ${IPELET_INSTALL_DIR}) - if (WITH_IPE_7) - install(FILES ./lua/libCGAL_${IPELET}.lua DESTINATION ${IPELET_INSTALL_DIR}) #only for ipe 7 - endif() - endif () - cgal_add_compilation_test(CGAL_${IPELET}) - endforeach(IPELET) - if(CGAL_Core_FOUND) - target_link_libraries(CGAL_cone_spanners PRIVATE CGAL::CGAL_Core CGAL::Eigen_support) - endif() - #example in doc not installed - add_library(simple_triangulation MODULE simple_triangulation.cpp) - add_to_cached_list(CGAL_EXECUTABLE_TARGETS simple_triangulation) - target_link_libraries(simple_triangulation CGAL::Eigen_support ${IPE_LIBRARIES}) - cgal_add_compilation_test(simple_triangulation) - - else() - message(STATUS "NOTICE: This program requires the Ipe include files and library, and will not be compiled.") - endif() -else() - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS + "NOTICE: This project requires the Eigen library, and will not be compiled." + ) + return() +endif() + +find_package(IPE 6) + +if(IPE_FOUND) + include_directories(BEFORE ${IPE_INCLUDE_DIR}) + + if(${IPE_VERSION} EQUAL "7") + set(WITH_IPE_7 ON) + elseif(${IPE_VERSION} EQUAL "6") + set(WITH_IPE_7 OFF) + else() + message( + "-- Error: ${IPE_VERSION} is not a supported version of IPE (only 6 and 7 are)." + ) + set(IPE_FOUND FALSE) + endif() + # starting ipe 7.2.1, a compiler with c++11 must be used to compile ipelets + if(${IPE_VERSION} EQUAL "7" + AND ${IPE_MINOR_VERSION_1} GREATER "1" + AND ${IPE_MINOR_VERSION_2} GREATER "0") + message( + STATUS + "Starting from Ipe 7.2.1 a compiler with c++11 support must be used") + + list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11) + if(has_cpp11 LESS 0) + message( + STATUS + "NOTICE: This demo requires a C++11 compiler and will not be compiled." + ) + return() + endif() + + # Use C++11 for this directory and its sub-directories. + set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED TRUE) + + endif() +endif() + +if(IPE_FOUND AND IPE_VERSION) + if(WITH_IPE_7) + add_definitions(-DCGAL_USE_IPE_7) + endif() + + message("-- Using IPE version ${IPE_VERSION} compatibility.") + + #setting installation directory + get_filename_component(IPE_LIBRARY_DIR ${IPE_LIBRARIES} PATH) + if(IPE_FOUND AND NOT IPELET_INSTALL_DIR) + if(WITH_IPE_7) + remove_leading_zero(IPE_MINOR_VERSION_1) + remove_leading_zero(IPE_MINOR_VERSION_2) + set(INSTALL_PATHS + "${IPE_LIBRARY_DIR}/ipe/7.${IPE_MINOR_VERSION_1}.${IPE_MINOR_VERSION_2}/ipelets/" + ) + find_path( + IPELET_INSTALL_DIR + NAMES libgoodies.lua goodies.lua + PATHS ${INSTALL_PATHS} + DOC "The folder where ipelets will be installed" ENV IPELETPATH) + else() + foreach(VER RANGE 28 40) + string(REPLACE XX ${VER} PATHC + "${IPE_LIBRARY_DIR}/ipe/6.0preXX/ipelets/") + set(INSTALL_PATHS ${INSTALL_PATHS} ${PATHC}) + endforeach() + set(INSTALL_PATHS ${INSTALL_PATHS} ${PATHC}) + set(INSTALL_PATHS ${INSTALL_PATHS} /usr/lib64/ipe/6.0/ipelets) + set(INSTALL_PATHS ${INSTALL_PATHS} /usr/lib/ipe/6.0/ipelets) + + find_library( + IPELET_INSTALL_DIR_FILES + NAMES align + PATHS ${INSTALL_PATHS} ENV IPELETPATH) + if(IPELET_INSTALL_DIR_FILES) + get_filename_component(IPELET_INSTALL_DIR ${IPELET_INSTALL_DIR_FILES} + PATH) + endif() + endif() + endif() + + set(CGAL_IPELETS ${CGAL_IPELETS}) + set(CGAL_IPELETS ${CGAL_IPELETS} alpha_shapes) + set(CGAL_IPELETS ${CGAL_IPELETS} arrangement) + set(CGAL_IPELETS ${CGAL_IPELETS} bbox_restriction) + set(CGAL_IPELETS ${CGAL_IPELETS} diagrams) + set(CGAL_IPELETS ${CGAL_IPELETS} hilbert_sort) + set(CGAL_IPELETS ${CGAL_IPELETS} hull) + set(CGAL_IPELETS ${CGAL_IPELETS} generator) + set(CGAL_IPELETS ${CGAL_IPELETS} mesh_2) + set(CGAL_IPELETS ${CGAL_IPELETS} minkowski) + set(CGAL_IPELETS ${CGAL_IPELETS} mst) + set(CGAL_IPELETS ${CGAL_IPELETS} multi_delaunay) + set(CGAL_IPELETS ${CGAL_IPELETS} multi_regular) + set(CGAL_IPELETS ${CGAL_IPELETS} partition) + set(CGAL_IPELETS ${CGAL_IPELETS} pca) + set(CGAL_IPELETS ${CGAL_IPELETS} skeleton) + set(CGAL_IPELETS ${CGAL_IPELETS} svdlinf) + set(CGAL_IPELETS ${CGAL_IPELETS} triangulation) + set(CGAL_IPELETS ${CGAL_IPELETS} circle_pencils) + set(CGAL_IPELETS ${CGAL_IPELETS} hyperbolic) + set(CGAL_IPELETS ${CGAL_IPELETS} distance) + if(CGAL_Core_FOUND) + set(CGAL_IPELETS ${CGAL_IPELETS} cone_spanners) + endif() + + if(IPELET_INSTALL_DIR) + message(STATUS "Set Ipelets install dir: ${IPELET_INSTALL_DIR}") + endif() + + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + + foreach(IPELET ${CGAL_IPELETS}) + add_library(CGAL_${IPELET} MODULE ${IPELET}.cpp) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_${IPELET}) + target_link_libraries(CGAL_${IPELET} PRIVATE CGAL::CGAL CGAL::Eigen_support + ${IPE_LIBRARIES}) + if(IPELET_INSTALL_DIR) + install(TARGETS CGAL_${IPELET} DESTINATION ${IPELET_INSTALL_DIR}) + if(WITH_IPE_7) + install(FILES ./lua/libCGAL_${IPELET}.lua + DESTINATION ${IPELET_INSTALL_DIR}) #only for ipe 7 + endif() + endif() + cgal_add_compilation_test(CGAL_${IPELET}) + endforeach(IPELET) + if(CGAL_Core_FOUND) + target_link_libraries(CGAL_cone_spanners PRIVATE CGAL::CGAL_Core + CGAL::Eigen_support) + endif() + #example in doc not installed + add_library(simple_triangulation MODULE simple_triangulation.cpp) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS simple_triangulation) + target_link_libraries(simple_triangulation CGAL::Eigen_support + ${IPE_LIBRARIES}) + cgal_add_compilation_test(simple_triangulation) + +else() + message( + STATUS + "NOTICE: This program requires the Ipe include files and library, and will not be compiled." + ) endif() diff --git a/CGAL_ipelets/examples/CGAL_ipelets/CMakeLists.txt b/CGAL_ipelets/examples/CGAL_ipelets/CMakeLists.txt index 325a1bbb86a..01493ecc720 100644 --- a/CGAL_ipelets/examples/CGAL_ipelets/CMakeLists.txt +++ b/CGAL_ipelets/examples/CGAL_ipelets/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( CGAL_ipelets_Examples ) +project(CGAL_ipelets_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/CMakeLists.txt b/CMakeLists.txt index 9696ca95b3d..f691f05b0e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,23 +3,27 @@ # Minimal version of CMake: cmake_minimum_required(VERSION 3.1) -message( "== CMake setup ==" ) +message("== CMake setup ==") cmake_minimum_required(VERSION 3.1...3.15) project(CGAL CXX C) export(PACKAGE CGAL) -set( CGAL_BRANCH_BUILD ON CACHE INTERNAL "Create CGAL from a Git branch" FORCE) +set(CGAL_BRANCH_BUILD + ON + CACHE INTERNAL "Create CGAL from a Git branch" FORCE) include(${CMAKE_SOURCE_DIR}/CGALConfigVersion.cmake) include(${CMAKE_SOURCE_DIR}/Installation/cmake/modules/CGAL_SCM.cmake) -CGAL_detect_git(${CMAKE_SOURCE_DIR}) +cgal_detect_git(${CMAKE_SOURCE_DIR}) function(CGAL_error_if_detect_in_source_build) # If in a Git repository, forbid in-source builds get_filename_component(srcdir "${CMAKE_SOURCE_DIR}" REALPATH) get_filename_component(bindir "${CMAKE_BINARY_DIR}" REALPATH) if("${srcdir}" STREQUAL "${bindir}") - message(FATAL_ERROR [=[ + message( + FATAL_ERROR + [=[ ############ Since CGAL-4.12.1, you can no longer configure an in-source build in a Git repository. See this StackOverlow question and answers for a way to create @@ -30,19 +34,23 @@ a separate build directory: endif() endfunction() -if ( "${CGAL_SCM_NAME}" STREQUAL "git" ) - CGAL_error_if_detect_in_source_build() +if("${CGAL_SCM_NAME}" STREQUAL "git") + cgal_error_if_detect_in_source_build() endif() # add option for duplicate file detection -option( CGAL_REPORT_DUPLICATE_FILES "Switch on to start (naive) detection of duplicate source- and headerfiles in packages" OFF) +option( + CGAL_REPORT_DUPLICATE_FILES + "Switch on to start (naive) detection of duplicate source- and headerfiles in packages" + OFF) -message( "== CMake setup (DONE) ==\n" ) +message("== CMake setup (DONE) ==\n") # Enable testing with BUILD_TESTING option(BUILD_TESTING "Build the testing tree." OFF) if(BUILD_TESTING AND NOT POLICY CMP0064) - message(FATAL_ERROR "CGAL support of CTest requires CMake version 3.4 or later. + message( + FATAL_ERROR "CGAL support of CTest requires CMake version 3.4 or later. The variable BUILD_TESTING must be set of OFF.") endif() if(BUILD_TESTING) @@ -50,16 +58,15 @@ if(BUILD_TESTING) endif() # and finally start actual build -add_subdirectory( Installation ) -add_subdirectory( Documentation/doc) +add_subdirectory(Installation) +add_subdirectory(Documentation/doc) if(NOT TARGET uninstall) configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake - IMMEDIATE @ONLY) + ${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake IMMEDIATE @ONLY) - add_custom_target(uninstall - COMMAND ${CMAKE_COMMAND} -P - ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) + add_custom_target( + uninstall COMMAND ${CMAKE_COMMAND} -P + ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake) endif() diff --git a/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt b/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt index b4bd5558546..b080e1f8277 100644 --- a/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt +++ b/Circular_kernel_2/examples/Circular_kernel_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Circular_kernel_2_Examples ) +project(Circular_kernel_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt index 3ddd02d975e..f45458884ca 100644 --- a/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt +++ b/Circular_kernel_2/test/Circular_kernel_2/CMakeLists.txt @@ -1,41 +1,31 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Circular_kernel_2_Tests ) +project(Circular_kernel_2_Tests) -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) - -include_directories (BEFORE include) +include_directories(BEFORE include) # The following `include_directories` is used in the git layout -include_directories (BEFORE ../../../Kernel_23/test/Kernel_23/include) +include_directories(BEFORE ../../../Kernel_23/test/Kernel_23/include) # The following `include_directories` is used in the layout of the # internal releases tarballs -include_directories (BEFORE ../Kernel_23/include) +include_directories(BEFORE ../Kernel_23/include) -create_single_source_cgal_program( "test_Circular_kernel.cpp" ) -create_single_source_cgal_program( "test_Lazy_circular_kernel.cpp" ) -create_single_source_cgal_program( "test_Exact_circular_kernel.cpp" ) -create_single_source_cgal_program( "test_Filtered_bbox_circular_kernel.cpp" ) -create_single_source_cgal_program( "test_Line_arc.cpp" ) -create_single_source_cgal_program( "test_Circular_kernel_basic.cpp" ) -create_single_source_cgal_program( "test_Exact_circular_kernel_basic.cpp" ) - -else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - -endif() +create_single_source_cgal_program("test_Circular_kernel.cpp") +create_single_source_cgal_program("test_Lazy_circular_kernel.cpp") +create_single_source_cgal_program("test_Exact_circular_kernel.cpp") +create_single_source_cgal_program("test_Filtered_bbox_circular_kernel.cpp") +create_single_source_cgal_program("test_Line_arc.cpp") +create_single_source_cgal_program("test_Circular_kernel_basic.cpp") +create_single_source_cgal_program("test_Exact_circular_kernel_basic.cpp") if(BUILD_TESTING) set_tests_properties( - execution___of__test_Circular_kernel_basic - execution___of__test_Exact_circular_kernel_basic + execution___of__test_Circular_kernel_basic + execution___of__test_Exact_circular_kernel_basic PROPERTIES RESOURCE_LOCK Circular_kernel_basic) endif() - diff --git a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt index 34fb62f0475..78bf951d49a 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1...3.15) -project (Circular_kernel_3_Demo) +project(Circular_kernel_3_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -10,19 +10,20 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) - add_executable (Circular_kernel_3 Circular_kernel_3.cpp Viewer.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_executable( + Circular_kernel_3 Circular_kernel_3.cpp Viewer.cpp + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Circular_kernel_3 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Circular_kernel_3) - target_link_libraries( Circular_kernel_3 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 - Qt5::OpenGL Qt5::Gui) + target_link_libraries(Circular_kernel_3 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::OpenGL Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Circular_kernel_3) @@ -32,6 +33,8 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) else() - message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." + ) endif() diff --git a/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt index 7775956fa6e..9f3bfbda1f9 100644 --- a/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/examples/Circular_kernel_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Circular_kernel_3_Examples ) +project(Circular_kernel_3_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt index 2b82b831f30..6a97d118149 100644 --- a/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/test/Circular_kernel_3/CMakeLists.txt @@ -1,35 +1,25 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Circular_kernel_3_Tests ) +project(Circular_kernel_3_Tests) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) +find_package(CGAL REQUIRED COMPONENTS Core) include(${CGAL_USE_FILE}) -include_directories (BEFORE include) +include_directories(BEFORE include) # The following `include_directories` is used in the git layout -include_directories (BEFORE ../../../Kernel_23/test/Kernel_23/include) +include_directories(BEFORE ../../../Kernel_23/test/Kernel_23/include) # The following `include_directories` is used in the layout of the # internal releases tarballs -include_directories (BEFORE ../Kernel_23/include) - -create_single_source_cgal_program( "test_Spherical_kernel.cpp" ) -create_single_source_cgal_program( "test_Spherical_kernel_basics.cpp" ) -create_single_source_cgal_program( "test_Exact_spherical_kernel.cpp" ) -create_single_source_cgal_program( "test_Lazy_Spherical_kernel.cpp" ) -create_single_source_cgal_program( "test_Lazy_spherical_kernel_basics.cpp" ) -create_single_source_cgal_program( "test_Spherical_kernel_with_core.cpp" ) - -else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE ../Kernel_23/include) +create_single_source_cgal_program("test_Spherical_kernel.cpp") +create_single_source_cgal_program("test_Spherical_kernel_basics.cpp") +create_single_source_cgal_program("test_Exact_spherical_kernel.cpp") +create_single_source_cgal_program("test_Lazy_Spherical_kernel.cpp") +create_single_source_cgal_program("test_Lazy_spherical_kernel_basics.cpp") +create_single_source_cgal_program("test_Spherical_kernel_with_core.cpp") diff --git a/Circulator/examples/Circulator/CMakeLists.txt b/Circulator/examples/Circulator/CMakeLists.txt index f99047c40de..a54a19bcbe5 100644 --- a/Circulator/examples/Circulator/CMakeLists.txt +++ b/Circulator/examples/Circulator/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Circulator_Examples ) +project(Circulator_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Circulator/test/Circulator/CMakeLists.txt b/Circulator/test/Circulator/CMakeLists.txt index b1b96ef950c..ce7db0b4f22 100644 --- a/Circulator/test/Circulator/CMakeLists.txt +++ b/Circulator/test/Circulator/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Circulator_Tests ) +project(Circulator_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Classification/examples/Classification/CMakeLists.txt b/Classification/examples/Classification/CMakeLists.txt index 55211fcf0e3..7ef809c91e1 100644 --- a/Classification/examples/Classification/CMakeLists.txt +++ b/Classification/examples/Classification/CMakeLists.txt @@ -2,99 +2,109 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Classification_Examples ) - +project(Classification_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) - message(STATUS "This project requires the Boost library, and will not be compiled.") +if(NOT Boost_FOUND) + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() set(Classification_dependencies_met TRUE) -find_package( Boost OPTIONAL_COMPONENTS serialization iostreams ) +find_package(Boost OPTIONAL_COMPONENTS serialization iostreams) include(CGAL_Boost_serialization_support) include(CGAL_Boost_iostreams_support) -if (NOT TARGET CGAL::Boost_serialization_support) - message(STATUS "NOTICE: This project requires Boost Serialization, and will not be compiled.") +if(NOT TARGET CGAL::Boost_serialization_support) + message( + STATUS + "NOTICE: This project requires Boost Serialization, and will not be compiled." + ) set(Classification_dependencies_met FALSE) endif() -if (NOT TARGET CGAL::Boost_iostreams_support) - message(STATUS "NOTICE: This project requires Boost IO Streams, and will not be compiled.") +if(NOT TARGET CGAL::Boost_iostreams_support) + message( + STATUS + "NOTICE: This project requires Boost IO Streams, and will not be compiled." + ) set(Classification_dependencies_met FALSE) endif() find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning include(CGAL_OpenCV_support) -if (NOT TARGET CGAL::OpenCV_support) - message(STATUS "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.") +if(NOT TARGET CGAL::OpenCV_support) + message( + STATUS + "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available." + ) endif() find_package(TensorFlow QUIET) include(CGAL_TensorFlow_support) -if (NOT TARGET CGAL::TensorFlow_support) - message(STATUS "NOTICE: TensorFlow was not found. TensorFlow neural network predicate for classification won't be available.") +if(NOT TARGET CGAL::TensorFlow_support) + message( + STATUS + "NOTICE: TensorFlow was not found. TensorFlow neural network predicate for classification won't be available." + ) endif() find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") set(Classification_dependencies_met FALSE) endif() find_package(TBB QUIET) include(CGAL_TBB_support) -if (NOT Classification_dependencies_met) +if(NOT Classification_dependencies_met) return() endif() -create_single_source_cgal_program( "example_classification.cpp" ) -create_single_source_cgal_program( "example_ethz_random_forest.cpp" ) -create_single_source_cgal_program( "example_feature.cpp" ) -create_single_source_cgal_program( "example_generation_and_training.cpp" ) -create_single_source_cgal_program( "example_mesh_classification.cpp" ) -create_single_source_cgal_program( "example_cluster_classification.cpp" ) -create_single_source_cgal_program( "gis_tutorial_example.cpp" ) +create_single_source_cgal_program("example_classification.cpp") +create_single_source_cgal_program("example_ethz_random_forest.cpp") +create_single_source_cgal_program("example_feature.cpp") +create_single_source_cgal_program("example_generation_and_training.cpp") +create_single_source_cgal_program("example_mesh_classification.cpp") +create_single_source_cgal_program("example_cluster_classification.cpp") +create_single_source_cgal_program("gis_tutorial_example.cpp") -if (TARGET CGAL::OpenCV_support) - create_single_source_cgal_program( "example_opencv_random_forest.cpp" ) - target_link_libraries(example_opencv_random_forest PUBLIC CGAL::OpenCV_support) +if(TARGET CGAL::OpenCV_support) + create_single_source_cgal_program("example_opencv_random_forest.cpp") + target_link_libraries(example_opencv_random_forest + PUBLIC CGAL::OpenCV_support) endif() -if (TARGET CGAL::TensorFlow_support) - create_single_source_cgal_program( "example_tensorflow_neural_network.cpp" ) - target_link_libraries(example_opencv_random_forest PUBLIC CGAL::TensorFlow_support) +if(TARGET CGAL::TensorFlow_support) + create_single_source_cgal_program("example_tensorflow_neural_network.cpp") + target_link_libraries(example_opencv_random_forest + PUBLIC CGAL::TensorFlow_support) endif() -foreach(target - example_classification - example_ethz_random_forest - example_feature - example_generation_and_training - example_mesh_classification - example_cluster_classification - example_opencv_random_forest - example_tensorflow_neural_network - gis_tutorial_example) +foreach( + target + example_classification + example_ethz_random_forest + example_feature + example_generation_and_training + example_mesh_classification + example_cluster_classification + example_opencv_random_forest + example_tensorflow_neural_network + gis_tutorial_example) if(TARGET ${target}) - target_link_libraries(${target} PUBLIC - CGAL::Eigen_support - CGAL::Boost_iostreams_support - CGAL::Boost_serialization_support) + target_link_libraries( + ${target} PUBLIC CGAL::Eigen_support CGAL::Boost_iostreams_support + CGAL::Boost_serialization_support) if(TARGET CGAL::TBB_support) target_link_libraries(${target} PUBLIC CGAL::TBB_support) endif() diff --git a/Classification/test/Classification/CMakeLists.txt b/Classification/test/Classification/CMakeLists.txt index e9ad1a332dc..629f3a46c29 100644 --- a/Classification/test/Classification/CMakeLists.txt +++ b/Classification/test/Classification/CMakeLists.txt @@ -2,62 +2,63 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Classification_Tests ) - +project(Classification_Tests) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) - message(STATUS "This project requires the Boost library, and will not be compiled.") +if(NOT Boost_FOUND) + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() set(Classification_dependencies_met TRUE) -find_package( Boost OPTIONAL_COMPONENTS serialization iostreams ) +find_package(Boost OPTIONAL_COMPONENTS serialization iostreams) include(CGAL_Boost_serialization_support) include(CGAL_Boost_iostreams_support) -if (NOT TARGET CGAL::Boost_serialization_support) - message(STATUS "NOTICE: This project requires Boost Serialization, and will not be compiled.") +if(NOT TARGET CGAL::Boost_serialization_support) + message( + STATUS + "NOTICE: This project requires Boost Serialization, and will not be compiled." + ) set(Classification_dependencies_met FALSE) endif() -if (NOT TARGET CGAL::Boost_iostreams_support) - message(STATUS "NOTICE: This project requires Boost IO Streams, and will not be compiled.") +if(NOT TARGET CGAL::Boost_iostreams_support) + message( + STATUS + "NOTICE: This project requires Boost IO Streams, and will not be compiled." + ) set(Classification_dependencies_met FALSE) endif() find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") set(Classification_dependencies_met FALSE) endif() find_package(TBB QUIET) include(CGAL_TBB_support) -if (NOT Classification_dependencies_met) +if(NOT Classification_dependencies_met) return() endif() -create_single_source_cgal_program( "test_classification_point_set.cpp" ) -create_single_source_cgal_program( "test_classification_io.cpp" ) +create_single_source_cgal_program("test_classification_point_set.cpp") +create_single_source_cgal_program("test_classification_io.cpp") foreach(target test_classification_point_set test_classification_io) - target_link_libraries(${target} PUBLIC - CGAL::Eigen_support - CGAL::Boost_iostreams_support - CGAL::Boost_serialization_support) + target_link_libraries( + ${target} PUBLIC CGAL::Eigen_support CGAL::Boost_iostreams_support + CGAL::Boost_serialization_support) if(TARGET CGAL::TBB_support) target_link_libraries(${target} PUBLIC CGAL::TBB_support) endif() diff --git a/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt index d68033221b4..9f937545e63 100644 --- a/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/examples/Combinatorial_map/CMakeLists.txt @@ -1,23 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Combinatorial_map_Examples ) +project(Combinatorial_map_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index 7374b0f2f0d..a383c413ec8 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -1,29 +1,21 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Combinatorial_map_Tests ) +project(Combinatorial_map_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - find_package( OpenMesh QUIET ) - if (TARGET OpenMesh::OpenMesh) - target_link_libraries(Combinatorial_map_copy_test PRIVATE OpenMesh::OpenMesh) - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +find_package(OpenMesh QUIET) +if(TARGET OpenMesh::OpenMesh) + target_link_libraries(Combinatorial_map_copy_test PRIVATE OpenMesh::OpenMesh) endif() - diff --git a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt index 815413763a5..aaed696fe96 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt @@ -1,28 +1,32 @@ - cmake_minimum_required(VERSION 3.1...3.15) -project( Cone_spanners_2_Examples ) +project(Cone_spanners_2_Examples) find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) include(${CGAL_USE_FILE}) find_package(LEDA QUIET) -if ( CGAL_Core_FOUND OR LEDA_FOUND ) - if (MSVC) +if(CGAL_Core_FOUND OR LEDA_FOUND) + if(MSVC) # Turn off a boost related warning that appears with VC2015 # boost_1_65_1\boost\graph\named_function_params.hpp(240) : # warning C4172: returning address of local variable or temporary - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4172") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4172") endif() # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) + file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) + create_single_source_cgal_program("${cppfile}") endforeach() else() - message(STATUS "This program requires the CGAL_Core library (or LEDA), and will not be compiled.") + message( + STATUS + "This program requires the CGAL_Core library (or LEDA), and will not be compiled." + ) endif() - diff --git a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt index 1a9a18f5016..0124e2428cd 100644 --- a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt @@ -1,26 +1,29 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Cone_spanners_2_Tests ) +project(Cone_spanners_2_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core) - -if ( CGAL_FOUND AND CGAL_Core_FOUND) +if(CGAL_Core_FOUND) include(${CGAL_USE_FILE}) - include_directories (BEFORE "include") + include_directories(BEFORE "include") # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) + file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) + create_single_source_cgal_program("${cppfile}") endforeach() else() - message(STATUS "This program requires the CGAL and CGAL_Core libraries, and will not be compiled.") + message( + STATUS + "This program requires the CGAL and CGAL_Core libraries, and will not be compiled." + ) endif() - diff --git a/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt b/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt index dc8fef89e67..fcbac0c3a84 100644 --- a/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt +++ b/Convex_decomposition_3/examples/Convex_decomposition_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Convex_decomposition_3_Examples ) +project(Convex_decomposition_3_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt b/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt index 37a42b63d99..da4b802fc6e 100644 --- a/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt +++ b/Convex_decomposition_3/test/Convex_decomposition_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Convex_decomposition_3_Tests ) +project(Convex_decomposition_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt b/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt index 3d684e4936f..a86c9a51adb 100644 --- a/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt +++ b/Convex_hull_2/examples/Convex_hull_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Convex_hull_2_Examples ) +project(Convex_hull_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt b/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt index e01d7752465..3484466aad8 100644 --- a/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt +++ b/Convex_hull_2/test/Convex_hull_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Convex_hull_2_Tests ) +project(Convex_hull_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt index 1d16843273b..35abe35f97b 100644 --- a/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/demo/Convex_hull_3/CMakeLists.txt @@ -1,9 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Convex_hull_3_Demo ) +project(Convex_hull_3_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,15 +11,6 @@ endif() set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "quickhull_3_demo.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +find_package(CGAL REQUIRED) +create_single_source_cgal_program("quickhull_3_demo.cpp") diff --git a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt index cb303aca822..2d9d4e89846 100644 --- a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt @@ -2,35 +2,27 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Convex_hull_3_Examples ) - - +project(Convex_hull_3_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() -find_package( OpenMesh QUIET ) +find_package(OpenMesh QUIET) -if ( OpenMesh_FOUND ) - include( UseOpenMesh ) +if(OpenMesh_FOUND) + include(UseOpenMesh) else() message(STATUS "Examples that use OpenMesh will not be compiled.") endif() @@ -42,32 +34,30 @@ endif() # Creating entries for all C++ files with "main" routine # ########################################################## -create_single_source_cgal_program( "dynamic_hull_3.cpp" ) +create_single_source_cgal_program("dynamic_hull_3.cpp") -create_single_source_cgal_program( "dynamic_hull_LCC_3.cpp" ) +create_single_source_cgal_program("dynamic_hull_LCC_3.cpp") -create_single_source_cgal_program( "dynamic_hull_SM_3.cpp" ) +create_single_source_cgal_program("dynamic_hull_SM_3.cpp") -create_single_source_cgal_program( "halfspace_intersection_3.cpp" ) +create_single_source_cgal_program("halfspace_intersection_3.cpp") -create_single_source_cgal_program( "lloyd_algorithm.cpp" ) +create_single_source_cgal_program("lloyd_algorithm.cpp") -create_single_source_cgal_program( "quickhull_3.cpp" ) +create_single_source_cgal_program("quickhull_3.cpp") -create_single_source_cgal_program( "graph_hull_3.cpp" ) +create_single_source_cgal_program("graph_hull_3.cpp") +create_single_source_cgal_program("quickhull_any_dim_3.cpp") -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" ) +create_single_source_cgal_program("extreme_points_3_sm.cpp") +create_single_source_cgal_program("extreme_indices_3.cpp") if(OpenMesh_FOUND) - create_single_source_cgal_program( "quickhull_OM_3.cpp" ) - create_single_source_cgal_program( "dynamic_hull_OM_3.cpp" ) + create_single_source_cgal_program("quickhull_OM_3.cpp") + create_single_source_cgal_program("dynamic_hull_OM_3.cpp") - target_link_libraries( quickhull_OM_3 PRIVATE ${OPENMESH_LIBRARIES} ) - target_link_libraries( dynamic_hull_OM_3 PRIVATE ${OPENMESH_LIBRARIES} ) + target_link_libraries(quickhull_OM_3 PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(dynamic_hull_OM_3 PRIVATE ${OPENMESH_LIBRARIES}) endif() diff --git a/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt index 5d47ddea8c9..8905d4b23a4 100644 --- a/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/test/Convex_hull_3/CMakeLists.txt @@ -1,34 +1,26 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Convex_hull_3_Tests ) +project(Convex_hull_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - find_package( OpenMesh QUIET ) - - if ( OpenMesh_FOUND ) - include( UseOpenMesh ) - else() - message(STATUS "Examples that use OpenMesh will not be compiled.") - endif() - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() +find_package(OpenMesh QUIET) +if(OpenMesh_FOUND) + include(UseOpenMesh) else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message(STATUS "Examples that use OpenMesh will not be compiled.") endif() +include_directories(BEFORE "include") + +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt b/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt index 4dec3533384..e79db22529a 100644 --- a/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt +++ b/Convex_hull_d/test/Convex_hull_d/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Convex_hull_d_Tests ) +project(Convex_hull_d_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Distance_2/test/Distance_2/CMakeLists.txt b/Distance_2/test/Distance_2/CMakeLists.txt index 9cb2b6ce6f2..f9487bd5924 100644 --- a/Distance_2/test/Distance_2/CMakeLists.txt +++ b/Distance_2/test/Distance_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Distance_2_Tests ) +project(Distance_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Distance_3/test/Distance_3/CMakeLists.txt b/Distance_3/test/Distance_3/CMakeLists.txt index 93ffb8cc1b5..c4c2673a122 100644 --- a/Distance_3/test/Distance_3/CMakeLists.txt +++ b/Distance_3/test/Distance_3/CMakeLists.txt @@ -1,31 +1,23 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Distance_3_Tests ) +project(Distance_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - if (MSVC) - # Turn off a VC++ warning on a potential division by zero - # in Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h - # where CGAL_assume() does not help - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4723") - endif() - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - +if(MSVC) + # Turn off a VC++ warning on a potential division by zero + # in Cartesian_kernel/include/CGAL/constructions/kernel_ftC3.h + # where CGAL_assume() does not help + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4723") endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Documentation/doc/CMakeLists.txt b/Documentation/doc/CMakeLists.txt index 9c1695ca28e..30b5cb87538 100644 --- a/Documentation/doc/CMakeLists.txt +++ b/Documentation/doc/CMakeLists.txt @@ -4,13 +4,15 @@ project(Documentation NONE) # Minimal version of CMake: # Check whether this cmake script is the top level one -if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) +if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_SOURCE_DIR}) # decide if this is a branch build - if ( NOT EXISTS "${CMAKE_SOURCE_DIR}/../VERSION") - set(CGAL_BRANCH_BUILD ON CACHE INTERNAL "CGAL Branch build") + if(NOT EXISTS "${CMAKE_SOURCE_DIR}/../VERSION") + set(CGAL_BRANCH_BUILD + ON + CACHE INTERNAL "CGAL Branch build") endif() - if (CGAL_BRANCH_BUILD) + if(CGAL_BRANCH_BUILD) set(CGAL_ROOT "${CMAKE_SOURCE_DIR}/../..") else() set(CGAL_ROOT "${CMAKE_SOURCE_DIR}/..") @@ -34,14 +36,20 @@ endif() #starting from cmake 3.9 the usage of DOXYGEN_EXECUTABLE is deprecated if(TARGET Doxygen::doxygen) - get_property(DOXYGEN_EXECUTABLE TARGET Doxygen::doxygen PROPERTY IMPORTED_LOCATION) + get_property( + DOXYGEN_EXECUTABLE + TARGET Doxygen::doxygen + PROPERTY IMPORTED_LOCATION) endif() # Visual Studio users might appreciate this # set_property(GLOBAL PROPERTY USE_FOLDERS ON) macro(subdirlist result curdir) - file(GLOB children RELATIVE ${curdir} ${curdir}/*) + file( + GLOB children + RELATIVE ${curdir} + ${curdir}/*) set(dirlist "") foreach(child ${children}) if(IS_DIRECTORY ${curdir}/${child}) @@ -65,14 +73,18 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME) return() endif() - set(CGAL_DOC_PACKAGE_DEFAULTS ${CGAL_DOC_DXY_DIR}/${CGAL_PACKAGE_NAME}_defaults.dxy) + set(CGAL_DOC_PACKAGE_DEFAULTS + ${CGAL_DOC_DXY_DIR}/${CGAL_PACKAGE_NAME}_defaults.dxy) file(REMOVE ${CGAL_DOC_PACKAGE_DEFAULTS}) - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "@INCLUDE = ${CGAL_DOC_DOXY_DEFAULT}\n") - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "OUTPUT_DIRECTORY = ${CGAL_DOC_OUTPUT_DIR}/${CGAL_PACKAGE_NAME}\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "@INCLUDE = ${CGAL_DOC_DOXY_DEFAULT}\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "OUTPUT_DIRECTORY = ${CGAL_DOC_OUTPUT_DIR}/${CGAL_PACKAGE_NAME}\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "HTML_OUTPUT = .\n") if(CGAL_DOC_CREATE_LOGS) - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "WARN_LOGFILE = ${CGAL_DOC_LOG_DIR}/${CGAL_PACKAGE_NAME}.log\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "WARN_LOGFILE = ${CGAL_DOC_LOG_DIR}/${CGAL_PACKAGE_NAME}.log\n") endif() if(CGAL_DOC_RELEASE) @@ -81,29 +93,40 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME) endif() if(EXISTS "${CGAL_PACKAGE_DIR}/examples") - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "EXAMPLE_PATH = ${CGAL_PACKAGE_DIR}/examples\n") endif() if(CGAL_GENERATE_XML) file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "GENERATE_XML = YES\n") endif() - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "GENERATE_TAGFILE = ${CGAL_DOC_TAG_GEN_DIR}/${CGAL_PACKAGE_NAME}.tag\n") - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_PATH = ${CGAL_PACKAGE_DOC_DIR}/\n") - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_PATH += ${CGAL_PACKAGE_DIR}/include/\n") - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_INC_PATH = ${CGAL_PACKAGE_DOC_DIR}/\n") - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_INC_PATH += ${CGAL_PACKAGE_DIR}/include/\n") - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "ALIASES += \"cgalPkgDescriptionBegin{2}=\\details \"\n") - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "ALIASES += \"cgalPkgManuals{2}=
\"\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "GENERATE_TAGFILE = ${CGAL_DOC_TAG_GEN_DIR}/${CGAL_PACKAGE_NAME}.tag\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "STRIP_FROM_PATH = ${CGAL_PACKAGE_DOC_DIR}/\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "STRIP_FROM_PATH += ${CGAL_PACKAGE_DIR}/include/\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "STRIP_FROM_INC_PATH = ${CGAL_PACKAGE_DOC_DIR}/\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "STRIP_FROM_INC_PATH += ${CGAL_PACKAGE_DIR}/include/\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "ALIASES += \"cgalPkgDescriptionBegin{2}=\\details \"\n") + file( + APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "ALIASES += \"cgalPkgManuals{2}=
\"\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "INPUT = ${CGAL_PACKAGE_DOC_DIR}\n") if(NOT EXISTS "${CGAL_PACKAGE_DOC_DIR}/CGAL") # This package has in-source documentation. if(CGAL_BRANCH_BUILD) # use the entire include subdir - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "INPUT += ${CGAL_PACKAGE_DIR}/include/\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "INPUT += ${CGAL_PACKAGE_DIR}/include/\n") else() # use the filelist if(EXISTS "${CGAL_PACKAGE_DOC_DIR}/filelist.txt") file(STRINGS "${CGAL_PACKAGE_DOC_DIR}/filelist.txt" CGAL_PKG_FILES) foreach(pkg_file ${CGAL_PKG_FILES}) - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "INPUT += ${CGAL_PACKAGE_DIR}/include/${pkg_file}\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} + "INPUT += ${CGAL_PACKAGE_DIR}/include/${pkg_file}\n") endforeach() endif() endif() @@ -113,7 +136,7 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME) set(IMAGE_PATHS "${CGAL_PACKAGE_DOC_DIR}/fig") set(DEPENDENCIES "") # figure out the dependencies, using the file `dependencies` or `packages.txt` for Documentation - if (${CGAL_PACKAGE_NAME} STREQUAL "Documentation") + if(${CGAL_PACKAGE_NAME} STREQUAL "Documentation") set(PackageFile ${CGAL_PACKAGE_DOC_DIR}/packages.txt) file(STRINGS ${PackageFile} EntriesAsList REGEX "^\\\\package_listing{.+}$") foreach(Line ${EntriesAsList}) @@ -121,9 +144,9 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME) list(APPEND DEPENDENCIES ${PKG}) if(CGAL_BRANCH_BUILD) - SET(IMG_DIR "${CGAL_ROOT}/${PKG}/doc/${PKG}/fig") + set(IMG_DIR "${CGAL_ROOT}/${PKG}/doc/${PKG}/fig") else() - SET(IMG_DIR "${CGAL_ROOT}/doc/${PKG}/fig") + set(IMG_DIR "${CGAL_ROOT}/doc/${PKG}/fig") endif() if(EXISTS ${IMG_DIR}) @@ -138,43 +161,44 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME) foreach(depend ${DEPENDENCIES}) file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} - "TAGFILES += ${CGAL_DOC_TAG_DIR}/${depend}.tag=../${depend}\n") + "TAGFILES += ${CGAL_DOC_TAG_DIR}/${depend}.tag=../${depend}\n") endforeach() foreach(image_path ${IMAGE_PATHS}) - file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} - "IMAGE_PATH += ${image_path}\n") + file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "IMAGE_PATH += ${image_path}\n") endforeach() - configure_file(${CGAL_PACKAGE_DOC_DIR}/Doxyfile.in ${CGAL_DOC_DXY_DIR}/${CGAL_PACKAGE_NAME}.dxy) + configure_file(${CGAL_PACKAGE_DOC_DIR}/Doxyfile.in + ${CGAL_DOC_DXY_DIR}/${CGAL_PACKAGE_NAME}.dxy) # TODO we also want to run html_post_process per package as a custom_command with POST_BUILD # target that build the doc and put the tag file in the generation directory CGAL_DOC_TAG_GEN_DIR - add_custom_target(${CGAL_PACKAGE_NAME}_internal_doxygen_run + add_custom_target( + ${CGAL_PACKAGE_NAME}_internal_doxygen_run ${DOXYGEN_EXECUTABLE} ${CGAL_DOC_DXY_DIR}/${CGAL_PACKAGE_NAME}.dxy) - set_target_properties(${CGAL_PACKAGE_NAME}_internal_doxygen_run PROPERTIES FOLDER Documentation/Packages) + set_target_properties(${CGAL_PACKAGE_NAME}_internal_doxygen_run + PROPERTIES FOLDER Documentation/Packages) #target moving the tag file into the read directory CGAL_DOC_TAG_DIR - if ( "${CGAL_PACKAGE_NAME}" STREQUAL "Documentation" ) + if("${CGAL_PACKAGE_NAME}" STREQUAL "Documentation") set(CGAL_PACKAGE_TAGFILE "Manual.tag") else() set(CGAL_PACKAGE_TAGFILE "${CGAL_PACKAGE_NAME}.tag") endif() - add_custom_target(${CGAL_PACKAGE_NAME}_copy_doc_tags - ${CMAKE_COMMAND} -E copy - "${CGAL_DOC_TAG_GEN_DIR}/${CGAL_PACKAGE_TAGFILE}" - "${CGAL_DOC_TAG_DIR}/${CGAL_PACKAGE_TAGFILE}" - ) + add_custom_target( + ${CGAL_PACKAGE_NAME}_copy_doc_tags + ${CMAKE_COMMAND} -E copy "${CGAL_DOC_TAG_GEN_DIR}/${CGAL_PACKAGE_TAGFILE}" + "${CGAL_DOC_TAG_DIR}/${CGAL_PACKAGE_TAGFILE}") #add the doc target doing both the doc generation and then the tag file copy - add_custom_target(${CGAL_PACKAGE_NAME}_doc + add_custom_target( + ${CGAL_PACKAGE_NAME}_doc ${DOXYGEN_EXECUTABLE} ${CGAL_DOC_DXY_DIR}/${CGAL_PACKAGE_NAME}.dxy COMMAND - ${CMAKE_COMMAND} -E copy - "${CGAL_DOC_TAG_GEN_DIR}/${CGAL_PACKAGE_TAGFILE}" - "${CGAL_DOC_TAG_DIR}/${CGAL_PACKAGE_TAGFILE}" - ) + ${CMAKE_COMMAND} -E copy + "${CGAL_DOC_TAG_GEN_DIR}/${CGAL_PACKAGE_TAGFILE}" + "${CGAL_DOC_TAG_DIR}/${CGAL_PACKAGE_TAGFILE}") # ${depend}_doc) # don't do this for now @@ -185,29 +209,37 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME) endfunction() # set up the directories and variables -if (CGAL_DOC_MATHJAX_LOCATION) - set(CGAL_DOC_MATHJAX_LOCATION_FULL_OPTION_LINE "MATHJAX_RELPATH = ${CGAL_DOC_MATHJAX_LOCATION}") +if(CGAL_DOC_MATHJAX_LOCATION) + set(CGAL_DOC_MATHJAX_LOCATION_FULL_OPTION_LINE + "MATHJAX_RELPATH = ${CGAL_DOC_MATHJAX_LOCATION}") else() - set(CGAL_DOC_MATHJAX_LOCATION "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2") + set(CGAL_DOC_MATHJAX_LOCATION + "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2") endif() set(CGAL_DOC_OUTPUT_DIR "${CMAKE_BINARY_DIR}/doc_output") file(MAKE_DIRECTORY "${CGAL_DOC_OUTPUT_DIR}") -option(CGAL_DOC_CREATE_LOGS "Write log files or print warnings and errors to cerr when building the doc." OFF) +option( + CGAL_DOC_CREATE_LOGS + "Write log files or print warnings and errors to cerr when building the doc." + OFF) if(CGAL_DOC_CREATE_LOGS) set(CGAL_DOC_LOG_DIR "${CMAKE_BINARY_DIR}/doc_log") file(MAKE_DIRECTORY "${CGAL_DOC_LOG_DIR}") endif() -option(CGAL_EXTRACT_ALL_NO_DETAILED_IF_EMPTY "Use CGAL special doxygen setting EXTRACT_ALL_NO_DETAILED_IF_EMPTY." ON) +option(CGAL_EXTRACT_ALL_NO_DETAILED_IF_EMPTY + "Use CGAL special doxygen setting EXTRACT_ALL_NO_DETAILED_IF_EMPTY." ON) if(CGAL_EXTRACT_ALL_NO_DETAILED_IF_EMPTY) - set(CGAL_OPT_EXTRACT_ALL_NO_DETAILED_IF_EMPTY "EXTRACT_ALL_NO_DETAILED_IF_EMPTY = YES") + set(CGAL_OPT_EXTRACT_ALL_NO_DETAILED_IF_EMPTY + "EXTRACT_ALL_NO_DETAILED_IF_EMPTY = YES") else() # The default is NO, so we could leave it out, but it is better to have a commented out placeholder # this will work for versions with and without the setting. - set(CGAL_OPT_EXTRACT_ALL_NO_DETAILED_IF_EMPTY "#EXTRACT_ALL_NO_DETAILED_IF_EMPTY = NO") + set(CGAL_OPT_EXTRACT_ALL_NO_DETAILED_IF_EMPTY + "#EXTRACT_ALL_NO_DETAILED_IF_EMPTY = NO") endif() #we use two directories for the generation/reading of tag files to prevent issues @@ -224,8 +256,9 @@ set(CGAL_DOC_RESOURCE_DIR_DEFAULT "${CMAKE_CURRENT_LIST_DIR}/resources/1.8.14") # first look if resources for the specific doxygen version is available, fallback # on the default otherwise -if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/resources/${DOXYGEN_VERSION}") - set(CGAL_DOC_RESOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/resources/${DOXYGEN_VERSION}") +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/resources/${DOXYGEN_VERSION}") + set(CGAL_DOC_RESOURCE_DIR + "${CMAKE_CURRENT_LIST_DIR}/resources/${DOXYGEN_VERSION}") else() set(CGAL_DOC_RESOURCE_DIR "${CGAL_DOC_RESOURCE_DIR_DEFAULT}") endif() @@ -236,7 +269,8 @@ set(CGAL_DOC_SCRIPT_DIR "${CMAKE_CURRENT_LIST_DIR}/scripts") set(CGAL_DOC_HEADER ${CGAL_DOC_DXY_DIR}/header.html) configure_file(${CGAL_DOC_RESOURCE_DIR}/header.html ${CGAL_DOC_HEADER} @ONLY) set(CGAL_DOC_HEADER_PACKAGE ${CGAL_DOC_DXY_DIR}/header_package.html) -configure_file(${CGAL_DOC_RESOURCE_DIR}/header_package.html ${CGAL_DOC_HEADER_PACKAGE} @ONLY) +configure_file(${CGAL_DOC_RESOURCE_DIR}/header_package.html + ${CGAL_DOC_HEADER_PACKAGE} @ONLY) #Generate the bibtex file #this is needed also for BaseDoxyfile.in @@ -250,24 +284,29 @@ else() set(CGAL_RELEASE_YEAR_ID "${CGAL_BUILD_YEAR2}a") endif() -if (NOT CGAL_CREATED_VERSION_NUM) - if (CGAL_BRANCH_BUILD) +if(NOT CGAL_CREATED_VERSION_NUM) + if(CGAL_BRANCH_BUILD) include(${CGAL_ROOT}/CGALConfigVersion.cmake) - if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) - set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") + if(CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) + set(CGAL_CREATED_VERSION_NUM + "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") else() - set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}") + set(CGAL_CREATED_VERSION_NUM + "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}") endif() else() if(EXISTS "${CGAL_ROOT}/doc/public_release_name") file(STRINGS "${CGAL_ROOT}/doc/public_release_name" CGAL_VERSION_LINE) - string(REGEX REPLACE "CGAL-" "" CGAL_CREATED_VERSION_NUM "${CGAL_VERSION_LINE}") + string(REGEX REPLACE "CGAL-" "" CGAL_CREATED_VERSION_NUM + "${CGAL_VERSION_LINE}") else() #read version.h and get the line with CGAL_VERSION - file(STRINGS "${CGAL_ROOT}/include/CGAL/version.h" CGAL_VERSION_LINE REGEX "CGAL_VERSION ") + file(STRINGS "${CGAL_ROOT}/include/CGAL/version.h" CGAL_VERSION_LINE + REGEX "CGAL_VERSION ") #extract release id - string(REGEX MATCH "[0-9]+\\.[0-9]+\\.?[0-9]*" CGAL_CREATED_VERSION_NUM "${CGAL_VERSION_LINE}") + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.?[0-9]*" CGAL_CREATED_VERSION_NUM + "${CGAL_VERSION_LINE}") endif() endif() endif() @@ -279,39 +318,47 @@ set(CGAL_DOC_VERSION ${CGAL_CREATED_VERSION_NUM}) ## generate how_to_cite files if(PYTHONINTERP_FOUND) - execute_process(COMMAND ${PYTHON_EXECUTABLE} - ${CGAL_DOC_SCRIPT_DIR}/generate_how_to_cite.py - ${CGAL_ROOT} - ${CMAKE_BINARY_DIR} - "${CGAL_BRANCH_BUILD}" - RESULT_VARIABLE GENERATE_HOW_TO_CITE_RESULT) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/generate_how_to_cite.py + ${CGAL_ROOT} ${CMAKE_BINARY_DIR} "${CGAL_BRANCH_BUILD}" + RESULT_VARIABLE GENERATE_HOW_TO_CITE_RESULT) if(NOT GENERATE_HOW_TO_CITE_RESULT EQUAL "0") message(FATAL_ERROR "generate_how_to_cite did not exit correctly") endif() - configure_file(${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib.in ${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib) - configure_file(${CMAKE_BINARY_DIR}/how_to_cite_cgal.txt.in ${CMAKE_BINARY_DIR}/how_to_cite_cgal.txt) - configure_file(${CMAKE_BINARY_DIR}/how_to_cite.html.in ${CMAKE_BINARY_DIR}/how_to_cite.html) + configure_file(${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib.in + ${CMAKE_BINARY_DIR}/how_to_cite_cgal.bib) + configure_file(${CMAKE_BINARY_DIR}/how_to_cite_cgal.txt.in + ${CMAKE_BINARY_DIR}/how_to_cite_cgal.txt) + configure_file(${CMAKE_BINARY_DIR}/how_to_cite.html.in + ${CMAKE_BINARY_DIR}/how_to_cite.html) endif() -configure_file(${CGAL_DOC_RESOURCE_DIR}/BaseDoxyfile.in ${CGAL_DOC_DXY_DIR}/BaseDoxyfile) +configure_file(${CGAL_DOC_RESOURCE_DIR}/BaseDoxyfile.in + ${CGAL_DOC_DXY_DIR}/BaseDoxyfile) set(CGAL_DOC_DOXY_DEFAULT "${CGAL_DOC_DXY_DIR}/BaseDoxyfile") # pkglist_filter gets the path to the pkglist_filter of this source # directory. if(WIN32) - configure_file(${CGAL_DOC_SCRIPT_DIR}/pkglist_filter.bat ${CMAKE_BINARY_DIR}/pkglist_filter.bat) + configure_file(${CGAL_DOC_SCRIPT_DIR}/pkglist_filter.bat + ${CMAKE_BINARY_DIR}/pkglist_filter.bat) endif() -configure_file(${CGAL_DOC_SCRIPT_DIR}/pkglist_filter ${CMAKE_BINARY_DIR}/pkglist_filter) -configure_file(${CGAL_DOC_SCRIPT_DIR}/pkglist_filter.py ${CMAKE_BINARY_DIR}/pkglist_filter.py) +configure_file(${CGAL_DOC_SCRIPT_DIR}/pkglist_filter + ${CMAKE_BINARY_DIR}/pkglist_filter) +configure_file(${CGAL_DOC_SCRIPT_DIR}/pkglist_filter.py + ${CMAKE_BINARY_DIR}/pkglist_filter.py) set(CGAL_DOC_PACKAGES "") if(CGAL_BRANCH_BUILD) - file(GLOB CGAL_ALL_PACKAGES RELATIVE ${CGAL_ROOT} "${CGAL_ROOT}/*") - foreach (pkg ${CGAL_ALL_PACKAGES}) + file( + GLOB CGAL_ALL_PACKAGES + RELATIVE ${CGAL_ROOT} + "${CGAL_ROOT}/*") + foreach(pkg ${CGAL_ALL_PACKAGES}) #detect packages with documentation to process - if (IS_DIRECTORY ${CGAL_ROOT}/${pkg}) + if(IS_DIRECTORY ${CGAL_ROOT}/${pkg}) if(EXISTS "${CGAL_ROOT}/${pkg}/doc/${pkg}/PackageDescription.txt") list(APPEND CGAL_DOC_PACKAGES ${pkg}) endif() @@ -338,7 +385,8 @@ else() subdirlist(CGAL_EXAMPLE_PACKAGES ${CGAL_ROOT}/examples) subdirlist(CGAL_DEMO_PACKAGES ${CGAL_ROOT}/demo) - list(APPEND CGAL_EXAMPLE_PACKAGES "BGL") # manually add BGL to the list of packages + list(APPEND CGAL_EXAMPLE_PACKAGES "BGL" + )# manually add BGL to the list of packages foreach(pkg ${CGAL_EXAMPLE_PACKAGES}) set(CGAL_${pkg}_EXAMPLE_DIR "${CGAL_ROOT}/examples") # This might not be entirely correct, but there is no reliable, @@ -353,7 +401,7 @@ endif() option(CGAL_BUILD_THREE_DOC "Build the documentation of the Three package" OFF) -if (NOT CGAL_BUILD_THREE_DOC) +if(NOT CGAL_BUILD_THREE_DOC) list(REMOVE_ITEM CGAL_DOC_PACKAGES "Three") endif() @@ -386,25 +434,47 @@ add_dependencies(doc doc_post) if(PYTHONINTERP_FOUND) set(CGAL_DOC_TESTSUITE_SCRIPT "${CGAL_DOC_SCRIPT_DIR}/testsuite.py") - add_custom_target(doc_with_postprocessing - ${PYTHON_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/html_output_post_processing.py --output ${CGAL_DOC_OUTPUT_DIR} --resources ${CGAL_DOC_RESOURCE_DIR} - ) + add_custom_target( + doc_with_postprocessing + ${PYTHON_EXECUTABLE} ${CGAL_DOC_SCRIPT_DIR}/html_output_post_processing.py + --output ${CGAL_DOC_OUTPUT_DIR} --resources ${CGAL_DOC_RESOURCE_DIR}) add_dependencies(doc_with_postprocessing doc) if(CGAL_DOC_CREATE_LOGS) - add_custom_target(Documentation_test - ${PYTHON_EXECUTABLE} ${CGAL_DOC_TESTSUITE_SCRIPT} --output-dir ${CGAL_DOC_OUTPUT_DIR} --doc-log-dir ${CGAL_DOC_LOG_DIR} - ) + add_custom_target( + Documentation_test + ${PYTHON_EXECUTABLE} ${CGAL_DOC_TESTSUITE_SCRIPT} --output-dir + ${CGAL_DOC_OUTPUT_DIR} --doc-log-dir ${CGAL_DOC_LOG_DIR}) add_dependencies(Documentation_test doc) - add_custom_target(Documentation_test_publish - ${PYTHON_EXECUTABLE} ${CGAL_DOC_TESTSUITE_SCRIPT} --output-dir ${CGAL_DOC_OUTPUT_DIR} --doc-log-dir ${CGAL_DOC_LOG_DIR} --publish ${CGAL_DOC_PUBLISH_DIR} --do-copy-results - ) + add_custom_target( + Documentation_test_publish + ${PYTHON_EXECUTABLE} + ${CGAL_DOC_TESTSUITE_SCRIPT} + --output-dir + ${CGAL_DOC_OUTPUT_DIR} + --doc-log-dir + ${CGAL_DOC_LOG_DIR} + --publish + ${CGAL_DOC_PUBLISH_DIR} + --do-copy-results) add_dependencies(Documentation_test_publish doc) - add_custom_target(doc_and_publish_testsuite - ${PYTHON_EXECUTABLE} ${CGAL_DOC_TESTSUITE_SCRIPT} --output-dir ${CGAL_DOC_OUTPUT_DIR} --doc-log-dir ${CGAL_DOC_LOG_DIR} --publish ${CGAL_DOC_PUBLISH_DIR} --do-copy-results --cgal-version "${CGAL_FULL_VERSION}" --version-to-keep 10 - ) + add_custom_target( + doc_and_publish_testsuite + ${PYTHON_EXECUTABLE} + ${CGAL_DOC_TESTSUITE_SCRIPT} + --output-dir + ${CGAL_DOC_OUTPUT_DIR} + --doc-log-dir + ${CGAL_DOC_LOG_DIR} + --publish + ${CGAL_DOC_PUBLISH_DIR} + --do-copy-results + --cgal-version + "${CGAL_FULL_VERSION}" + --version-to-keep + 10) add_dependencies(doc_and_publish_testsuite doc_with_postprocessing) endif() diff --git a/Envelope_2/examples/Envelope_2/CMakeLists.txt b/Envelope_2/examples/Envelope_2/CMakeLists.txt index d900fffe320..407f1b440ad 100644 --- a/Envelope_2/examples/Envelope_2/CMakeLists.txt +++ b/Envelope_2/examples/Envelope_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Envelope_2_Examples ) +project(Envelope_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Envelope_2/test/Envelope_2/CMakeLists.txt b/Envelope_2/test/Envelope_2/CMakeLists.txt index b8dec2e6a07..faf49408d71 100644 --- a/Envelope_2/test/Envelope_2/CMakeLists.txt +++ b/Envelope_2/test/Envelope_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Envelope_2_Tests ) +project(Envelope_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Envelope_3/examples/Envelope_3/CMakeLists.txt b/Envelope_3/examples/Envelope_3/CMakeLists.txt index cbefde5a33f..79b0bb7086e 100644 --- a/Envelope_3/examples/Envelope_3/CMakeLists.txt +++ b/Envelope_3/examples/Envelope_3/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Envelope_3_Examples ) +project(Envelope_3_Examples) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Envelope_3/test/Envelope_3/CMakeLists.txt b/Envelope_3/test/Envelope_3/CMakeLists.txt index 11548e73a37..8ca30e7ab46 100644 --- a/Envelope_3/test/Envelope_3/CMakeLists.txt +++ b/Envelope_3/test/Envelope_3/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Envelope_3_Tests ) +project(Envelope_3_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt index 26ec7d67e90..9cf5c2424d1 100644 --- a/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/benchmark/Filtered_kernel/CMakeLists.txt @@ -1,35 +1,28 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Filtered_kernel_test ) - - +project(Filtered_kernel_test) add_executable(bench_simple_comparisons bench_simple_comparisons.cpp) -find_package(CGAL QUIET COMPONENTS Core ) +find_package(CGAL REQUIRED COMPONENTS Core) -if ( CGAL_FOUND ) +include(${CGAL_USE_FILE}) - include(${CGAL_USE_FILE}) +add_executable(bench_orientation_3 "orientation_3.cpp") +target_link_libraries(bench_orientation_3 ${CGAL_LIBRARIES} + ${CGAL_3RD_PARTY_LIBRARIES}) - add_executable( bench_orientation_3 "orientation_3.cpp" ) - target_link_libraries(bench_orientation_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) - - add_executable( bench_comparisons "orientation_3.cpp" ) - target_link_libraries(bench_comparisons ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) - set_property( - TARGET bench_comparisons - APPEND - PROPERTY COMPILE_DEFINITIONS ONLY_TEST_COMPARISONS ) - - get_property(DEF TARGET bench_comparisons PROPERTY COMPILE_DEFINITIONS) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +add_executable(bench_comparisons "orientation_3.cpp") +target_link_libraries(bench_comparisons ${CGAL_LIBRARIES} + ${CGAL_3RD_PARTY_LIBRARIES}) +set_property( + TARGET bench_comparisons + APPEND + PROPERTY COMPILE_DEFINITIONS ONLY_TEST_COMPARISONS) +get_property( + DEF + TARGET bench_comparisons + PROPERTY COMPILE_DEFINITIONS) diff --git a/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt index c0d9a98a6b3..31cdbe980f7 100644 --- a/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/examples/Filtered_kernel/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Filtered_kernel_Examples ) +project(Filtered_kernel_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt b/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt index de9c1d0eea4..085445b495e 100644 --- a/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt +++ b/Filtered_kernel/test/Filtered_kernel/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Filtered_kernel_Tests ) +project(Filtered_kernel_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Generalized_map/examples/Generalized_map/CMakeLists.txt b/Generalized_map/examples/Generalized_map/CMakeLists.txt index 96e14762a6f..ea667c7801e 100644 --- a/Generalized_map/examples/Generalized_map/CMakeLists.txt +++ b/Generalized_map/examples/Generalized_map/CMakeLists.txt @@ -1,23 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Generalized_map_Examples ) +project(Generalized_map_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Generalized_map/test/Generalized_map/CMakeLists.txt b/Generalized_map/test/Generalized_map/CMakeLists.txt index 50b11feb419..502fe5b3eb8 100644 --- a/Generalized_map/test/Generalized_map/CMakeLists.txt +++ b/Generalized_map/test/Generalized_map/CMakeLists.txt @@ -2,26 +2,18 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Generalized_map_Tests ) - - +project(Generalized_map_Tests) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -34,6 +26,4 @@ endif() # Creating entries for all C++ files with "main" routine # ########################################################## -create_single_source_cgal_program( "Generalized_map_test.cpp" ) - - +create_single_source_cgal_program("Generalized_map_test.cpp") diff --git a/Generator/benchmark/Generator/CMakeLists.txt b/Generator/benchmark/Generator/CMakeLists.txt index ce4da669dd7..f696bf06c17 100644 --- a/Generator/benchmark/Generator/CMakeLists.txt +++ b/Generator/benchmark/Generator/CMakeLists.txt @@ -1,29 +1,17 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Generator_example ) +project(Generator_example) +find_package(CGAL REQUIRED COMPONENTS Core) +include(${CGAL_USE_FILE}) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - find_package(Boost REQUIRED program_options) - include_directories(${Boost_PROGRAM_OPTIONS_INCLUDE_DIR}) - add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" ) - list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) - - create_single_source_cgal_program( "random_grid.cpp" ) - create_single_source_cgal_program( "random_disc_2.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +find_package(Boost REQUIRED program_options) +include_directories(${Boost_PROGRAM_OPTIONS_INCLUDE_DIR}) +add_definitions("-DCGAL_USE_BOOST_PROGRAM_OPTIONS") +list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) +create_single_source_cgal_program("random_grid.cpp") +create_single_source_cgal_program("random_disc_2.cpp") diff --git a/Generator/examples/Generator/CMakeLists.txt b/Generator/examples/Generator/CMakeLists.txt index fa8efe5d09a..72149414f76 100644 --- a/Generator/examples/Generator/CMakeLists.txt +++ b/Generator/examples/Generator/CMakeLists.txt @@ -1,35 +1,28 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Generator_Examples ) +project(Generator_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +# Use Eigen +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) +include(CGAL_Eigen_support) -if ( CGAL_FOUND ) - - # Use Eigen - find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) - include(CGAL_Eigen_support) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - if(NOT (${cppfile} STREQUAL "random_points_in_tetrahedral_mesh_3.cpp") - OR NOT (${cppfile} STREQUAL "random_points_on_tetrahedral_mesh_3.cpp") - OR TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "${cppfile}" ) - if (TARGET CGAL::Eigen_support) - get_filename_component(target ${cppfile} NAME_WE) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + if(NOT (${cppfile} STREQUAL "random_points_in_tetrahedral_mesh_3.cpp") + OR NOT (${cppfile} STREQUAL "random_points_on_tetrahedral_mesh_3.cpp") + OR TARGET CGAL::Eigen_support) + create_single_source_cgal_program("${cppfile}") + if(TARGET CGAL::Eigen_support) + get_filename_component(target ${cppfile} NAME_WE) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) endif() - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() + endif() +endforeach() diff --git a/Generator/test/Generator/CMakeLists.txt b/Generator/test/Generator/CMakeLists.txt index a757803d15c..ff0701e7ad7 100644 --- a/Generator/test/Generator/CMakeLists.txt +++ b/Generator/test/Generator/CMakeLists.txt @@ -1,33 +1,27 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Generator_Tests ) +project(Generator_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +# Use Eigen +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) +include(CGAL_Eigen_support) -if ( CGAL_FOUND ) - - # Use Eigen - find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) - include(CGAL_Eigen_support) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - if(NOT (${cppfile} STREQUAL "generic_random_test.cpp") OR TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "${cppfile}" ) - if (TARGET CGAL::Eigen_support) - get_filename_component(target ${cppfile} NAME_WE) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + if(NOT (${cppfile} STREQUAL "generic_random_test.cpp") OR TARGET + CGAL::Eigen_support) + create_single_source_cgal_program("${cppfile}") + if(TARGET CGAL::Eigen_support) + get_filename_component(target ${cppfile} NAME_WE) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) endif() - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() + endif() +endforeach() diff --git a/Geomview/demo/Geomview/CMakeLists.txt b/Geomview/demo/Geomview/CMakeLists.txt index 3fd8e4ba8e7..5b83f67fc3e 100644 --- a/Geomview/demo/Geomview/CMakeLists.txt +++ b/Geomview/demo/Geomview/CMakeLists.txt @@ -1,9 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Geomview_Demo ) +project(Geomview_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,17 +11,8 @@ endif() set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "input.cpp" ) - create_single_source_cgal_program( "kernel.cpp" ) - create_single_source_cgal_program( "gv_terrain.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +find_package(CGAL REQUIRED) +create_single_source_cgal_program("input.cpp") +create_single_source_cgal_program("kernel.cpp") +create_single_source_cgal_program("gv_terrain.cpp") diff --git a/Geomview/test/Geomview/CMakeLists.txt b/Geomview/test/Geomview/CMakeLists.txt index d011e2c797c..e9b2d6c6e92 100644 --- a/Geomview/test/Geomview/CMakeLists.txt +++ b/Geomview/test/Geomview/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Geomview_Tests ) +project(Geomview_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt index 5f7ab12f0a5..d4cf857a00e 100644 --- a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt +++ b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Alpha_shapes_2_Demo) +project(Alpha_shapes_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,40 +13,43 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ./include) +include_directories(BEFORE ./include) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) -add_definitions(-DQT_NO_KEYWORDS) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -#-------------------------------- -# The "Delaunay" demo: Alpha_shapes_2 -#-------------------------------- -# UI files (Qt Designer files) -qt5_wrap_ui( DT_UI_FILES Alpha_shapes_2.ui ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) + add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) + #-------------------------------- + # The "Delaunay" demo: Alpha_shapes_2 + #-------------------------------- + # UI files (Qt Designer files) + qt5_wrap_ui(DT_UI_FILES Alpha_shapes_2.ui) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Alpha_shapes_2.qrc ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Alpha_shapes_2.qrc) -# The executable itself. -add_executable ( Alpha_shapes_2 Alpha_shapes_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + # The executable itself. + add_executable( + Alpha_shapes_2 Alpha_shapes_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES}) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Alpha_shapes_2 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Alpha_shapes_2) -target_link_libraries( Alpha_shapes_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) + target_link_libraries(Alpha_shapes_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Alpha_shapes_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Alpha_shapes_2) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Alpha_shapes_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Alpha_shapes_2) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt index a7010daf3a3..908428488e8 100644 --- a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Apollonius_graph_2_Demo) +project(Apollonius_graph_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,40 +13,42 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) -add_definitions(-DQT_NO_KEYWORDS) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -#-------------------------------- -# UI files (Qt Designer files) -qt5_wrap_ui( DT_UI_FILES Apollonius_graph_2.ui ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) + add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) + #-------------------------------- + # UI files (Qt Designer files) + qt5_wrap_ui(DT_UI_FILES Apollonius_graph_2.ui) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Apollonius_graph_2.qrc ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Apollonius_graph_2.qrc) -# use the Qt MOC preprocessor on classes that derives from QObject + # use the Qt MOC preprocessor on classes that derives from QObject -# The executable itself. -add_executable ( Apollonius_graph_2 Apollonius_graph_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + # The executable itself. + add_executable( + Apollonius_graph_2 Apollonius_graph_2.cpp ${DT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Apollonius_graph_2 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Apollonius_graph_2) -target_link_libraries( Apollonius_graph_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 - Qt5::Gui ) + target_link_libraries(Apollonius_graph_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Apollonius_graph_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Apollonius_graph_2) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Apollonius_graph_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Apollonius_graph_2) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt index 3e5c460cf57..c0a12b255fc 100644 --- a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt +++ b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Bounding_volumes_Demo) +project(Bounding_volumes_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,45 +13,47 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ./include) +include_directories(BEFORE ./include) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_AUTOMOC ON) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -add_definitions(-DQT_NO_KEYWORDS) -set(CMAKE_AUTOMOC ON) + #---------------------------------------------- + # The "Bounding volumes" demo: Bounding_volumes + #---------------------------------------------- + # UI files (Qt Designer files) + qt5_wrap_ui(DT_UI_FILES Bounding_volumes.ui) -#---------------------------------------------- -# The "Bounding volumes" demo: Bounding_volumes -#---------------------------------------------- -# UI files (Qt Designer files) -qt5_wrap_ui( DT_UI_FILES Bounding_volumes.ui ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Bounding_volumes.qrc) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Bounding_volumes.qrc ) + # use the Qt MOC preprocessor on classes that derives from QObject -# use the Qt MOC preprocessor on classes that derives from QObject + # The executable itself. + add_executable( + Bounding_volumes Bounding_volumes.cpp ${DT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -# The executable itself. -add_executable ( Bounding_volumes Bounding_volumes.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Bounding_volumes) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Bounding_volumes ) + target_link_libraries(Bounding_volumes PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui) -target_link_libraries( Bounding_volumes PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Bounding_volumes) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Bounding_volumes) - -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Bounding_volumes) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Bounding_volumes) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt index 10aa5cf7095..99ddd23a398 100644 --- a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt +++ b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Circular_kernel_2_Demo) +project(Circular_kernel_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,12 +13,11 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) - +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) @@ -27,21 +26,22 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # The demo: Circular_kernel_2 #-------------------------------- # UI files (Qt Designer files) - qt5_wrap_ui( DT_UI_FILES Circular_kernel_2.ui ) + qt5_wrap_ui(DT_UI_FILES Circular_kernel_2.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Circular_kernel_2.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Circular_kernel_2.qrc) # use the Qt MOC preprocessor on classes that derives from QObject - # The executable itself. - add_executable ( Circular_kernel_2 Circular_kernel_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_executable( + Circular_kernel_2 Circular_kernel_2.cpp ${DT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Circular_kernel_2 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Circular_kernel_2) - target_link_libraries( Circular_kernel_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui) + target_link_libraries(Circular_kernel_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Circular_kernel_2) @@ -51,6 +51,7 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Generator/CMakeLists.txt b/GraphicsView/demo/Generator/CMakeLists.txt index ff38367120b..e7e4e3afc16 100644 --- a/GraphicsView/demo/Generator/CMakeLists.txt +++ b/GraphicsView/demo/Generator/CMakeLists.txt @@ -1,7 +1,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Generator_Demo) +project(Generator_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,11 +12,11 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -26,25 +26,27 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # Demo: Generator_2 #-------------------------------- # UI files (Qt Designer files) - qt5_wrap_ui( DT_UI_FILES Generator_2.ui ) + qt5_wrap_ui(DT_UI_FILES Generator_2.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Generator_2.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Generator_2.qrc) # use the Qt MOC preprocessor on classes that derives from QObject # The executable itself. - add_executable ( Generator_2 Generator_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) + add_executable(Generator_2 Generator_2.cpp ${DT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Generator_2 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Generator_2) - target_link_libraries( Generator_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) + target_link_libraries(Generator_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Generator_2) else() - message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." + ) endif() diff --git a/GraphicsView/demo/GraphicsView/CMakeLists.txt b/GraphicsView/demo/GraphicsView/CMakeLists.txt index 7a2a221bce6..6fec9bd067b 100644 --- a/GraphicsView/demo/GraphicsView/CMakeLists.txt +++ b/GraphicsView/demo/GraphicsView/CMakeLists.txt @@ -1,7 +1,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (GraphicsView_Demo) +project(GraphicsView_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,26 +12,26 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_INCLUDE_CURRENT_DIR ON) - add_executable ( min min.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_executable(min min.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS min ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS min) - target_link_libraries( min PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) + target_link_libraries(min PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(min) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt index af449d606ac..dd3ecf5491a 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (L1_Voronoi_diagram_2_Demo) +project(L1_Voronoi_diagram_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,43 +13,45 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ./include) +include_directories(BEFORE ./include) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) + add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) -add_definitions(-DQT_NO_KEYWORDS) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) + #-------------------------------- + # The "L1 Voronoi diagram" demo: L1_voronoi_diagram_2 + #-------------------------------- + # UI files (Qt Designer files) + qt5_wrap_ui(DT_UI_FILES L1_voronoi_diagram_2.ui) -#-------------------------------- -# The "L1 Voronoi diagram" demo: L1_voronoi_diagram_2 -#-------------------------------- -# UI files (Qt Designer files) -qt5_wrap_ui( DT_UI_FILES L1_voronoi_diagram_2.ui ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./L1_voronoi_diagram_2.qrc) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./L1_voronoi_diagram_2.qrc ) + # The executable itself. + add_executable( + L1_voronoi_diagram_2 L1_voronoi_diagram_2.cpp ${DT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -# The executable itself. -add_executable ( L1_voronoi_diagram_2 L1_voronoi_diagram_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS L1_voronoi_diagram_2) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS L1_voronoi_diagram_2 ) + target_link_libraries(L1_voronoi_diagram_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui) -target_link_libraries( L1_voronoi_diagram_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(L1_voronoi_diagram_2) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(L1_voronoi_diagram_2) - -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(L1_voronoi_diagram_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(L1_voronoi_diagram_2) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt index 274f4c46b69..c7cda2cb1b6 100644 --- a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt +++ b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Largest_empty_rect_2_Demo) +project(Largest_empty_rect_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,11 +13,11 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -27,23 +27,27 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # Demo: Largest_empty_rectangle_2 #-------------------------------- # UI files (Qt Designer files) - qt5_wrap_ui( DT_UI_FILES Largest_empty_rectangle_2.ui ) + qt5_wrap_ui(DT_UI_FILES Largest_empty_rectangle_2.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Largest_empty_rectangle_2.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Largest_empty_rectangle_2.qrc) # The executable itself. - add_executable ( Largest_empty_rectangle_2 Largest_empty_rectangle_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) + add_executable( + Largest_empty_rectangle_2 Largest_empty_rectangle_2.cpp ${DT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Largest_empty_rectangle_2 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Largest_empty_rectangle_2) - target_link_libraries( Largest_empty_rectangle_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) + target_link_libraries(Largest_empty_rectangle_2 + PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Largest_empty_rectangle_2) else() - message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." + ) endif() diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt index f0cbd00a713..4d75fc2dcbc 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1...3.15) -project (Periodic_2_triangulation_2_Demo) +project(Periodic_2_triangulation_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -10,50 +10,55 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) - +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ./include) +include_directories(BEFORE ./include) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) -add_definitions(-DQT_NO_KEYWORDS) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) + add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) -#-------------------------------- -# The "2D Periodic triangulation" demo: Periodic_2_triangulation_2 -#-------------------------------- -# UI files (Qt Designer files) -qt5_wrap_ui( DT_UI_FILES Periodic_2_triangulation_2.ui ) + #-------------------------------- + # The "2D Periodic triangulation" demo: Periodic_2_triangulation_2 + #-------------------------------- + # UI files (Qt Designer files) + qt5_wrap_ui(DT_UI_FILES Periodic_2_triangulation_2.ui) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Periodic_2_triangulation_2.qrc ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Periodic_2_triangulation_2.qrc) + # find header files for projects that can show them + file(GLOB headers "*.h") + file(GLOB QT_headers "include/CGAL/Qt/*.h") + file(GLOB P2T2_headers "../../../include/CGAL/*.h") + source_group("P2T2" FILES ${P2T2_headers}) + source_group("QT" FILES ${QT_headers}) -# find header files for projects that can show them -file(GLOB headers "*.h") -file(GLOB QT_headers "include/CGAL/Qt/*.h") -file(GLOB P2T2_headers "../../../include/CGAL/*.h") -SOURCE_GROUP("P2T2" FILES ${P2T2_headers}) -SOURCE_GROUP("QT" FILES ${QT_headers}) + # The executable itself. + add_executable( + Periodic_2_Delaunay_triangulation_2 + Periodic_2_Delaunay_triangulation_2.cpp + ${DT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES} + ${headers} + ${QT_headers} + ${P2T2_headers}) -# The executable itself. -add_executable ( Periodic_2_Delaunay_triangulation_2 - Periodic_2_Delaunay_triangulation_2.cpp - ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} - ${headers} ${QT_headers} ${P2T2_headers}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS + Periodic_2_Delaunay_triangulation_2) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Periodic_2_Delaunay_triangulation_2 ) + target_link_libraries(Periodic_2_Delaunay_triangulation_2 + PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui) -target_link_libraries( Periodic_2_Delaunay_triangulation_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) - -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Periodic_2_Delaunay_triangulation_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Periodic_2_Delaunay_triangulation_2) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Polygon/CMakeLists.txt b/GraphicsView/demo/Polygon/CMakeLists.txt index a38afceeedd..5d46ce8c130 100644 --- a/GraphicsView/demo/Polygon/CMakeLists.txt +++ b/GraphicsView/demo/Polygon/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Polygon_Demo) +project(Polygon_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,23 +13,26 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5 Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 Core) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "NOTICE: This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS + "NOTICE: This project requires the Eigen library, and will not be compiled." + ) return() endif() find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_USE_FILE}) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_AUTOMOC ON) - if( CGAL_Core_FOUND) + if(CGAL_Core_FOUND) add_definitions(-DCGAL_USE_CORE) endif() @@ -37,26 +40,30 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # Demo: Polygon_2 #-------------------------------- # UI files (Qt Designer files) - qt5_wrap_ui( DT_UI_FILES Polygon_2.ui ) + qt5_wrap_ui(DT_UI_FILES Polygon_2.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Polygon_2.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Polygon_2.qrc) -# add_library( CGAL SHARED IMPORTED ) -# SET_PROPERTY(TARGET CGAL PROPERTY IMPORTED_LOCATION ${CGAL_LIBRARY} ) + # add_library( CGAL SHARED IMPORTED ) + # SET_PROPERTY(TARGET CGAL PROPERTY IMPORTED_LOCATION ${CGAL_LIBRARY} ) # The executable itself. - add_executable ( Polygon_2 Polygon_2.cpp ${DT_UI_FILES} ${DT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) + add_executable(Polygon_2 Polygon_2.cpp ${DT_UI_FILES} ${DT_RESOURCE_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polygon_2 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Polygon_2) - target_link_libraries( Polygon_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 CGAL::Eigen_support Qt5::Gui ) + target_link_libraries(Polygon_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + CGAL::Eigen_support Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Polygon_2) else() - message(STATUS "NOTICE: This demo requires CGAL, CGAL_Core, and Qt5, and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires CGAL, CGAL_Core, and Qt5, and will not be compiled." + ) endif() diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt index ac922296998..5a22d88a978 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Segment_Delaunay_graph_2_Demo) +project(Segment_Delaunay_graph_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,46 +13,47 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5 Core) - -set( QT_USE_QTXML TRUE ) -set( QT_USE_QTMAIN TRUE ) -set( QT_USE_QTSCRIPT TRUE ) -set( QT_USE_QTOPENGL TRUE ) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 Core) +set(QT_USE_QTXML TRUE) +set(QT_USE_QTMAIN TRUE) +set(QT_USE_QTSCRIPT TRUE) +set(QT_USE_QTOPENGL TRUE) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ./include) +include_directories(BEFORE ./include) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) + set(CMAKE_AUTOMOC ON) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) -set(CMAKE_AUTOMOC ON) + include(${CGAL_USE_FILE}) + add_definitions(-DQT_NO_KEYWORDS) -include(${CGAL_USE_FILE}) -add_definitions(-DQT_NO_KEYWORDS) + #-------------------------------- + # The "Segment Voronoi" demo: Segment_voronoi_2 + #-------------------------------- + # UI files (Qt Designer files) + qt5_wrap_ui(CDT_UI_FILES Segment_voronoi_2.ui) -#-------------------------------- -# The "Segment Voronoi" demo: Segment_voronoi_2 -#-------------------------------- -# UI files (Qt Designer files) -qt5_wrap_ui( CDT_UI_FILES Segment_voronoi_2.ui ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Segment_voronoi_2.qrc) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Segment_voronoi_2.qrc ) + # The executable itself. + add_executable( + Segment_voronoi_2 Segment_voronoi_2.cpp ${CDT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -# The executable itself. -add_executable ( Segment_voronoi_2 Segment_voronoi_2.cpp ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Segment_voronoi_2) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Segment_voronoi_2 ) + target_link_libraries(Segment_voronoi_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui) -target_link_libraries( Segment_voronoi_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) - -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Segment_voronoi_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Segment_voronoi_2) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index a87600e4507..46723a27011 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Segment_Delaunay_graph_Linf_2_Demo) +project(Segment_Delaunay_graph_Linf_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,44 +13,45 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5 Core) - -set( QT_USE_QTXML TRUE ) -set( QT_USE_QTMAIN TRUE ) -set( QT_USE_QTSCRIPT TRUE ) -set( QT_USE_QTOPENGL TRUE ) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 Core) +set(QT_USE_QTXML TRUE) +set(QT_USE_QTMAIN TRUE) +set(QT_USE_QTSCRIPT TRUE) +set(QT_USE_QTOPENGL TRUE) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ./include) +include_directories(BEFORE ./include) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) + set(CMAKE_AUTOMOC ON) + include(${CGAL_USE_FILE}) + add_definitions(-DQT_NO_KEYWORDS) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) -set(CMAKE_AUTOMOC ON) -include(${CGAL_USE_FILE}) -add_definitions(-DQT_NO_KEYWORDS) + #-------------------------------- + # The "Segment Voronoi Linf" demo: Segment_voronoi_linf_2 + #-------------------------------- + # UI files (Qt Designer files) + qt5_wrap_ui(CDT_UI_FILES Segment_voronoi_2.ui) -#-------------------------------- -# The "Segment Voronoi Linf" demo: Segment_voronoi_linf_2 -#-------------------------------- -# UI files (Qt Designer files) -qt5_wrap_ui( CDT_UI_FILES Segment_voronoi_2.ui ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Segment_voronoi_2.qrc) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Segment_voronoi_2.qrc ) + # The executable itself. + add_executable( + Segment_voronoi_linf_2 Segment_voronoi_linf_2.cpp ${CDT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -# The executable itself. -add_executable ( Segment_voronoi_linf_2 Segment_voronoi_linf_2.cpp ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Segment_voronoi_linf_2) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Segment_voronoi_linf_2 ) + target_link_libraries(Segment_voronoi_linf_2 PRIVATE CGAL::CGAL + CGAL::CGAL_Qt5 Qt5::Gui) -target_link_libraries( Segment_voronoi_linf_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) - -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Segment_voronoi_linf_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Segment_voronoi_linf_2) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt index f4eb6c8b9d7..c4092df8007 100644 --- a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt +++ b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Snap_rounding_2_Demo) +project(Snap_rounding_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,39 +13,41 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) + set(CMAKE_AUTOMOC ON) + add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) -set(CMAKE_AUTOMOC ON) -add_definitions(-DQT_NO_KEYWORDS) -set(CMAKE_INCLUDE_CURRENT_DIR ON) + #-------------------------------- + # UI files (Qt Designer files) + qt5_wrap_ui(DT_UI_FILES Snap_rounding_2.ui) -#-------------------------------- -# UI files (Qt Designer files) -qt5_wrap_ui( DT_UI_FILES Snap_rounding_2.ui ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Snap_rounding_2.qrc) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Snap_rounding_2.qrc ) + # The executable itself. + add_executable( + Snap_rounding_2 Snap_rounding_2.cpp ${DT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -# The executable itself. -add_executable ( Snap_rounding_2 Snap_rounding_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Snap_rounding_2) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Snap_rounding_2 ) + target_link_libraries(Snap_rounding_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui) -target_link_libraries( Snap_rounding_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Snap_rounding_2) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Snap_rounding_2) - -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Snap_rounding_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Snap_rounding_2) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt index fb30598a70e..6ff2a9bacae 100644 --- a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt +++ b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Spatial_searching_2_Demo) +project(Spatial_searching_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,12 +13,11 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) - -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -28,24 +27,27 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # Demo: Spatial_searching_2 #-------------------------------- # UI files (Qt Designer files) - qt5_wrap_ui( DT_UI_FILES Spatial_searching_2.ui ) + qt5_wrap_ui(DT_UI_FILES Spatial_searching_2.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Spatial_searching_2.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Spatial_searching_2.qrc) # The executable itself. - add_executable ( Spatial_searching_2 Spatial_searching_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) + add_executable( + Spatial_searching_2 Spatial_searching_2.cpp ${DT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Spatial_searching_2) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Spatial_searching_2 ) - - target_link_libraries( Spatial_searching_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) + target_link_libraries(Spatial_searching_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Spatial_searching_2) else() - message(STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL, and Qt5, and will not be compiled." + ) endif() diff --git a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt index b856b704cb9..2c5c3c33005 100644 --- a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt +++ b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Stream_lines_2_Demo) +project(Stream_lines_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,40 +13,42 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) - +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) -add_definitions(-DQT_NO_KEYWORDS) -set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) + add_definitions(-DQT_NO_KEYWORDS) + set(CMAKE_INCLUDE_CURRENT_DIR ON) + set(CMAKE_AUTOMOC ON) -#-------------------------------- -# UI files (Qt Designer files) -qt5_wrap_ui( DT_UI_FILES Stream_lines_2.ui ) + #-------------------------------- + # UI files (Qt Designer files) + qt5_wrap_ui(DT_UI_FILES Stream_lines_2.ui) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Stream_lines_2.qrc ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Stream_lines_2.qrc) -# The executable itself. -add_executable ( Stream_lines_2 Stream_lines_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) + # The executable itself. + add_executable( + Stream_lines_2 Stream_lines_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES}) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Stream_lines_2 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Stream_lines_2) -target_link_libraries( Stream_lines_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) + target_link_libraries(Stream_lines_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Stream_lines_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Stream_lines_2) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Stream_lines_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Stream_lines_2) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/GraphicsView/demo/Triangulation_2/CMakeLists.txt b/GraphicsView/demo/Triangulation_2/CMakeLists.txt index 450be2d2f36..f55c15fe3a7 100644 --- a/GraphicsView/demo/Triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Triangulation_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Triangulation_2_Demo) +project(Triangulation_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -16,11 +16,13 @@ endif() set(CMAKE_AUTOMOC TRUE) set(CMAKE_INCLUDE_CURRENT_DIR TRUE) -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Widgets) -if ( NOT CGAL_FOUND OR NOT CGAL_Qt5_FOUND OR NOT Qt5_FOUND ) - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") +if(NOT CGAL_Qt5_FOUND + OR NOT Qt5_FOUND) + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") return() endif() @@ -31,51 +33,51 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # The "constrained Delaunay" demo: Constrained_Delaunay_triangulation_2 #-------------------------------- -qt5_add_resources ( CD_RES_FILE Constrained_Delaunay_triangulation_2.qrc) -qt5_wrap_ui( CD_UI_FILES Constrained_Delaunay_triangulation_2.ui) +qt5_add_resources(CD_RES_FILE Constrained_Delaunay_triangulation_2.qrc) +qt5_wrap_ui(CD_UI_FILES Constrained_Delaunay_triangulation_2.ui) # The executable itself. -add_executable( Constrained_Delaunay_triangulation_2 - Constrained_Delaunay_triangulation_2.cpp ${CD_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} - ${CD_RES_FILE}) -target_link_libraries( Constrained_Delaunay_triangulation_2 - PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets) -target_include_directories( Constrained_Delaunay_triangulation_2 - PRIVATE ./include) +add_executable( + Constrained_Delaunay_triangulation_2 + Constrained_Delaunay_triangulation_2.cpp ${CD_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CD_RES_FILE}) +target_link_libraries(Constrained_Delaunay_triangulation_2 + PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets) +target_include_directories(Constrained_Delaunay_triangulation_2 + PRIVATE ./include) add_to_cached_list(CGAL_EXECUTABLE_TARGETS Constrained_Delaunay_triangulation_2) #-------------------------------- # The "Delaunay" demo: Delaunay_triangulation_2 #-------------------------------- -qt5_wrap_ui( D_UI_FILES Delaunay_triangulation_2.ui) -qt5_add_resources ( D_RES_FILE Delaunay_triangulation_2.qrc) +qt5_wrap_ui(D_UI_FILES Delaunay_triangulation_2.ui) +qt5_add_resources(D_RES_FILE Delaunay_triangulation_2.qrc) # The executable itself. -add_executable ( Delaunay_triangulation_2 - Delaunay_triangulation_2.cpp ${D_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${D_RES_FILE}) -target_link_libraries( Delaunay_triangulation_2 - PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets) +add_executable( + Delaunay_triangulation_2 Delaunay_triangulation_2.cpp ${D_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${D_RES_FILE}) +target_link_libraries(Delaunay_triangulation_2 + PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Delaunay_triangulation_2 ) +add_to_cached_list(CGAL_EXECUTABLE_TARGETS Delaunay_triangulation_2) #-------------------------------- # The "Regular" demo: Regular_triangulation_2 #-------------------------------- # The executable itself. -qt5_add_resources ( R_RES_FILE Regular_triangulation_2.qrc) +qt5_add_resources(R_RES_FILE Regular_triangulation_2.qrc) qt5_wrap_ui(R_UI_FILES Regular_triangulation_2.ui) -add_executable ( Regular_triangulation_2 - Regular_triangulation_2.cpp ${R_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${R_RES_FILE} ) -target_link_libraries(Regular_triangulation_2 - PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets) +add_executable( + Regular_triangulation_2 Regular_triangulation_2.cpp ${R_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${R_RES_FILE}) +target_link_libraries(Regular_triangulation_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Widgets) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Regular_triangulation_2 ) +add_to_cached_list(CGAL_EXECUTABLE_TARGETS Regular_triangulation_2) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -foreach(target - Constrained_Delaunay_triangulation_2 - Delaunay_triangulation_2 - Regular_triangulation_2) +foreach(target Constrained_Delaunay_triangulation_2 Delaunay_triangulation_2 + Regular_triangulation_2) cgal_add_compilation_test(${target}) endforeach() - diff --git a/GraphicsView/src/CGAL_Qt5/CMakeLists.txt b/GraphicsView/src/CGAL_Qt5/CMakeLists.txt index c9ab3d99241..bdf51f41ced 100644 --- a/GraphicsView/src/CGAL_Qt5/CMakeLists.txt +++ b/GraphicsView/src/CGAL_Qt5/CMakeLists.txt @@ -8,33 +8,48 @@ endif() include(CGAL_SetupCGAL_Qt5Dependencies) if(CGAL_Qt5_MISSING_DEPS) - message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.") + message( + STATUS + "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured." + ) return() endif() -message( STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'" ) +message(STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'") if(NOT CGAL_HEADER_ONLY) - collect_cgal_library( CGAL_Qt5 "${_CGAL_Qt5_MOC_FILES_private};${_CGAL_Qt5_RESOURCE_FILES_private};${_CGAL_Qt5_UI_FILES}") - target_include_directories( CGAL_Qt5 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + collect_cgal_library( + CGAL_Qt5 + "${_CGAL_Qt5_MOC_FILES_private};${_CGAL_Qt5_RESOURCE_FILES_private};${_CGAL_Qt5_UI_FILES}" + ) + target_include_directories(CGAL_Qt5 PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) else() - collect_cgal_library( CGAL_Qt5 "") + collect_cgal_library(CGAL_Qt5 "") endif() if(CGAL_HEADER_ONLY) set(keyword "INTERFACE") endif() -CGAL_setup_CGAL_Qt5_dependencies( CGAL_Qt5 ${keyword}) +cgal_setup_cgal_qt5_dependencies(CGAL_Qt5 ${keyword}) if(COMMAND add_config_flag) - set( CGAL_HAS_QT5 TRUE ) - add_config_flag( CGAL_HAS_QT5 ) + set(CGAL_HAS_QT5 TRUE) + add_config_flag(CGAL_HAS_QT5) endif() -install(DIRECTORY "../../include/CGAL/Qt/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/Qt" COMPONENT CGAL_Qt5) -if (CGAL_HEADER_ONLY) - install(DIRECTORY "../../demo/resources/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/resources" COMPONENT CGAL_Qt5) - install(DIRECTORY "../../demo/icons/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/icons" COMPONENT CGAL_Qt5) +install( + DIRECTORY "../../include/CGAL/Qt/" + DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/Qt" + COMPONENT CGAL_Qt5) +if(CGAL_HEADER_ONLY) + install( + DIRECTORY "../../demo/resources/" + DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/resources" + COMPONENT CGAL_Qt5) + install( + DIRECTORY "../../demo/icons/" + DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/icons" + COMPONENT CGAL_Qt5) endif() message("libCGAL_Qt5 is configured") diff --git a/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt b/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt index 53ba2bbb5a1..46a83004c90 100644 --- a/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt +++ b/HalfedgeDS/examples/HalfedgeDS/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( HalfedgeDS_Examples ) +project(HalfedgeDS_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt b/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt index 8bdb83e9abc..c13f87ed26a 100644 --- a/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt +++ b/HalfedgeDS/test/HalfedgeDS/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( HalfedgeDS_Tests ) +project(HalfedgeDS_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Hash_map/benchmark/Hash_map/CMakeLists.txt b/Hash_map/benchmark/Hash_map/CMakeLists.txt index c5f7b304a23..3b94983cee8 100644 --- a/Hash_map/benchmark/Hash_map/CMakeLists.txt +++ b/Hash_map/benchmark/Hash_map/CMakeLists.txt @@ -2,24 +2,18 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Hash_map ) +project(Hash_map) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -32,11 +26,9 @@ endif() # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "hm.cpp" ) -create_single_source_cgal_program( "foreach.cpp" ) -create_single_source_cgal_program( "triangulation.cpp" ) -create_single_source_cgal_program( "polyhedron.cpp" ) -create_single_source_cgal_program( "surface_mesh.cpp" ) -create_single_source_cgal_program( "arrangement.cpp" ) - - +create_single_source_cgal_program("hm.cpp") +create_single_source_cgal_program("foreach.cpp") +create_single_source_cgal_program("triangulation.cpp") +create_single_source_cgal_program("polyhedron.cpp") +create_single_source_cgal_program("surface_mesh.cpp") +create_single_source_cgal_program("arrangement.cpp") diff --git a/Hash_map/test/Hash_map/CMakeLists.txt b/Hash_map/test/Hash_map/CMakeLists.txt index dc991a5fdef..8ee8636cf97 100644 --- a/Hash_map/test/Hash_map/CMakeLists.txt +++ b/Hash_map/test/Hash_map/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Hash_map_Tests ) +project(Hash_map_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Heat_method_3/examples/Heat_method_3/CMakeLists.txt b/Heat_method_3/examples/Heat_method_3/CMakeLists.txt index 0a29731a259..66027c7ff32 100644 --- a/Heat_method_3/examples/Heat_method_3/CMakeLists.txt +++ b/Heat_method_3/examples/Heat_method_3/CMakeLists.txt @@ -2,60 +2,51 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Heat_method_3_Examples ) - - +project(Heat_method_3_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # include helper file -include( ${CGAL_USE_FILE} ) - +include(${CGAL_USE_FILE}) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() - find_package(Eigen3 3.3.0) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library (3.3 or greater), and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS + "This project requires the Eigen library (3.3 or greater), and will not be compiled." + ) return() endif() - # include for local directory -include_directories( BEFORE include ) - - +include_directories(BEFORE include) # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) +include(CGAL_CreateSingleSourceCGALProgram) -create_single_source_cgal_program( "heat_method.cpp" ) +create_single_source_cgal_program("heat_method.cpp") target_link_libraries(heat_method PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "heat_method_polyhedron.cpp" ) +create_single_source_cgal_program("heat_method_polyhedron.cpp") target_link_libraries(heat_method_polyhedron PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "heat_method_surface_mesh.cpp" ) +create_single_source_cgal_program("heat_method_surface_mesh.cpp") target_link_libraries(heat_method_surface_mesh PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "heat_method_surface_mesh_direct.cpp" ) -target_link_libraries(heat_method_surface_mesh_direct PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("heat_method_surface_mesh_direct.cpp") +target_link_libraries(heat_method_surface_mesh_direct + PUBLIC CGAL::Eigen_support) diff --git a/Heat_method_3/test/Heat_method_3/CMakeLists.txt b/Heat_method_3/test/Heat_method_3/CMakeLists.txt index 9a86ed7236c..962f84378b1 100644 --- a/Heat_method_3/test/Heat_method_3/CMakeLists.txt +++ b/Heat_method_3/test/Heat_method_3/CMakeLists.txt @@ -2,56 +2,49 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Heat_method_3_Tests ) - - +project(Heat_method_3_Tests) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # include helper file -include( ${CGAL_USE_FILE} ) - +include(${CGAL_USE_FILE}) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() - find_package(Eigen3 3.3.0) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library (3.3 or greater), and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS + "This project requires the Eigen library (3.3 or greater), and will not be compiled." + ) return() endif() # include for local directory -include_directories( BEFORE include ) - +include_directories(BEFORE include) # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) +include(CGAL_CreateSingleSourceCGALProgram) -create_single_source_cgal_program( "heat_method_concept.cpp" ) +create_single_source_cgal_program("heat_method_concept.cpp") target_link_libraries(heat_method_concept PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "heat_method_surface_mesh_test.cpp" ) +create_single_source_cgal_program("heat_method_surface_mesh_test.cpp") target_link_libraries(heat_method_surface_mesh_test PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "heat_method_surface_mesh_direct_test.cpp" ) -target_link_libraries(heat_method_surface_mesh_direct_test PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("heat_method_surface_mesh_direct_test.cpp") +target_link_libraries(heat_method_surface_mesh_direct_test + PUBLIC CGAL::Eigen_support) diff --git a/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt index 778898b81a0..f7d5771f074 100644 --- a/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/benchmark/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,24 +1,13 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Hyperbolic_triangulation_2_benchmark ) +project(Hyperbolic_triangulation_2_benchmark) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) +include(${CGAL_USE_FILE}) -if ( CGAL_FOUND ) - - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - create_single_source_cgal_program( "bench_insertion_with_different_kernels.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(CGAL_CreateSingleSourceCGALProgram) +create_single_source_cgal_program("bench_insertion_with_different_kernels.cpp") diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt index 61dd2e41455..7e9f118ad9d 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1...3.15) -project (Hyperbolic_triangulation_2_Demo) +project(Hyperbolic_triangulation_2_Demo) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -17,17 +17,24 @@ find_package(LEDA QUIET) # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS OpenGL Gui) -if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND)) - include_directories( BEFORE ./ ./include ) +if(CGAL_Qt5_FOUND + AND Qt5_FOUND + AND (CGAL_Core_FOUND OR LEDA_FOUND)) + include_directories(BEFORE ./ ./include) # ui files, created with Qt Designer - qt5_wrap_ui( UIS HDT2.ui ) + qt5_wrap_ui(UIS HDT2.ui) - qt5_add_resources ( RESOURCE_FILES resources/Delaunay_triangulation_2.qrc ) + qt5_add_resources(RESOURCE_FILES resources/Delaunay_triangulation_2.qrc) # cpp files - add_executable ( HDT2 HDT2.cpp ${CGAL_Qt5_RESOURCE_FILES} ${RESOURCE_FILES} ${UIS}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS HDT2 ) - target_link_libraries ( HDT2 CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_Core Qt5::Widgets) + add_executable(HDT2 HDT2.cpp ${CGAL_Qt5_RESOURCE_FILES} ${RESOURCE_FILES} + ${UIS}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS HDT2) + target_link_libraries(HDT2 CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_Core + Qt5::Widgets) else() - message(STATUS "NOTICE: This demo requires CGAL, CGAL_Core (or LEDA), and Qt5 and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires CGAL, CGAL_Core (or LEDA), and Qt5 and will not be compiled." + ) endif() diff --git a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt index 934eff1e933..2b18b39b3e8 100644 --- a/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/examples/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,25 +1,14 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Hyperbolic_triangulation_2_Examples ) +project(Hyperbolic_triangulation_2_Examples) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) +include(${CGAL_USE_FILE}) -if ( CGAL_FOUND ) - - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - create_single_source_cgal_program( "ht2_example.cpp" ) - create_single_source_cgal_program( "ht2_example_color.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(CGAL_CreateSingleSourceCGALProgram) +create_single_source_cgal_program("ht2_example.cpp") +create_single_source_cgal_program("ht2_example_color.cpp") diff --git a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt index eb3046c8732..89aabb4742e 100644 --- a/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/test/Hyperbolic_triangulation_2/CMakeLists.txt @@ -1,30 +1,19 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Hyperbolic_triangulation_2_Tests ) +project(Hyperbolic_triangulation_2_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) +include(${CGAL_USE_FILE}) -if ( CGAL_FOUND ) - - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - create_single_source_cgal_program( "ht2_test_clear.cpp" ) - create_single_source_cgal_program( "ht2_test_locate.cpp" ) - create_single_source_cgal_program( "ht2_test_remove.cpp" ) - create_single_source_cgal_program( "ht2_test_swap.cpp" ) - create_single_source_cgal_program( "ht2_test_copy.cpp" ) - create_single_source_cgal_program( "ht2_test_hyperbolic_circulator.cpp" ) - create_single_source_cgal_program( "ht2_test_insert_degenerate.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(CGAL_CreateSingleSourceCGALProgram) +create_single_source_cgal_program("ht2_test_clear.cpp") +create_single_source_cgal_program("ht2_test_locate.cpp") +create_single_source_cgal_program("ht2_test_remove.cpp") +create_single_source_cgal_program("ht2_test_swap.cpp") +create_single_source_cgal_program("ht2_test_copy.cpp") +create_single_source_cgal_program("ht2_test_hyperbolic_circulator.cpp") +create_single_source_cgal_program("ht2_test_insert_degenerate.cpp") diff --git a/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt b/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt index 269f1aa9c96..b9de0021c84 100644 --- a/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt +++ b/Inscribed_areas/examples/Inscribed_areas/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Inscribed_areas_Examples ) +project(Inscribed_areas_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt b/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt index 599e3ff53a7..817794d9081 100644 --- a/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt +++ b/Inscribed_areas/test/Inscribed_areas/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Inscribed_areas_Tests ) +project(Inscribed_areas_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Installation/CMakeLists.txt b/Installation/CMakeLists.txt index 272431c72dc..78dd6cf7063 100644 --- a/Installation/CMakeLists.txt +++ b/Installation/CMakeLists.txt @@ -8,7 +8,6 @@ if(NOT PROJECT_NAME) project(CGAL CXX C) endif() - if(POLICY CMP0056) # https://cmake.org/cmake/help/v3.2/policy/CMP0056.html # @@ -28,7 +27,9 @@ include(GNUInstallDirs) # -= HEADER ONLY =- # #-------------------------------------------------------------------------------------------------- -option(CGAL_HEADER_ONLY "Enable header-only mode of CGAL (no compilation of CGAL libraries)" TRUE) +option(CGAL_HEADER_ONLY + "Enable header-only mode of CGAL (no compilation of CGAL libraries)" + TRUE) #-------------------------------------------------------------------------------------------------- # @@ -36,82 +37,105 @@ option(CGAL_HEADER_ONLY "Enable header-only mode of CGAL (no compilation of CGAL # #-------------------------------------------------------------------------------------------------- -message( "== Setting paths ==" ) +message("== Setting paths ==") -if ( CGAL_BRANCH_BUILD ) +if(CGAL_BRANCH_BUILD) - message( STATUS "Build CGAL from ${CGAL_SCM_NAME}-branch: ${CGAL_SCM_BRANCH_NAME}" ) + message( + STATUS "Build CGAL from ${CGAL_SCM_NAME}-branch: ${CGAL_SCM_BRANCH_NAME}") # list packages - file(GLOB CGAL_CONFIGURED_PACKAGES RELATIVE ${CMAKE_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/*") + file( + GLOB CGAL_CONFIGURED_PACKAGES + RELATIVE ${CMAKE_SOURCE_DIR} + "${CMAKE_SOURCE_DIR}/*") list(SORT CGAL_CONFIGURED_PACKAGES) list(REMOVE_ITEM CGAL_CONFIGURED_PACKAGES copyright CMakeLists.txt .svn .git) # detect and remove not existing package-directories - foreach (package ${CGAL_CONFIGURED_PACKAGES}) - if (NOT IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${package}") + foreach(package ${CGAL_CONFIGURED_PACKAGES}) + if(NOT IS_DIRECTORY "${CMAKE_SOURCE_DIR}/${package}") list(APPEND CGAL_WRONG_PACKAGES ${package}) - elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/${package}/package_info/${package}/maintainer") + elseif(NOT EXISTS + "${CMAKE_SOURCE_DIR}/${package}/package_info/${package}/maintainer") list(APPEND CGAL_WRONG_PACKAGES ${package}) endif() endforeach() - find_program(CGAL_CREATE_CMAKE_SCRIPT cgal_create_cmake_script - HINT ${CMAKE_SOURCE_DIR}/Scripts/scripts - DOC "Script cgal_create_cmake_script, that creates CMakeLists.txt files" - NO_DEFAULT_PATH - NO_CMAKE_ENVIRONMENT_PATH) + find_program( + CGAL_CREATE_CMAKE_SCRIPT cgal_create_cmake_script HINT + ${CMAKE_SOURCE_DIR}/Scripts/scripts + DOC "Script cgal_create_cmake_script, that creates CMakeLists.txt files" + NO_DEFAULT_PATH NO_CMAKE_ENVIRONMENT_PATH) - if (DEFINED CGAL_WRONG_PACKAGES) + if(DEFINED CGAL_WRONG_PACKAGES) message(STATUS "Removed not-a-package: ${CGAL_WRONG_PACKAGES}") list(REMOVE_ITEM CGAL_CONFIGURED_PACKAGES ${CGAL_WRONG_PACKAGES}) endif() set(CGAL_CONFIGURED_PACKAGES_NAMES ${CGAL_CONFIGURED_PACKAGES}) set(CGAL_CONFIGURED_PACKAGES) - foreach (package ${CGAL_CONFIGURED_PACKAGES_NAMES}) + foreach(package ${CGAL_CONFIGURED_PACKAGES_NAMES}) list(APPEND CGAL_CONFIGURED_PACKAGES "${CMAKE_SOURCE_DIR}/${package}") endforeach() + set(CGAL_INSTALLATION_PACKAGE_DIR + "${CMAKE_SOURCE_DIR}/Installation" + CACHE INTERNAL "Directory containing the Installation package") + set(CGAL_MAINTENANCE_PACKAGE_DIR + "${CMAKE_SOURCE_DIR}/Maintenance" + CACHE INTERNAL "Directory containing the Maintenance package") + set(CGAL_CORE_PACKAGE_DIR + "${CMAKE_SOURCE_DIR}/Core" + CACHE INTERNAL "Directory containing the Core package") + set(CGAL_GRAPHICSVIEW_PACKAGE_DIR + "${CMAKE_SOURCE_DIR}/GraphicsView" + CACHE INTERNAL "Directory containing the GraphicsView package") - set(CGAL_INSTALLATION_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/Installation" CACHE INTERNAL "Directory containing the Installation package") - set(CGAL_MAINTENANCE_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/Maintenance" CACHE INTERNAL "Directory containing the Maintenance package") - set(CGAL_CORE_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/Core" CACHE INTERNAL "Directory containing the Core package") - set(CGAL_GRAPHICSVIEW_PACKAGE_DIR "${CMAKE_SOURCE_DIR}/GraphicsView" CACHE INTERNAL "Directory containing the GraphicsView package") - - message(STATUS "Installation package directory: ${CGAL_INSTALLATION_PACKAGE_DIR}") - message(STATUS "Maintenance package directory: ${CGAL_MAINTENANCE_PACKAGE_DIR}") + message( + STATUS "Installation package directory: ${CGAL_INSTALLATION_PACKAGE_DIR}") + message( + STATUS "Maintenance package directory: ${CGAL_MAINTENANCE_PACKAGE_DIR}") message(STATUS "Core package directory: ${CGAL_CORE_PACKAGE_DIR}") -else ( CGAL_BRANCH_BUILD ) +else(CGAL_BRANCH_BUILD) # get release name file(TO_CMAKE_PATH ${CMAKE_SOURCE_DIR} CMAKE_SOURCE_CDIR) string(REGEX REPLACE "^/" "" CMAKE_SOURCE_DDIR ${CMAKE_SOURCE_CDIR}) string(REPLACE "/" ";" CMAKE_SOURCE_PDIR ${CMAKE_SOURCE_DDIR}) list(GET CMAKE_SOURCE_PDIR -1 CGAL_RELEASE_NAME) - message( STATUS "Build CGAL from release in directory ${CGAL_RELEASE_NAME}" ) + message(STATUS "Build CGAL from release in directory ${CGAL_RELEASE_NAME}") set(CGAL_CONFIGURED_PACKAGES_NAMES ${CGAL_RELEASE_NAME}) # list packages set(CGAL_CONFIGURED_PACKAGES "${CMAKE_SOURCE_DIR}") - set(CGAL_INSTALLATION_PACKAGE_DIR "${CMAKE_SOURCE_DIR}" CACHE INTERNAL "Directory containing the Installation package") - set(CGAL_MAINTENANCE_PACKAGE_DIR "${CMAKE_SOURCE_DIR}" CACHE INTERNAL "Directory containing the Maintenance package") - set(CGAL_CORE_PACKAGE_DIR "${CMAKE_SOURCE_DIR}" CACHE INTERNAL "Directory containing the Core package") - set(CGAL_GRAPHICSVIEW_PACKAGE_DIR "${CMAKE_SOURCE_DIR}" CACHE INTERNAL "Directory containing the GraphicsView package") + set(CGAL_INSTALLATION_PACKAGE_DIR + "${CMAKE_SOURCE_DIR}" + CACHE INTERNAL "Directory containing the Installation package") + set(CGAL_MAINTENANCE_PACKAGE_DIR + "${CMAKE_SOURCE_DIR}" + CACHE INTERNAL "Directory containing the Maintenance package") + set(CGAL_CORE_PACKAGE_DIR + "${CMAKE_SOURCE_DIR}" + CACHE INTERNAL "Directory containing the Core package") + set(CGAL_GRAPHICSVIEW_PACKAGE_DIR + "${CMAKE_SOURCE_DIR}" + CACHE INTERNAL "Directory containing the GraphicsView package") # Enable testing with BUILD_TESTING option(BUILD_TESTING "Build the testing tree." OFF) if(BUILD_TESTING AND NOT POLICY CMP0064) - message(FATAL_ERROR "CGAL support of CTest requires CMake version 3.4 or later. + message( + FATAL_ERROR "CGAL support of CTest requires CMake version 3.4 or later. The variable BUILD_TESTING must be set of OFF.") endif() if(BUILD_TESTING) enable_testing() endif() -endif (CGAL_BRANCH_BUILD ) +endif(CGAL_BRANCH_BUILD) #message(STATUS "Packages found: ${CGAL_CONFIGURED_PACKAGES}") @@ -121,48 +145,55 @@ if(IS_DIRECTORY "${CMAKE_SOURCE_DIR}/Documentation") # We need this variable in the Doxygen configuration process. Reset it # and change the scope to the parent scope. # Philipp Moeller, 2013-05-302013-05-302013-05-30 - set(CGAL_CONFIGURED_PACKAGES_NAMES ${CGAL_CONFIGURED_PACKAGES_NAMES} PARENT_SCOPE) + set(CGAL_CONFIGURED_PACKAGES_NAMES + ${CGAL_CONFIGURED_PACKAGES_NAMES} + PARENT_SCOPE) endif() message(STATUS "Packagenames: ${CGAL_CONFIGURED_PACKAGES_NAMES}") -message( "== Setting paths (DONE) ==\n" ) +message("== Setting paths (DONE) ==\n") -message( "== Generate version files ==") +message("== Generate version files ==") -if ( CGAL_BRANCH_BUILD ) +if(CGAL_BRANCH_BUILD) # # Create version files # file(REMOVE ${CMAKE_BINARY_DIR}/VERSION) - if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) - set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") + if(CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) + set(CGAL_CREATED_VERSION_NUM + "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") else() set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}") endif() # Accessed in the documentation. - set(CGAL_CREATED_VERSION_NUM ${CGAL_CREATED_VERSION_NUM} PARENT_SCOPE) + set(CGAL_CREATED_VERSION_NUM + ${CGAL_CREATED_VERSION_NUM} + PARENT_SCOPE) # TODO EBEB set number of internal release (replace "900") set(CGAL_BUILD_VERSION 900) - set(CGAL_CREATED_VERSION "${CGAL_CREATED_VERSION_NUM}-I-${CGAL_BUILD_VERSION}") + set(CGAL_CREATED_VERSION + "${CGAL_CREATED_VERSION_NUM}-I-${CGAL_BUILD_VERSION}") set(CGAL_VERSION "${CGAL_CREATED_VERSION_NUM}-I-${CGAL_BUILD_VERSION}") file(WRITE "${CMAKE_BINARY_DIR}/VERSION" "${CGAL_CREATED_VERSION_NUM}") message(STATUS "CGAL_VERSION is ${CGAL_CREATED_VERSION}") - set(CGAL_FULL_VERSION ${CGAL_CREATED_VERSION} CACHE INTERNAL "CGAL version") - + set(CGAL_FULL_VERSION + ${CGAL_CREATED_VERSION} + CACHE INTERNAL "CGAL version") #define CGAL_VERSION_NR 1030500135 - string (LENGTH "${CGAL_MAJOR_VERSION}" CGAL_MAJOR_LEN) - if ("${CGAL_MAJOR_LEN}" EQUAL 1) + string(LENGTH "${CGAL_MAJOR_VERSION}" CGAL_MAJOR_LEN) + if("${CGAL_MAJOR_LEN}" EQUAL 1) set(CGAL_TMP_MAJOR "0${CGAL_MAJOR_VERSION}") endif() - string (LENGTH "${CGAL_MINOR_VERSION}" CGAL_MINOR_LEN) - if ("${CGAL_MINOR_LEN}" EQUAL 1) + string(LENGTH "${CGAL_MINOR_VERSION}" CGAL_MINOR_LEN) + if("${CGAL_MINOR_LEN}" EQUAL 1) set(CGAL_TMP_MINOR "0${CGAL_MINOR_VERSION}") else() set(CGAL_TMP_MINOR "${CGAL_MINOR_VERSION}") @@ -176,40 +207,46 @@ if ( CGAL_BRANCH_BUILD ) string(LENGTH "${CGAL_TMP_BUILD}" CGAL_BUILD_LEN) endwhile() - set(CGAL_CREATED_VERSION_NR "1${CGAL_TMP_MAJOR}${CGAL_TMP_MINOR}${CGAL_BUGFIX_VERSION}${CGAL_TMP_BUILD}") + set(CGAL_CREATED_VERSION_NR + "1${CGAL_TMP_MAJOR}${CGAL_TMP_MINOR}${CGAL_BUGFIX_VERSION}${CGAL_TMP_BUILD}" + ) message(STATUS "CGAL_VERSION_NR is ${CGAL_CREATED_VERSION_NR}") message(STATUS "CGAL_GIT_HASH is ${CGAL_GIT_HASH}") - message(STATUS "CGAL_CREATED_SVN_REVISION is ${CGAL_CREATED_SVN_REVISION} (dummy)") + message( + STATUS "CGAL_CREATED_SVN_REVISION is ${CGAL_CREATED_SVN_REVISION} (dummy)") file(REMOVE ${CMAKE_BINARY_DIR}/include/CGAL/version.h) string(TIMESTAMP CGAL_CREATED_RELEASE_DATE "%Y%m%d") - configure_file(${CGAL_INSTALLATION_PACKAGE_DIR}/cmake/modules/config/version.h.in ${CMAKE_BINARY_DIR}/include/CGAL/version.h @ONLY) + configure_file( + ${CGAL_INSTALLATION_PACKAGE_DIR}/cmake/modules/config/version.h.in + ${CMAKE_BINARY_DIR}/include/CGAL/version.h @ONLY) # # Duplicate files # - if (CGAL_REPORT_DUPLICATE_FILES) + if(CGAL_REPORT_DUPLICATE_FILES) message("== Searching for duplicate files ==") - foreach (package ${CGAL_CONFIGURED_PACKAGES}) + foreach(package ${CGAL_CONFIGURED_PACKAGES}) - file(GLOB_RECURSE CGAL_PACKAGE_HEADER_FILES FOLLOW_SYMLINKS ${package}/*.h) + file(GLOB_RECURSE CGAL_PACKAGE_HEADER_FILES FOLLOW_SYMLINKS + ${package}/*.h) list(SORT CGAL_PACKAGE_HEADER_FILES) - foreach (file ${CGAL_PACKAGE_HEADER_FILES}) + foreach(file ${CGAL_PACKAGE_HEADER_FILES}) string(REPLACE "${package}/" "" pure_file ${file}) - if (NOT ${pure_file} MATCHES ".*CMakeFiles.*") + if(NOT ${pure_file} MATCHES ".*CMakeFiles.*") list(APPEND CGAL_HEADER_FILES ${pure_file}) endif() endforeach() file(GLOB_RECURSE CGAL_PACKAGE_CPP_FILES FOLLOW_SYMLINKS ${package}/*.cpp) list(SORT CGAL_PACKAGE_CPP_FILES) - foreach (file ${CGAL_PACKAGE_CPP_FILES}) + foreach(file ${CGAL_PACKAGE_CPP_FILES}) string(REPLACE "${package}/" "" pure_file ${file}) - if (NOT ${pure_file} MATCHES ".*CMakeFiles.*") + if(NOT ${pure_file} MATCHES ".*CMakeFiles.*") list(APPEND CGAL_CPP_FILES ${pure_file}) endif() endforeach() @@ -221,76 +258,87 @@ if ( CGAL_BRANCH_BUILD ) set(CGAL_DUPLICATE_HEADER_FILES ${CGAL_HEADER_FILES}) list(REMOVE_DUPLICATES CGAL_UNIQUE_HEADER_FILES) #message(STATUS "Headers: ${CGAL_HEADER_FILES}") - foreach (file ${CGAL_UNIQUE_HEADER_FILES}) + foreach(file ${CGAL_UNIQUE_HEADER_FILES}) list(FIND CGAL_DUPLICATE_HEADER_FILES "${file}" CGAL_FILE_IDX) list(REMOVE_AT CGAL_DUPLICATE_HEADER_FILES ${CGAL_FILE_IDX}) endforeach() - message(STATUS "Duplicate header files (will be repeated at end): ${CGAL_DUPLICATE_HEADER_FILES}") + message( + STATUS + "Duplicate header files (will be repeated at end): ${CGAL_DUPLICATE_HEADER_FILES}" + ) list(SORT CGAL_CPP_FILES) set(CGAL_UNIQUE_CPP_FILES ${CGAL_CPP_FILES}) set(CGAL_DUPLICATE_CPP_FILES ${CGAL_CPP_FILES}) list(REMOVE_DUPLICATES CGAL_UNIQUE_CPP_FILES) #message(STATUS "CPPs: ${CGAL_CPP_FILES}") - foreach (file ${CGAL_UNIQUE_CPP_FILES}) + foreach(file ${CGAL_UNIQUE_CPP_FILES}) list(FIND CGAL_DUPLICATE_CPP_FILES "${file}" CGAL_FILE_IDX) list(REMOVE_AT CGAL_DUPLICATE_CPP_FILES ${CGAL_FILE_IDX}) endforeach() - message(STATUS "Duplicate cpp files (will be repeated at end): ${CGAL_DUPLICATE_CPP_FILES}") + message( + STATUS + "Duplicate cpp files (will be repeated at end): ${CGAL_DUPLICATE_CPP_FILES}" + ) endif(CGAL_REPORT_DUPLICATE_FILES) else() - if (NOT EXISTS "${CMAKE_SOURCE_DIR}/VERSION" OR NOT EXISTS "${CMAKE_SOURCE_DIR}/include/CGAL/version.h") - message(FATAL_ERROR "File VERSION or include/CGAL/version.h are missing, required by release-build.") + if(NOT EXISTS "${CMAKE_SOURCE_DIR}/VERSION" + OR NOT EXISTS "${CMAKE_SOURCE_DIR}/include/CGAL/version.h") + message( + FATAL_ERROR + "File VERSION or include/CGAL/version.h are missing, required by release-build." + ) endif() # # Read and parse CGAL version number from VERSION file # - file( READ "${CMAKE_SOURCE_DIR}/VERSION" CGAL_VERSION ) + file(READ "${CMAKE_SOURCE_DIR}/VERSION" CGAL_VERSION) # Comment from Laurent Rineau, 2012/06/28: # file(READ ..) should be replace by file(STRINGS ..), and then we take # the first line. That would avoid parsing errors when the VERSION file # contains a CR character! set(CGAL_FULL_VERSION ${CGAL_VERSION}) - string( REPLACE "-" "." CGAL_VERSION_TOKENS1 ${CGAL_VERSION} ) - string( REPLACE "." ";" CGAL_VERSION_TOKENS ${CGAL_VERSION_TOKENS1} ) - list( LENGTH CGAL_VERSION_TOKENS CGAL_VERSION_TOKENS_LEN ) - list( GET CGAL_VERSION_TOKENS 0 CGAL_MAJOR_VERSION ) + string(REPLACE "-" "." CGAL_VERSION_TOKENS1 ${CGAL_VERSION}) + string(REPLACE "." ";" CGAL_VERSION_TOKENS ${CGAL_VERSION_TOKENS1}) + list(LENGTH CGAL_VERSION_TOKENS CGAL_VERSION_TOKENS_LEN) + list(GET CGAL_VERSION_TOKENS 0 CGAL_MAJOR_VERSION) set(CGAL_MINOR_VERSION) set(CGAL_BUGFIX_VERSION) set(CGAL_BUILD_VERSION 1000) - if ( CGAL_VERSION_TOKENS_LEN GREATER 1 ) - list( GET CGAL_VERSION_TOKENS 1 CGAL_MINOR_VERSION ) + if(CGAL_VERSION_TOKENS_LEN GREATER 1) + list(GET CGAL_VERSION_TOKENS 1 CGAL_MINOR_VERSION) endif() - if ( CGAL_VERSION_TOKENS_LEN GREATER 2 ) - list( GET CGAL_VERSION_TOKENS 2 CGAL_BUGFIX_VERSION ) + if(CGAL_VERSION_TOKENS_LEN GREATER 2) + list(GET CGAL_VERSION_TOKENS 2 CGAL_BUGFIX_VERSION) # The following condition will be true the token #2 is not a number (if # it is for example "I" or "Ic"): if(NOT CGAL_BUGFIX_VERSION GREATER 0 AND NOT CGAL_BUGFIX_VERSION EQUAL 0) set(CGAL_BUGFIX_VERSION 0) - if( CGAL_VERSION_TOKENS_LEN GREATER 3 ) - list( GET CGAL_VERSION_TOKENS 3 CGAL_BUILD_VERSION ) + if(CGAL_VERSION_TOKENS_LEN GREATER 3) + list(GET CGAL_VERSION_TOKENS 3 CGAL_BUILD_VERSION) endif() else() - if( CGAL_VERSION_TOKENS_LEN GREATER 4 ) - list( GET CGAL_VERSION_TOKENS 4 CGAL_BUILD_VERSION ) + if(CGAL_VERSION_TOKENS_LEN GREATER 4) + list(GET CGAL_VERSION_TOKENS 4 CGAL_BUILD_VERSION) endif() endif() # If CGAL_BUILD_VERSION is not a strictly positive number, error if(NOT CGAL_BUILD_VERSION GREATER 0) - message(WARNING - "Error parsing VERSION file: CGAL_BUILD_VERSION is not a number.\n" - "The content of the VERSION file is:\n${CGAL_VERSION}\n" - "CGAL_BUILD_VERSION was set to:\n${CGAL_BUILD_VERSION}") + message( + WARNING + "Error parsing VERSION file: CGAL_BUILD_VERSION is not a number.\n" + "The content of the VERSION file is:\n${CGAL_VERSION}\n" + "CGAL_BUILD_VERSION was set to:\n${CGAL_BUILD_VERSION}") set(CGAL_BUILD_VERSION 1000) endif() endif() @@ -300,24 +348,24 @@ else() endif() if(CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) - set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") + set(CGAL_CREATED_VERSION_NUM + "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") else() set(CGAL_CREATED_VERSION_NUM "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}") endif() endif() - #-------------------------------------------------------------------------------------------------- # # -= BASIC SETUP =- # #-------------------------------------------------------------------------------------------------- -message( STATUS "CGAL_MAJOR_VERSION=${CGAL_MAJOR_VERSION}" ) -message( STATUS "CGAL_MINOR_VERSION=${CGAL_MINOR_VERSION}" ) -message( STATUS "CGAL_BUGFIX_VERSION=${CGAL_BUGFIX_VERSION}" ) +message(STATUS "CGAL_MAJOR_VERSION=${CGAL_MAJOR_VERSION}") +message(STATUS "CGAL_MINOR_VERSION=${CGAL_MINOR_VERSION}") +message(STATUS "CGAL_BUGFIX_VERSION=${CGAL_BUGFIX_VERSION}") if(CGAL_BUILD_VERSION LESS 1000) - message( STATUS "CGAL_BUILD_VERSION=${CGAL_BUILD_VERSION}" ) + message(STATUS "CGAL_BUILD_VERSION=${CGAL_BUILD_VERSION}") endif() # SONAME, SOVERSION @@ -363,33 +411,34 @@ endif() # CGAL-4.14 : 13.0.3 , for other libraries # ¹) According to http://upstream-tracker.org/versions/cgal.html -set( CGAL_SONAME_VERSION "13" ) -set( CGAL_SOVERSION "13.0.3" ) -set( CGAL_ImageIO_SONAME_VERSION "14" ) -set( CGAL_ImageIO_SOVERSION "14.0.0" ) -set( CGAL_Qt5_SONAME_VERSION "14" ) -set( CGAL_Qt5_SOVERSION "14.0.0" ) +set(CGAL_SONAME_VERSION "13") +set(CGAL_SOVERSION "13.0.3") +set(CGAL_ImageIO_SONAME_VERSION "14") +set(CGAL_ImageIO_SOVERSION "14.0.0") +set(CGAL_Qt5_SONAME_VERSION "14") +set(CGAL_Qt5_SOVERSION "14.0.0") -message( STATUS "CGAL_SONAME_VERSION=${CGAL_SONAME_VERSION}" ) -message( STATUS "CGAL_SOVERSION =${CGAL_SOVERSION}" ) -set( CGAL_BUILDING_LIBS TRUE ) +message(STATUS "CGAL_SONAME_VERSION=${CGAL_SONAME_VERSION}") +message(STATUS "CGAL_SOVERSION =${CGAL_SOVERSION}") +set(CGAL_BUILDING_LIBS TRUE) -set( CGAL_VERSION_DIR CGAL-${CGAL_VERSION} ) -set( CGAL_MODULES_REL_DIR cmake/modules ) -set( CGAL_MODULES_DIR ${CGAL_INSTALLATION_PACKAGE_DIR}/${CGAL_MODULES_REL_DIR} ) +set(CGAL_VERSION_DIR CGAL-${CGAL_VERSION}) +set(CGAL_MODULES_REL_DIR cmake/modules) +set(CGAL_MODULES_DIR ${CGAL_INSTALLATION_PACKAGE_DIR}/${CGAL_MODULES_REL_DIR}) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) include(${CGAL_MODULES_DIR}/CGAL_enable_end_of_configuration_hook.cmake) cgal_setup_module_path() -if ( RUNNING_CGAL_AUTO_TEST ) +if(RUNNING_CGAL_AUTO_TEST) message(STATUS "Operating system:") - execute_process(COMMAND uname -a + execute_process( + COMMAND uname -a TIMEOUT 5 OUTPUT_VARIABLE uname_a ERROR_VARIABLE uname_a) message(STATUS "${uname_a}") - CGAL_display_compiler_version() + cgal_display_compiler_version() endif() include(CGAL_Common) @@ -399,8 +448,11 @@ include(CGAL_add_test) mark_as_advanced(CMAKE_BACKWARDS_COMPATIBILITY) -message( STATUS "USING CMake version: ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" ) -message( STATUS "System: ${CMAKE_SYSTEM_NAME}" ) +message( + STATUS + "USING CMake version: ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" +) +message(STATUS "System: ${CMAKE_SYSTEM_NAME}") #-------------------------------------------------------------------------------------------------- # @@ -408,98 +460,104 @@ message( STATUS "System: ${CMAKE_SYSTEM_NAME}" ) # #-------------------------------------------------------------------------------------------------- -if( MSVC ) +if(MSVC) - uniquely_add_flags ( CGAL_CXX_FLAGS "-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS" ) - uniquely_add_flags ( CGAL_CXX_FLAGS "/fp:strict" ) - uniquely_add_flags ( CGAL_CXX_FLAGS "/fp:except-" ) - uniquely_add_flags ( CGAL_CXX_FLAGS "/wd4503" ) # Suppress warnings C4503 about "decorated name length exceeded" - uniquely_add_flags ( CGAL_CXX_FLAGS "/bigobj" ) # Use /bigobj by default + uniquely_add_flags(CGAL_CXX_FLAGS + "-D_SCL_SECURE_NO_DEPRECATE;-D_SCL_SECURE_NO_WARNINGS") + uniquely_add_flags(CGAL_CXX_FLAGS "/fp:strict") + uniquely_add_flags(CGAL_CXX_FLAGS "/fp:except-") + uniquely_add_flags(CGAL_CXX_FLAGS "/wd4503" + )# Suppress warnings C4503 about "decorated name length exceeded" + uniquely_add_flags(CGAL_CXX_FLAGS "/bigobj") # Use /bigobj by default - if ( RUNNING_CGAL_AUTO_TEST ) - set(CMAKE_CXX_WARNING_LEVEL 2 CACHE STRING "MSVC C++ compiler warning level" FORCE) + if(RUNNING_CGAL_AUTO_TEST) + set(CMAKE_CXX_WARNING_LEVEL + 2 + CACHE STRING "MSVC C++ compiler warning level" FORCE) mark_as_advanced(CMAKE_CXX_WARNING_LEVEL) endif() endif() -if( "\"${CMAKE_CXX_COMPILER_ID}\"" MATCHES "SunPro" ) - message( STATUS "Using SunPro compiler, using STLPort 4." ) +if("\"${CMAKE_CXX_COMPILER_ID}\"" MATCHES "SunPro") + message(STATUS "Using SunPro compiler, using STLPort 4.") - uniquely_add_flags( CGAL_CXX_FLAGS "-features=extensions;-library=stlport4;-D_GNU_SOURCE" ) - uniquely_add_flags( CGAL_SHARED_LINKER_FLAGS "-library=stlport4" ) - uniquely_add_flags( CGAL_EXE_LINKER_FLAGS "-library=stlport4" ) + uniquely_add_flags(CGAL_CXX_FLAGS + "-features=extensions;-library=stlport4;-D_GNU_SOURCE") + uniquely_add_flags(CGAL_SHARED_LINKER_FLAGS "-library=stlport4") + uniquely_add_flags(CGAL_EXE_LINKER_FLAGS "-library=stlport4") endif() -if( "${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") - message( STATUS "Intel compiler is detected." ) - set( IntelCompiler_FOUND TRUE ) +if("${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES + "icpc") + message(STATUS "Intel compiler is detected.") + set(IntelCompiler_FOUND TRUE) get_dependency_version(IntelCompiler) - if( "${IntelCompiler_VERSION}" LESS "1100" ) - message("Intel Compiler version ${IntelCompiler_VERSION} is not supported by CGAL-${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}! (too old, must be 11.0 or after)") + if("${IntelCompiler_VERSION}" LESS "1100") + message( + "Intel Compiler version ${IntelCompiler_VERSION} is not supported by CGAL-${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}! (too old, must be 11.0 or after)" + ) else() - message( STATUS "Using Intel Compiler version 11 or later. Adding -fp-model strict" ) + message( + STATUS "Using Intel Compiler version 11 or later. Adding -fp-model strict" + ) if(WIN32) - uniquely_add_flags( CGAL_CXX_FLAGS "/fp:strict" ) + uniquely_add_flags(CGAL_CXX_FLAGS "/fp:strict") else() - uniquely_add_flags( CGAL_CXX_FLAGS "-fp-model strict" ) + uniquely_add_flags(CGAL_CXX_FLAGS "-fp-model strict") endif() endif() endif() +if(CMAKE_COMPILER_IS_GNUCXX) -if ( CMAKE_COMPILER_IS_GNUCXX ) - - set( GCC_FOUND TRUE ) + set(GCC_FOUND TRUE) get_dependency_version(GCC) - if ( "${GCC_VERSION}" MATCHES "Not" OR "${GCC_VERSION}" MATCHES "Unknown" ) - set( GCC_FOUND FALSE ) + if("${GCC_VERSION}" MATCHES "Not" OR "${GCC_VERSION}" MATCHES "Unknown") + set(GCC_FOUND FALSE) endif() - if ( GCC_FOUND ) + if(GCC_FOUND) - if ( RUNNING_CGAL_AUTO_TEST ) - uniquely_add_flags( CGAL_CXX_FLAGS "-Wall" ) + if(RUNNING_CGAL_AUTO_TEST) + uniquely_add_flags(CGAL_CXX_FLAGS "-Wall") # Remove -g from the relevant CMAKE_CXX_FLAGS. This will also # propagate to the rest of the tests, since we overwrite those # flags with the ones used to build CGAL. - string(REGEX REPLACE "-g( |$)" "" - CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS}") + string(REGEX REPLACE "-g( |$)" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # We only allow the release types DEBUG and RELEASE, but handle # all possible values just to be sure. foreach(release_type DEBUG RELEASE MINSIZEREL RELWITHDEBINFO) - string(REGEX REPLACE "-g( |$)" "" - CMAKE_CXX_FLAGS_${release_type} - "${CMAKE_CXX_FLAGS_${release_type}}") + string(REGEX REPLACE "-g( |$)" "" CMAKE_CXX_FLAGS_${release_type} + "${CMAKE_CXX_FLAGS_${release_type}}") endforeach() endif() - if ( "${GCC_VERSION}" MATCHES "^[4-9]." ) - message( STATUS "Using gcc version 4 or later. Adding -frounding-math" ) - uniquely_add_flags( CGAL_CXX_FLAGS "-frounding-math" ) + if("${GCC_VERSION}" MATCHES "^[4-9].") + message(STATUS "Using gcc version 4 or later. Adding -frounding-math") + uniquely_add_flags(CGAL_CXX_FLAGS "-frounding-math") endif() - if ( "${GCC_VERSION}" MATCHES "^4.2" ) - message( STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing" ) - uniquely_add_flags( CGAL_CXX_FLAGS "-fno-strict-aliasing" ) + if("${GCC_VERSION}" MATCHES "^4.2") + message(STATUS "Using gcc version 4.2. Adding -fno-strict-aliasing") + uniquely_add_flags(CGAL_CXX_FLAGS "-fno-strict-aliasing") endif() - if ( "${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha" ) - message( STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d" ) - uniquely_add_flags( CGAL_CXX_FLAGS "-mieee -mfp-rounding-mode=d" ) + if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "alpha") + message(STATUS "Using gcc on alpha. Adding -mieee -mfp-rounding-mode=d") + uniquely_add_flags(CGAL_CXX_FLAGS "-mieee -mfp-rounding-mode=d") endif() endif() endif() -message( "== Generate version files (DONE) ==\n") +message("== Generate version files (DONE) ==\n") #-------------------------------------------------------------------------------------------------- # @@ -507,7 +565,7 @@ message( "== Generate version files (DONE) ==\n") # #-------------------------------------------------------------------------------------------------- -if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST ) +if(CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST) message("== Set up flags ==") # Ugly hack to be compatible with current CGAL testsuite process (as of @@ -516,7 +574,7 @@ if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST ) message("== Set up flags (DONE) ==\n") else() - include( CGAL_display_flags ) + include(CGAL_display_flags) endif() message("== Detect external libraries ==") @@ -526,16 +584,34 @@ message("== Detect external libraries ==") # External libs configured when Qt5 lib of cgal are required # Coin is used in KDS, but no FindCoin or FindCOIN exists # There exists FindIPE, FindMKL, but they are only used to support supporting libs -list (INSERT CGAL_SUPPORTING_3RD_PARTY_LIBRARIES 0 GMP MPFR ZLIB OpenGL LEDA MPFI RS RS3 OpenNL Eigen3 ESBTL Coin3D NTL IPE) +list( + INSERT + CGAL_SUPPORTING_3RD_PARTY_LIBRARIES + 0 + GMP + MPFR + ZLIB + OpenGL + LEDA + MPFI + RS + RS3 + OpenNL + Eigen3 + ESBTL + Coin3D + NTL + IPE) # Where CMake is run several times, to avoid duplicates list(REMOVE_DUPLICATES CGAL_SUPPORTING_3RD_PARTY_LIBRARIES) hide_variable(CGAL_SUPPORTING_3RD_PARTY_LIBRARIES) # set some to have special prefix -macro( set_special_prefix library prefix) -set(SPECIAL_PREFIXES "${SPECIAL_PREFIXES}set(CGAL_EXT_LIB_${library}_PREFIX \"${prefix}\")\n") -set(CGAL_EXT_LIB_${library}_PREFIX ${prefix}) +macro(set_special_prefix library prefix) + set(SPECIAL_PREFIXES + "${SPECIAL_PREFIXES}set(CGAL_EXT_LIB_${library}_PREFIX \"${prefix}\")\n") + set(CGAL_EXT_LIB_${library}_PREFIX ${prefix}) endmacro() set_special_prefix(Qt5 QT) @@ -544,7 +620,9 @@ set_special_prefix(Coin3D COIN3D) # some libraries are essential (stl and Boost.Thread are treated in another way) if($ENV{CGAL_DISABLE_GMP}) - set(CGAL_DISABLE_GMP ON CACHE INTERNAL "") + set(CGAL_DISABLE_GMP + ON + CACHE INTERNAL "") endif() if(CGAL_DISABLE_GMP) message("Disable the GMP support") @@ -571,18 +649,18 @@ if(CGAL_DISABLE_GMP) # Nasty trick to make sure is not used when CGAL_DISABLE_GMP is TRUE file(WRITE "${CMAKE_BINARY_DIR}/include/gmp.h" - "#error GMP is disabled by the CMake option CGAL_DISABLE_GMP") + "#error GMP is disabled by the CMake option CGAL_DISABLE_GMP") else() - list(APPEND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR) + list(APPEND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES GMP MPFR) # When CMake is run several times, to avoid duplicates - list (REMOVE_DUPLICATES CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES) + list(REMOVE_DUPLICATES CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES) file(REMOVE "${CMAKE_BINARY_DIR}/include/gmp.h") endif() hide_variable(CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES) -foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) +foreach(lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) # set standard prefix if(NOT DEFINED CGAL_EXT_LIB_${lib}_PREFIX) @@ -591,8 +669,8 @@ foreach (lib ${CGAL_SUPPORTING_3RD_PARTY_LIBRARIES}) hide_variable(CGAL_EXT_LIB_${lib}_PREFIX) # add option - list( FIND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "${lib}" POSITION ) - if ( "${POSITION}" STRGREATER "-1" ) # if lib is essential + list(FIND CGAL_ESSENTIAL_3RD_PARTY_LIBRARIES "${lib}" POSITION) + if("${POSITION}" STRGREATER "-1") # if lib is essential option(WITH_${lib} "Select external library ${lib}" ON) else() option(WITH_${lib} "Select external library ${lib}" OFF) @@ -611,15 +689,16 @@ endforeach() # But they are not intended to persist from run to run as normal cache variables. # Similar variables are created when a library is detected. # -cache_set(CGAL_3RD_PARTY_PRECONFIGURED "" ) +cache_set(CGAL_3RD_PARTY_PRECONFIGURED "") -cache_set(CGAL_3RD_PARTY_DEFINITIONS "" ) -cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS "" ) -cache_set(CGAL_3RD_PARTY_LIBRARIES "" ) -cache_set(CGAL_3RD_PARTY_LIBRARIES_DIRS "" ) +cache_set(CGAL_3RD_PARTY_DEFINITIONS "") +cache_set(CGAL_3RD_PARTY_INCLUDE_DIRS "") +cache_set(CGAL_3RD_PARTY_LIBRARIES "") +cache_set(CGAL_3RD_PARTY_LIBRARIES_DIRS "") # default is on, but some use-cases need to set it to off, e.g., debian packages -option( CGAL_ENABLE_PRECONFIG "Select to allow to preconfiguration of external libraries" ON) +option(CGAL_ENABLE_PRECONFIG + "Select to allow to preconfiguration of external libraries" ON) # additional info: some header files in CGAL add additional code if # certain optional libs are installed, and some examples/tests rely on @@ -639,66 +718,73 @@ message("== Detect external libraries (DONE) ==\n") #-------------------------------------------------------------------------------------------------- if(NOT CGAL_HEADER_ONLY) -# The variables set are the #defines expected by compiler_config.h -# Note: CMake will not notice when files are added or removed -# but this is probably OK for the installation procedure. + # The variables set are the #defines expected by compiler_config.h + # Note: CMake will not notice when files are added or removed + # but this is probably OK for the installation procedure. -message("== Write compiler_config.h ==") + message("== Write compiler_config.h ==") -macro(add_config_flag flag) - if(${flag}) - file(APPEND ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "#define ${flag} 1\n\n") + macro(add_config_flag flag) + if(${flag}) + file(APPEND ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h + "#define ${flag} 1\n\n") else() - file(APPEND ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "//#define ${flag} 1\n\n") + file(APPEND ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h + "//#define ${flag} 1\n\n") endif() -endmacro() + endmacro() -if(NOT CMAKE_CROSSCOMPILING) - file(GLOB all_config_tests "${CGAL_MODULES_DIR}/config/testfiles/*.cpp") - list(SORT all_config_tests) + if(NOT CMAKE_CROSSCOMPILING) + file(GLOB all_config_tests "${CGAL_MODULES_DIR}/config/testfiles/*.cpp") + list(SORT all_config_tests) - file(WRITE ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h "//\n// compiler_config.h is included by CGAL headers to load the needed compiler settings.\n//\n// DO NOT EDIT compiler_config.h. It is generated by CMake.\n//\n\n") + file( + WRITE ${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h + "//\n// compiler_config.h is included by CGAL headers to load the needed compiler settings.\n//\n// DO NOT EDIT compiler_config.h. It is generated by CMake.\n//\n\n" + ) - foreach(config_test_cpp ${all_config_tests}) - # Test's name is .cpp's base name - get_filename_component(config_test_name ${config_test_cpp} NAME_WE) + foreach(config_test_cpp ${all_config_tests}) + # Test's name is .cpp's base name + get_filename_component(config_test_name ${config_test_cpp} NAME_WE) - # Compile and run ${config_test_cpp}. Exit code is stored in ${config_test_name}. - CHECK_CXX_FILE_RUNS(${config_test_cpp} ${config_test_name} ${config_test_name}) - if(${config_test_name}) - set(${config_test_name} 0) - else() - set(${config_test_name} 1) - endif() + # Compile and run ${config_test_cpp}. Exit code is stored in ${config_test_name}. + check_cxx_file_runs(${config_test_cpp} ${config_test_name} + ${config_test_name}) + if(${config_test_name}) + set(${config_test_name} 0) + else() + set(${config_test_name} 1) + endif() - add_config_flag(${config_test_name} ${config_test_name}) - endforeach() -endif() + add_config_flag(${config_test_name} ${config_test_name}) + endforeach() + endif() -add_config_flag(CGAL_USE_GMP) -add_config_flag(CGAL_USE_MPFR) -add_config_flag(CGAL_USE_GMPXX) -add_config_flag(CGAL_USE_LEDA) -add_config_flag(CGAL_USE_MPFI) -add_config_flag(CGAL_USE_RS) -add_config_flag(CGAL_USE_NTL) + add_config_flag(CGAL_USE_GMP) + add_config_flag(CGAL_USE_MPFR) + add_config_flag(CGAL_USE_GMPXX) + add_config_flag(CGAL_USE_LEDA) + add_config_flag(CGAL_USE_MPFI) + add_config_flag(CGAL_USE_RS) + add_config_flag(CGAL_USE_NTL) -add_config_flag( CGAL_BUILD_SHARED_LIBS ) + add_config_flag(CGAL_BUILD_SHARED_LIBS) -if (NOT ${WITH_CGAL_Core}) - set(CGAL_USE_CORE FALSE) -else() - set(CGAL_USE_CORE ${CGAL_USE_GMP}) -endif() -add_config_flag( CGAL_USE_CORE ) -# ^^ there is CGAL_USE_CORE and not CGAL_HAS_CORE, as CORE is considered -# as external lib and not as CGAL component (EBEB: 24 Jan 2012) + if(NOT ${WITH_CGAL_Core}) + set(CGAL_USE_CORE FALSE) + else() + set(CGAL_USE_CORE ${CGAL_USE_GMP}) + endif() + add_config_flag(CGAL_USE_CORE) + # ^^ there is CGAL_USE_CORE and not CGAL_HAS_CORE, as CORE is considered + # as external lib and not as CGAL component (EBEB: 24 Jan 2012) -if ( RUNNING_CGAL_AUTO_TEST AND MSVC ) - file( APPEND "${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h" "#include \n\n" ) -endif() + if(RUNNING_CGAL_AUTO_TEST AND MSVC) + file(APPEND "${CMAKE_BINARY_DIR}/include/CGAL/compiler_config.h" + "#include \n\n") + endif() -message("== Write compiler_config.h (DONE) ==\n") + message("== Write compiler_config.h (DONE) ==\n") endif(NOT CGAL_HEADER_ONLY) @@ -708,29 +794,54 @@ endif(NOT CGAL_HEADER_ONLY) # #-------------------------------------------------------------------------------------------------- -set ( CGAL_INSTALL_INC_DIR "${CMAKE_INSTALL_INCLUDEDIR}" CACHE STRING "The folder where CGAL header files will be installed, relative to CMAKE_INSTALL_PREFIX" ) -set ( CGAL_INSTALL_LIB_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE STRING "The folder where CGAL libraries will be installed, relative to CMAKE_INSTALL_PREFIX" ) +set(CGAL_INSTALL_INC_DIR + "${CMAKE_INSTALL_INCLUDEDIR}" + CACHE + STRING + "The folder where CGAL header files will be installed, relative to CMAKE_INSTALL_PREFIX" +) +set(CGAL_INSTALL_LIB_DIR + "${CMAKE_INSTALL_LIBDIR}" + CACHE + STRING + "The folder where CGAL libraries will be installed, relative to CMAKE_INSTALL_PREFIX" +) -if ( CGAL_WIN32_CMAKE_ON_CYGWIN ) - exec_program(cygpath ARGS -w "${CMAKE_INSTALL_PREFIX}" OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2 ) - file ( TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX2} CMAKE_INSTALL_PREFIX ) +if(CGAL_WIN32_CMAKE_ON_CYGWIN) + exec_program( + cygpath ARGS + -w "${CMAKE_INSTALL_PREFIX}" + OUTPUT_VARIABLE CMAKE_INSTALL_PREFIX2) + file(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX2} CMAKE_INSTALL_PREFIX) endif() -set ( CGAL_INSTALL_BIN_DIR "${CMAKE_INSTALL_BINDIR}" - CACHE STRING "The folder where CGAL user-side scripts will be installed, relative to CMAKE_INSTALL_PREFIX" - ) +set(CGAL_INSTALL_BIN_DIR + "${CMAKE_INSTALL_BINDIR}" + CACHE + STRING + "The folder where CGAL user-side scripts will be installed, relative to CMAKE_INSTALL_PREFIX" +) -set ( CGAL_INSTALL_CMAKE_DIR "${CGAL_INSTALL_LIB_DIR}/cmake/CGAL" - CACHE STRING "The folder where CGAL CMake modules will be installed, relative to CMAKE_INSTALL_PREFIX" - ) +set(CGAL_INSTALL_CMAKE_DIR + "${CGAL_INSTALL_LIB_DIR}/cmake/CGAL" + CACHE + STRING + "The folder where CGAL CMake modules will be installed, relative to CMAKE_INSTALL_PREFIX" +) -set ( CGAL_INSTALL_DOC_DIR "${CMAKE_INSTALL_DOCDIR}" - CACHE STRING "The folder where CGAL documentation and license files will be installed, relative to CMAKE_INSTALL_PREFIX" - ) +set(CGAL_INSTALL_DOC_DIR + "${CMAKE_INSTALL_DOCDIR}" + CACHE + STRING + "The folder where CGAL documentation and license files will be installed, relative to CMAKE_INSTALL_PREFIX" +) -set ( CGAL_INSTALL_MAN_DIR "${CMAKE_INSTALL_MANDIR}/man1" - CACHE STRING "The folder where manual pages for CGAL scripts will be installed, relative to CMAKE_INSTALL_PREFIX" - ) +set(CGAL_INSTALL_MAN_DIR + "${CMAKE_INSTALL_MANDIR}/man1" + CACHE + STRING + "The folder where manual pages for CGAL scripts will be installed, relative to CMAKE_INSTALL_PREFIX" +) #-------------------------------------------------------------------------------------------------- # @@ -738,26 +849,25 @@ set ( CGAL_INSTALL_MAN_DIR "${CMAKE_INSTALL_MANDIR}/man1" # #-------------------------------------------------------------------------------------------------- - message("== Generating build files ==") set(CGAL_LIBRARIES_DIR ${CMAKE_BINARY_DIR}/lib) set(CGAL_INCLUDE_DIRS ${CMAKE_BINARY_DIR}/include) -foreach (package ${CGAL_CONFIGURED_PACKAGES}) +foreach(package ${CGAL_CONFIGURED_PACKAGES}) if(EXISTS ${package}/include) set(CGAL_INCLUDE_DIRS ${CGAL_INCLUDE_DIRS} ${package}/include) endif() endforeach() -include_directories (${CGAL_INCLUDE_DIRS}) +include_directories(${CGAL_INCLUDE_DIRS}) -cache_get(CGAL_3RD_PARTY_PRECONFIGURED ) +cache_get(CGAL_3RD_PARTY_PRECONFIGURED) -cache_get(CGAL_3RD_PARTY_DEFINITIONS ) -cache_get(CGAL_3RD_PARTY_INCLUDE_DIRS ) -cache_get(CGAL_3RD_PARTY_LIBRARIES ) +cache_get(CGAL_3RD_PARTY_DEFINITIONS) +cache_get(CGAL_3RD_PARTY_INCLUDE_DIRS) +cache_get(CGAL_3RD_PARTY_LIBRARIES) cache_get(CGAL_3RD_PARTY_LIBRARIES_DIRS) add_subdirectory(src) @@ -777,20 +887,21 @@ get_property(CGAL_Qt5_FOUND GLOBAL PROPERTY CGAL_Qt5_FOUND) # message("== Generating build files (DONE) ==\n") -if (CGAL_BRANCH_BUILD AND CGAL_REPORT_DUPLICATE_FILES ) +if(CGAL_BRANCH_BUILD AND CGAL_REPORT_DUPLICATE_FILES) - message( STATUS "Problems: ") + message(STATUS "Problems: ") - if (CGAL_DUPLICATE_HEADER_FILES) + if(CGAL_DUPLICATE_HEADER_FILES) message(WARNING "WARNING: Duplicate header files") foreach(hfile ${CGAL_DUPLICATE_HEADER_FILES}) message(STATUS " File '${hfile}' multiply found in ") - foreach (package ${CGAL_CONFIGURED_PACKAGES}) - file(GLOB_RECURSE CGAL_PACKAGE_HEADER_FILES FOLLOW_SYMLINKS ${package}/*.h) + foreach(package ${CGAL_CONFIGURED_PACKAGES}) + file(GLOB_RECURSE CGAL_PACKAGE_HEADER_FILES FOLLOW_SYMLINKS + ${package}/*.h) list(SORT CGAL_PACKAGE_HEADER_FILES) - foreach (file ${CGAL_PACKAGE_HEADER_FILES}) + foreach(file ${CGAL_PACKAGE_HEADER_FILES}) string(REPLACE "${package}/" "" pure_file ${file}) - if ("${pure_file}" STREQUAL "${hfile}") + if("${pure_file}" STREQUAL "${hfile}") message(STATUS " ${package}") endif() endforeach() @@ -798,16 +909,17 @@ if (CGAL_BRANCH_BUILD AND CGAL_REPORT_DUPLICATE_FILES ) endforeach() endif() - if (CGAL_DUPLICATE_CPP_FILES) + if(CGAL_DUPLICATE_CPP_FILES) message(WARNING "WARNING: Duplicate cpp files") foreach(cfile ${CGAL_DUPLICATE_CPP_FILES}) message(STATUS " File '${cfile}' multiply found in ") - foreach (package ${CGAL_CONFIGURED_PACKAGES}) - file(GLOB_RECURSE CGAL_PACKAGE_CPP_FILES FOLLOW_SYMLINKS ${package}/*.cpp) + foreach(package ${CGAL_CONFIGURED_PACKAGES}) + file(GLOB_RECURSE CGAL_PACKAGE_CPP_FILES FOLLOW_SYMLINKS + ${package}/*.cpp) list(SORT CGAL_PACKAGE_CPP_FILES) - foreach (file ${CGAL_PACKAGE_CPP_FILES}) + foreach(file ${CGAL_PACKAGE_CPP_FILES}) string(REPLACE "${package}/" "" pure_file ${file}) - if ("${pure_file}" STREQUAL "${cfile}") + if("${pure_file}" STREQUAL "${cfile}") message(STATUS " ${package}") endif() endforeach() @@ -818,12 +930,13 @@ if (CGAL_BRANCH_BUILD AND CGAL_REPORT_DUPLICATE_FILES ) endif() if(NOT CGAL_HEADER_ONLY) - create_CGALconfig_files() + create_cgalconfig_files() else() configure_file("${CGAL_MODULES_DIR}/CGALConfig_binary_header_only.cmake.in" - "${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY) - configure_file("${CGAL_MODULES_DIR}/CGALConfigVersion_binary_header_only.cmake.in" - "${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake" @ONLY) + "${CMAKE_BINARY_DIR}/CGALConfig.cmake" @ONLY) + configure_file( + "${CGAL_MODULES_DIR}/CGALConfigVersion_binary_header_only.cmake.in" + "${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake" @ONLY) endif() #-------------------------------------------------------------------------------------------------- @@ -835,64 +948,73 @@ endif() # DESTINATION option is mandatory; skipping it breaks CPack! if(CGAL_INSTALL_DOC_DIR) - install(FILES AUTHORS CHANGES.md LICENSE LICENSE.FREE_USE LICENSE.GPL LICENSE.LGPL DESTINATION ${CGAL_INSTALL_DOC_DIR} ) + install(FILES AUTHORS CHANGES.md LICENSE LICENSE.FREE_USE LICENSE.GPL + LICENSE.LGPL DESTINATION ${CGAL_INSTALL_DOC_DIR}) endif() #install all includes collected in trunk et cetera - -foreach (dir ${CGAL_CONFIGURED_PACKAGES}) - if (EXISTS ${dir}/include/CGAL) - install(DIRECTORY ${dir}/include/CGAL DESTINATION ${CGAL_INSTALL_INC_DIR} PATTERN ".svn" EXCLUDE PATTERN "Qt" EXCLUDE) +foreach(dir ${CGAL_CONFIGURED_PACKAGES}) + if(EXISTS ${dir}/include/CGAL) + install( + DIRECTORY ${dir}/include/CGAL + DESTINATION ${CGAL_INSTALL_INC_DIR} + PATTERN ".svn" EXCLUDE + PATTERN "Qt" EXCLUDE) endif() endforeach() if(EXISTS ${CMAKE_BINARY_DIR}/include/CGAL) - install(DIRECTORY ${CMAKE_BINARY_DIR}/include/CGAL DESTINATION ${CGAL_INSTALL_INC_DIR} PATTERN ".svn" EXCLUDE PATTERN "Qt" EXCLUDE) + install( + DIRECTORY ${CMAKE_BINARY_DIR}/include/CGAL + DESTINATION ${CGAL_INSTALL_INC_DIR} + PATTERN ".svn" EXCLUDE + PATTERN "Qt" EXCLUDE) endif() file(GLOB scripts "scripts/*") list(SORT scripts) list(REMOVE_ITEM scripts - ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cgal_create_assertions.sh - ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cgal_create_cmake_script_with_options) + ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cgal_create_assertions.sh + ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cgal_create_cmake_script_with_options) install(PROGRAMS ${scripts} DESTINATION ${CGAL_INSTALL_BIN_DIR}) -install(DIRECTORY ${CGAL_MODULES_REL_DIR}/ DESTINATION ${CGAL_INSTALL_CMAKE_DIR} ) -install(FILES ${CGAL_MODULES_REL_DIR}/UseCGAL.cmake DESTINATION ${CGAL_INSTALL_CMAKE_DIR} ) +install(DIRECTORY ${CGAL_MODULES_REL_DIR}/ + DESTINATION ${CGAL_INSTALL_CMAKE_DIR}) +install(FILES ${CGAL_MODULES_REL_DIR}/UseCGAL.cmake + DESTINATION ${CGAL_INSTALL_CMAKE_DIR}) -if ( IS_DIRECTORY auxiliary/gmp/include AND IS_DIRECTORY auxiliary/gmp/lib ) - install(DIRECTORY auxiliary/gmp/include/ DESTINATION ${CGAL_INSTALL_INC_DIR} ) - install(DIRECTORY auxiliary/gmp/lib/ DESTINATION ${CGAL_INSTALL_LIB_DIR} ) +if(IS_DIRECTORY auxiliary/gmp/include AND IS_DIRECTORY auxiliary/gmp/lib) + install(DIRECTORY auxiliary/gmp/include/ DESTINATION ${CGAL_INSTALL_INC_DIR}) + install(DIRECTORY auxiliary/gmp/lib/ DESTINATION ${CGAL_INSTALL_LIB_DIR}) endif() -if ( ZLIB_IN_AUXILIARY ) - install(DIRECTORY auxiliary/zlib/include/ DESTINATION ${CGAL_INSTALL_INC_DIR} ) - install(DIRECTORY auxiliary/zlib/lib/ DESTINATION ${CGAL_INSTALL_LIB_DIR} ) +if(ZLIB_IN_AUXILIARY) + install(DIRECTORY auxiliary/zlib/include/ DESTINATION ${CGAL_INSTALL_INC_DIR}) + install(DIRECTORY auxiliary/zlib/lib/ DESTINATION ${CGAL_INSTALL_LIB_DIR}) endif() - if(NOT CGAL_HEADER_ONLY) - install(FILES - ${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake - ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake - DESTINATION ${CGAL_INSTALL_CMAKE_DIR} ) + install(FILES ${CMAKE_BINARY_DIR}/CGALConfigVersion.cmake + ${CMAKE_BINARY_DIR}/config/CGALConfig.cmake + DESTINATION ${CGAL_INSTALL_CMAKE_DIR}) else() - install(FILES - ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig.cmake - ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfigBuildVersion.cmake - ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfigVersion.cmake + install( + FILES ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig.cmake + ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfigBuildVersion.cmake + ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfigVersion.cmake DESTINATION ${CGAL_INSTALL_CMAKE_DIR}) if(NOT CGAL_INSTALL_CMAKE_DIR STREQUAL "${CGAL_INSTALL_LIB_DIR}/cmake/CGAL") - configure_file(${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in + configure_file( + ${CMAKE_CURRENT_LIST_DIR}/lib/cmake/CGAL/CGALConfig-installation-dirs.cmake.in ${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake) - install(FILES - ${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake - DESTINATION ${CGAL_INSTALL_CMAKE_DIR}) + install(FILES ${CMAKE_BINARY_DIR}/config/CGALConfig-installation-dirs.cmake + DESTINATION ${CGAL_INSTALL_CMAKE_DIR}) endif() endif() if(CGAL_INSTALL_MAN_DIR) - install(FILES auxiliary/cgal_create_cmake_script.1 DESTINATION ${CGAL_INSTALL_MAN_DIR} ) + install(FILES auxiliary/cgal_create_cmake_script.1 + DESTINATION ${CGAL_INSTALL_MAN_DIR}) endif() #-------------------------------------------------------------------------------------------------- @@ -904,11 +1026,12 @@ endif() # Installing FindCGAL into cmake itself is implemented as a custom target # because it requires superuser privileges -if ( NOT "${CMAKE_ROOT}" STREQUAL "" ) - if ( EXISTS ${CMAKE_ROOT}/Modules ) - add_custom_target( install_FindCGAL - COMMAND ${CMAKE_COMMAND} -E copy ${CGAL_MODULES_DIR}/FindCGAL.cmake ${CMAKE_ROOT}/Modules - ) +if(NOT "${CMAKE_ROOT}" STREQUAL "") + if(EXISTS ${CMAKE_ROOT}/Modules) + add_custom_target( + install_FindCGAL + COMMAND ${CMAKE_COMMAND} -E copy ${CGAL_MODULES_DIR}/FindCGAL.cmake + ${CMAKE_ROOT}/Modules) endif() endif() @@ -919,38 +1042,38 @@ endif() #-------------------------------------------------------------------------------------------------- if(NOT TARGET ALL_CGAL_TARGETS) - add_custom_target( ALL_CGAL_TARGETS ) + add_custom_target(ALL_CGAL_TARGETS) endif() -macro( add_programs subdir target ON_OFF ) +macro(add_programs subdir target ON_OFF) - cache_set( CGAL_EXECUTABLE_TARGETS "" ) + cache_set(CGAL_EXECUTABLE_TARGETS "") - add_custom_target( ${target} ) - add_dependencies( ALL_CGAL_TARGETS ${target} ) + add_custom_target(${target}) + add_dependencies(ALL_CGAL_TARGETS ${target}) - option( WITH_${target} "Select ${target}" ${ON_OFF} ) - if ( WITH_${target} ) - add_subdirectory( ${subdir} EXCLUDE_FROM_ALL ) + option(WITH_${target} "Select ${target}" ${ON_OFF}) + if(WITH_${target}) + add_subdirectory(${subdir} EXCLUDE_FROM_ALL) endif() - cache_get( CGAL_EXECUTABLE_TARGETS ) + cache_get(CGAL_EXECUTABLE_TARGETS) - foreach( CGAL_EXECUTABLE_TARGET ${CGAL_EXECUTABLE_TARGETS} ) - add_dependencies( ${target} ${CGAL_EXECUTABLE_TARGET} ) + foreach(CGAL_EXECUTABLE_TARGET ${CGAL_EXECUTABLE_TARGETS}) + add_dependencies(${target} ${CGAL_EXECUTABLE_TARGET}) endforeach() endmacro() # This allows programs to locate CGALConfig.cmake -set(CGAL_DIR ${CMAKE_BINARY_DIR} ) +set(CGAL_DIR ${CMAKE_BINARY_DIR}) -if ( NOT RUNNING_CGAL_AUTO_TEST ) +if(NOT RUNNING_CGAL_AUTO_TEST) - add_programs(examples examples OFF ) - add_programs(demo demos OFF ) + add_programs(examples examples OFF) + add_programs(demo demos OFF) if(IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test") - add_programs(test tests OFF ) + add_programs(test tests OFF) endif() endif() @@ -961,60 +1084,65 @@ endif() #-------------------------------------------------------------------------------------------------- #option( WITH_CPACK "Create package generation rules") -if( WITH_CPACK AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake" ) +if(WITH_CPACK AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") - set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CGAL - Computational Geometry Algorithms Library") - set(CPACK_PACKAGE_VENDOR "CGAL Open Source Project") - set(CPACK_PACKAGE_DESCRIPTION_FILE "${CGAL_INSTALLATION_PACKAGE_DIR}/README") - set(CPACK_RESOURCE_FILE_LICENSE "${CGAL_INSTALLATION_PACKAGE_DIR}/LICENSE") - set(CPACK_PACKAGE_VERSION_MAJOR "${CGAL_MAJOR_VERSION}") - set(CPACK_PACKAGE_VERSION_MINOR "${CGAL_MINOR_VERSION}") - set(CPACK_PACKAGE_VERSION_PATCH "${CGAL_BUGFIX_VERSION}") - set(CPACK_PACKAGE_INSTALL_DIRECTORY "CGAL ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") - set(CPACK_SOURCE_PACKAGE_FILE_NAME "CGAL-${CGAL_VERSION}") - set(CPACK_RESOURCE_FILE_LICENSE "${CGAL_INSTALLATION_PACKAGE_DIR}/LICENSE") + set(CPACK_PACKAGE_DESCRIPTION_SUMMARY + "CGAL - Computational Geometry Algorithms Library") + set(CPACK_PACKAGE_VENDOR "CGAL Open Source Project") + set(CPACK_PACKAGE_DESCRIPTION_FILE "${CGAL_INSTALLATION_PACKAGE_DIR}/README") + set(CPACK_RESOURCE_FILE_LICENSE "${CGAL_INSTALLATION_PACKAGE_DIR}/LICENSE") + set(CPACK_PACKAGE_VERSION_MAJOR "${CGAL_MAJOR_VERSION}") + set(CPACK_PACKAGE_VERSION_MINOR "${CGAL_MINOR_VERSION}") + set(CPACK_PACKAGE_VERSION_PATCH "${CGAL_BUGFIX_VERSION}") + set(CPACK_PACKAGE_INSTALL_DIRECTORY + "CGAL ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") + set(CPACK_SOURCE_PACKAGE_FILE_NAME "CGAL-${CGAL_VERSION}") + set(CPACK_RESOURCE_FILE_LICENSE "${CGAL_INSTALLATION_PACKAGE_DIR}/LICENSE") - if(NOT DEFINED CPACK_SYSTEM_NAME) - set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) - endif() + if(NOT DEFINED CPACK_SYSTEM_NAME) + set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) + endif() - if(${CPACK_SYSTEM_NAME} MATCHES "Windows") - if(CMAKE_CL_64) - set(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR}) - else() - set(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR}) - endif() - endif() - - if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) - set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") - endif() - - set(CPACK_PACKAGE_EXECUTABLES "CGAL" "CGAL") - - if(WIN32 AND NOT UNIX) - set(CPACK_GENERATOR "NSIS") - # There is a bug in NSI that does not handle full unix paths properly. Make - # sure there is at least one set of four (4) backlasshes. - #set(CPACK_PACKAGE_ICON "${CGAL_INSTALLATION_PACKAGE_DIR}\\\\cgal_install.gif") - #set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\CGAL.exe") - set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} Computational Geometry Algorithms Library") - set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.cgal.org") - set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.cgal.org") - set(CPACK_NSIS_CONTACT "info@cgal.org") - set(CPACK_NSIS_MODIfY_PATH ON) + if(${CPACK_SYSTEM_NAME} MATCHES "Windows") + if(CMAKE_CL_64) + set(CPACK_SYSTEM_NAME win64-${CMAKE_SYSTEM_PROCESSOR}) else() - set(CPACK_STRIP_FILES "") - set(CPACK_SOURCE_STRIP_FILES "") + set(CPACK_SYSTEM_NAME win32-${CMAKE_SYSTEM_PROCESSOR}) endif() + endif() - include(CPack) + if(NOT DEFINED CPACK_PACKAGE_FILE_NAME) + set(CPACK_PACKAGE_FILE_NAME + "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") + endif() + + set(CPACK_PACKAGE_EXECUTABLES "CGAL" "CGAL") + + if(WIN32 AND NOT UNIX) + set(CPACK_GENERATOR "NSIS") + # There is a bug in NSI that does not handle full unix paths properly. Make + # sure there is at least one set of four (4) backlasshes. + #set(CPACK_PACKAGE_ICON "${CGAL_INSTALLATION_PACKAGE_DIR}\\\\cgal_install.gif") + #set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\\\CGAL.exe") + set(CPACK_NSIS_DISPLAY_NAME + "${CPACK_PACKAGE_INSTALL_DIRECTORY} Computational Geometry Algorithms Library" + ) + set(CPACK_NSIS_HELP_LINK "http:\\\\\\\\www.cgal.org") + set(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\www.cgal.org") + set(CPACK_NSIS_CONTACT "info@cgal.org") + set(CPACK_NSIS_MODIfY_PATH ON) + else() + set(CPACK_STRIP_FILES "") + set(CPACK_SOURCE_STRIP_FILES "") + endif() + + include(CPack) endif() - -if ( CGAL_BRANCH_BUILD ) - option(CGAL_ENABLE_CHECK_HEADERS +if(CGAL_BRANCH_BUILD) + option( + CGAL_ENABLE_CHECK_HEADERS "Enable the special targets \"check_pkg_headers\", \"packages_dependencies\", and \"check_pkg__headers\" and \"pkg__deps\" for each package" FALSE) unset(CGAL_COMPUTE_DEPENDENCIES CACHE) # remove that variable, no longer used @@ -1022,51 +1150,55 @@ if ( CGAL_BRANCH_BUILD ) if(CGAL_ENABLE_CHECK_HEADERS) option(CGAL_COPY_DEPENDENCIES - "Copy package dependencies in source directories. - Note that this option will modify the source directory!" - FALSE) + "Copy package dependencies in source directories. + Note that this option will modify the source directory!" FALSE) - message( "== Setting header checking ==" ) + message("== Setting header checking ==") find_package(GMP REQUIRED) find_package(Doxygen REQUIRED) find_package(Eigen3 REQUIRED) find_package(Qt5 COMPONENTS Core Widgets Xml OpenGL Gui REQUIRED) - find_package(VTK COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) + find_package(VTK COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) find_package(IPE) find_package(RS3) find_package(LEDA) find_package(OpenMesh) find_package(OpenCV QUIET) - set(compile_options "\ + set(compile_options + "\ ${CMAKE_CXX_FLAGS} -DCGAL_EIGEN3_ENABLED -DCGAL_PROFILE \ ${Qt5Widgets_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS} ${Qt5Gui_DEFINITIONS} \ ${Qt5OpenGL_EXECUTABLE_COMPILE_FLAGS} -fPIC \ ${Qt5Gui_EXECUTABLE_COMPILE_FLAGS} \ ${Qt5Xml_EXECUTABLE_COMPILE_FLAGS} \ ${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} \ -${CGAL_DEFINITIONS}" - ) +${CGAL_DEFINITIONS}") message("COMPILATION OPTIONS ARE : ${compile_options}") if(NOT RS_FOUND AND NOT RS3_FOUND) - set(compile_options "${compile_options} \ + set(compile_options + "${compile_options} \ -DCGAL_ALGEBRAIC_KERNEL_RS_GMPZ_D_1=1 \ -DCGAL_ALGEBRAIC_KERNEL_RS_GMPQ_D_1=1") message(STATUS "Skip RS headers \"CGAL/Algebraic_kernel_rs_gmpq_d_1.h\" \ and \"CGAL/Algebraic_kernel_rs_gmpz_d_1.h\" because RS_FOUND is false.") else() - set(compile_options "${compile_options} \ + set(compile_options + "${compile_options} \ -DCGAL_USE_MPFI=1 \ -DCGAL_USE_RS=1") endif() if(NOT OpenMesh_FOUND) - set(compile_options "${compile_options} \ + set(compile_options + "${compile_options} \ -DCGAL_BOOST_GRAPH_GRAPH_TRAITS_POLYMESH_ARRAYKERNELT_H \ -DCGAL_BOOST_GRAPH_GRAPH_TRAITS_TRIMESH_ARRAYKERNELT_H \ -DCGAL_PROPERTIES_POLYMESH_ARRAYKERNELT_H \ -DCGAL_PROPERTIES_TRIMESH_ARRAYKERNELT_H") - message(STATUS "Skip headers \ + message( + STATUS + "Skip headers \ \"CGAL/boost/graph/graph_traits_PolyMesh_ArrayKernelT.h\", \ \"CGAL/boost/graph/graph_traits_TriMesh_ArrayKernelT.h\", \ \"CGAL/boost/graph/properties_PolyMesh_ArrayKernelT.h\", and \ @@ -1088,7 +1220,7 @@ because OpenCV_FOUND is false") message(STATUS "Skip header \"CGAL/CGAL_ipelet_base.h\" \ because IPE_FOUND is false.") endif() - if ("${IPE_VERSION}" EQUAL "7") + if("${IPE_VERSION}" EQUAL "7") set(compile_options "${compile_options} -DCGAL_USE_IPE_7") endif() @@ -1098,14 +1230,19 @@ because IPE_FOUND is false.") set(flag "-E") endif() if(NOT DEFINED CGAL_CHECK_SYNTAX_ONLY) - execute_process(COMMAND - ${CMAKE_CXX_COMPILER} -x c++ ${flag} ${CGAL_MODULES_DIR}/config/support/test_syntaxonly.cpp - ERROR_QUIET + execute_process( + COMMAND + ${CMAKE_CXX_COMPILER} -x c++ ${flag} + ${CGAL_MODULES_DIR}/config/support/test_syntaxonly.cpp ERROR_QUIET RESULT_VARIABLE ok) if(ok EQUAL 0) - set(CGAL_CHECK_SYNTAX_ONLY ON CACHE INTERNAL "") + set(CGAL_CHECK_SYNTAX_ONLY + ON + CACHE INTERNAL "") else() - set(CGAL_CHECK_SYNTAX_ONLY OFF CACHE INTERNAL "") + set(CGAL_CHECK_SYNTAX_ONLY + OFF + CACHE INTERNAL "") endif() endif(NOT DEFINED CGAL_CHECK_SYNTAX_ONLY) @@ -1116,70 +1253,88 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.") ## Fill the variable include_options with all the -I and -isystem options set(include_options) - foreach (incdir ${CGAL_INCLUDE_DIRS}) + foreach(incdir ${CGAL_INCLUDE_DIRS}) list(APPEND include_options "-I${incdir}") endforeach() - foreach (incdir - ${VTK_INCLUDE_DIRS} - ${LEDA_INCLUDE_DIR} - ${OPENMESH_INCLUDE_DIR} - ${OpenCV_INCLUDE_DIRS} - ${RS_INCLUDE_DIR} - ${EIGEN3_INCLUDE_DIR} - ${GMP_INCLUDE_DIR} - ${Qt5OpenGL_INCLUDE_DIRS} - ${Qt5Widgets_INCLUDE_DIRS} ${Qt5Xml_INCLUDE_DIRS} ${Qt5Gui_DEFINITIONS} - ${CGAL_3RD_PARTY_INCLUDE_DIRS} ${CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS} - ) + foreach( + incdir + ${VTK_INCLUDE_DIRS} + ${LEDA_INCLUDE_DIR} + ${OPENMESH_INCLUDE_DIR} + ${OpenCV_INCLUDE_DIRS} + ${RS_INCLUDE_DIR} + ${EIGEN3_INCLUDE_DIR} + ${GMP_INCLUDE_DIR} + ${Qt5OpenGL_INCLUDE_DIRS} + ${Qt5Widgets_INCLUDE_DIRS} + ${Qt5Xml_INCLUDE_DIRS} + ${Qt5Gui_DEFINITIONS} + ${CGAL_3RD_PARTY_INCLUDE_DIRS} + ${CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS}) list(APPEND include_options "-I${incdir}") endforeach() - include_directories ( SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS} ) + include_directories(SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS}) # Build the doc set(DOC_DIR "${CMAKE_BINARY_DIR}/build_doc") file(MAKE_DIRECTORY "${DOC_DIR}") - execute_process(COMMAND "${CMAKE_COMMAND}" -DCGAL_BUILD_THREE_DOC=TRUE -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} "${CMAKE_SOURCE_DIR}/Documentation/doc" - WORKING_DIRECTORY "${DOC_DIR}" - ) + execute_process( + COMMAND + "${CMAKE_COMMAND}" -DCGAL_BUILD_THREE_DOC=TRUE + -DDOXYGEN_EXECUTABLE=${DOXYGEN_EXECUTABLE} + "${CMAKE_SOURCE_DIR}/Documentation/doc" + WORKING_DIRECTORY "${DOC_DIR}") execute_process(COMMAND "${CMAKE_COMMAND}" --build . --target "doc" - WORKING_DIRECTORY "${DOC_DIR}" ) + WORKING_DIRECTORY "${DOC_DIR}") - #Get the list of the documented headers + #Get the list of the documented headers - file(GLOB html_files RELATIVE "${DOC_DIR}/doc_output/" "${DOC_DIR}/doc_output/*/*.html") - file(GLOB example_files RELATIVE "${CMAKE_SOURCE_DIR}/" "${CMAKE_SOURCE_DIR}/*/examples/*/*.cpp") - find_program(AWK awk) - set(awk_arguments [=[{ match($0, /# *include *(<|[<"])(CGAL\/[^>&"]*)([>"]|>)| (CGAL\/[^>&"]*\.h)/,arr); if(arr[2]!="") print arr[2]; if(arr[4]!="") print arr[4] }]=]) - message("listing headers from html files") - foreach(f ${html_files}) - execute_process(COMMAND "${AWK}" "${awk_arguments}" "${DOC_DIR}/doc_output/${f}" - OUTPUT_VARIABLE tmp_list) - if (NOT "${tmp_list}" STREQUAL "") - string(REPLACE "\n" ";" tmp_list ${tmp_list}) - LIST( APPEND list_of_documented_headers ${tmp_list}) + file( + GLOB html_files + RELATIVE "${DOC_DIR}/doc_output/" + "${DOC_DIR}/doc_output/*/*.html") + file( + GLOB example_files + RELATIVE "${CMAKE_SOURCE_DIR}/" + "${CMAKE_SOURCE_DIR}/*/examples/*/*.cpp") + find_program(AWK awk) + set(awk_arguments + [=[{ match($0, /# *include *(<|[<"])(CGAL\/[^>&"]*)([>"]|>)| (CGAL\/[^>&"]*\.h)/,arr); if(arr[2]!="") print arr[2]; if(arr[4]!="") print arr[4] }]=] + ) + message("listing headers from html files") + foreach(f ${html_files}) + execute_process( + COMMAND "${AWK}" "${awk_arguments}" "${DOC_DIR}/doc_output/${f}" + OUTPUT_VARIABLE tmp_list) + if(NOT "${tmp_list}" STREQUAL "") + string(REPLACE "\n" ";" tmp_list ${tmp_list}) + list(APPEND list_of_documented_headers ${tmp_list}) + endif() + endforeach() + message("listing headers from examples files") + foreach(f ${example_files}) + execute_process( + COMMAND "${AWK}" "${awk_arguments}" "${CMAKE_SOURCE_DIR}/${f}" + OUTPUT_VARIABLE tmp_list) + if(NOT "${tmp_list}" STREQUAL "") + string(REPLACE "\n" ";" tmp_list ${tmp_list}) + list(APPEND list_of_documented_headers ${tmp_list}) + endif() + endforeach() + message("removing duplicates:") + list(REMOVE_DUPLICATES list_of_documented_headers) + message("sorting:") + list(SORT list_of_documented_headers) + #string(REPLACE ";" " \n" list_of_documented_headers "${list_of_documented_headers}") + if(NOT "${list_of_documented_headers}" STREQUAL "") + set(has_list_of_documented_headers TRUE) + else() + set(has_list_of_documented_headers FALSE) endif() - endforeach() - message("listing headers from examples files") - foreach(f ${example_files}) - execute_process(COMMAND "${AWK}" "${awk_arguments}" "${CMAKE_SOURCE_DIR}/${f}" - OUTPUT_VARIABLE tmp_list) - if (NOT "${tmp_list}" STREQUAL "") - string(REPLACE "\n" ";" tmp_list ${tmp_list}) - LIST( APPEND list_of_documented_headers ${tmp_list}) - endif() - endforeach() - message("removing duplicates:") - list(REMOVE_DUPLICATES list_of_documented_headers) - message("sorting:") - list(SORT list_of_documented_headers) - #string(REPLACE ";" " \n" list_of_documented_headers "${list_of_documented_headers}") - if (NOT "${list_of_documented_headers}" STREQUAL "") - set(has_list_of_documented_headers TRUE) - else() - set(has_list_of_documented_headers FALSE) - endif() - include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/list_of_whitelisted_headers.cmake - OPTIONAL RESULT_VARIABLE has_list_of_whitelisted_headers) + include( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/list_of_whitelisted_headers.cmake + OPTIONAL + RESULT_VARIABLE has_list_of_whitelisted_headers) message("list_of_whitelisted_headers: ${list_of_whitelisted_headers}") ## Loop on package and headers set(check_pkg_target_list) @@ -1188,16 +1343,18 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.") endif() #get build dir for removal from deps get_filename_component(BUILD_DIR ${CMAKE_BINARY_DIR} NAME) - foreach (package ${CGAL_CONFIGURED_PACKAGES_NAMES}) + foreach(package ${CGAL_CONFIGURED_PACKAGES_NAMES}) if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include) set(check_pkg_headers_depends "") if(has_list_of_documented_headers AND POLICY CMP0057) # Then recurse2 - file(GLOB_RECURSE ${package}_HEADERS + file( + GLOB_RECURSE ${package}_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include" "${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/CGAL/*.h*") else() # do not recurse - file(GLOB ${package}_HEADERS + file( + GLOB ${package}_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include" "${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/CGAL/*.h*") endif() @@ -1205,9 +1362,9 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.") foreach(header ${${package}_HEADERS}) set(skip_hdr FALSE) if(POLICY CMP0057) - if(has_list_of_documented_headers - AND NOT header IN_LIST list_of_documented_headers) -# message(STATUS "Skip non-documented header \"${header}\".") + if(has_list_of_documented_headers AND NOT header IN_LIST + list_of_documented_headers) + # message(STATUS "Skip non-documented header \"${header}\".") set(skip_hdr TRUE) endif() endif() @@ -1226,48 +1383,47 @@ LEDA_FOUND is false.") set(skip_hdr TRUE) endif() if(POLICY CMP0057) - if(has_list_of_whitelisted_headers - AND header IN_LIST list_of_whitelisted_headers) + if(has_list_of_whitelisted_headers AND header IN_LIST + list_of_whitelisted_headers) message(STATUS "Skip whitelisted header \"${header}\".") set(skip_hdr TRUE) endif() endif() if(NOT skip_hdr) - LIST( APPEND list_of_headers_to_test ${header}) + list(APPEND list_of_headers_to_test ${header}) string(REPLACE "/" "__" header2 "${header}") string(REPLACE "." "_" header2 "${header2}") string(REPLACE ";" " " include_options_str "${include_options}") string(REPLACE ";" " " compile_options_str "${compile_options}") - separate_arguments(CMD - UNIX_COMMAND - "${CMAKE_CXX_COMPILER} ${compile_options_str} + separate_arguments( + CMD UNIX_COMMAND "${CMAKE_CXX_COMPILER} ${compile_options_str} ${include_options_str} -x c++ ${flag} -H \ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" # The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it # depends on RS. - ) + ) # CMD2 is CMD without the -H option - separate_arguments(CMD2 - UNIX_COMMAND - "${CMAKE_CXX_COMPILER} ${compile_options_str} + separate_arguments( + CMD2 UNIX_COMMAND "${CMAKE_CXX_COMPILER} ${compile_options_str} ${include_options_str} -x c++ ${flag} \ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" # The header Algebraic_kernel_rs_gmpz_d_1.h is skipped on purpose: it # depends on RS. - ) + ) set(chk_header_name - ${CGAL_BINARY_DIR}/package_info/${package}/check_headers/check_${header2}) - add_custom_command(OUTPUT ${chk_header_name} - COMMAND ${CMAKE_COMMAND} - -DCERR:STRING=${chk_header_name} - "-DCMD:STRING=${CMD}" - "-DCMD2:STRING=${CMD2}" - -P "${CGAL_MODULES_DIR}/run_cmd_redirection_cerr.cmake" - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header} + ${CGAL_BINARY_DIR}/package_info/${package}/check_headers/check_${header2} + ) + add_custom_command( + OUTPUT ${chk_header_name} + COMMAND + ${CMAKE_COMMAND} -DCERR:STRING=${chk_header_name} + "-DCMD:STRING=${CMD}" "-DCMD2:STRING=${CMD2}" -P + "${CGAL_MODULES_DIR}/run_cmd_redirection_cerr.cmake" + DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header} DEPENDS ${CGAL_MODULES_DIR}/run_cmd_redirection_cerr.cmake VERBATIM - COMMENT "Check header ${package}/include/${header}" - ) + COMMENT "Check header ${package}/include/${header}") list(APPEND check_pkg_headers_depends ${chk_header_name}) if(${header2}_deps) list(REMOVE_DUPLICATES ${header2}_deps) @@ -1275,24 +1431,26 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" endif() # end the if on list_of_documented_headers endforeach() # look on headers add_custom_target(check_pkg_${package}_headers - DEPENDS ${check_pkg_headers_depends}) + DEPENDS ${check_pkg_headers_depends}) add_custom_command( OUTPUT ${CGAL_BINARY_DIR}/package_info/${package}/included_headers ${CGAL_BINARY_DIR}/package_info/${package}/dependencies DEPENDS ${check_pkg_headers_depends} COMMENT "Compute dependencies of ${package}" - COMMAND ${CMAKE_COMMAND} - -DCGAL_PACKAGES_PREFIX=${CGAL_SOURCE_DIR} + COMMAND + ${CMAKE_COMMAND} -DCGAL_PACKAGES_PREFIX=${CGAL_SOURCE_DIR} -DCGAL_COPY_DEPENDENCIES=${CGAL_COPY_DEPENDENCIES} -DCGAL_COPY_PATH=${CGAL_SOURCE_DIR}/${package}/package_info/${package}/dependencies -DOUTPUT_HEADERS_LIST=${CGAL_BINARY_DIR}/package_info/${package}/included_headers -DOUTPUT_PACKAGES_LIST=${CGAL_BINARY_DIR}/package_info/${package}/dependencies -P "${CGAL_MODULES_DIR}/process_dependencies.cmake" - ${check_pkg_headers_depends} - ) - add_custom_target(pkg_${package}_deps DEPENDS ${CGAL_BINARY_DIR}/package_info/${package}/dependencies) + ${check_pkg_headers_depends}) + add_custom_target( + pkg_${package}_deps + DEPENDS ${CGAL_BINARY_DIR}/package_info/${package}/dependencies) list(APPEND check_pkg_target_list check_pkg_${package}_headers) - list(APPEND packages_deps ${CGAL_BINARY_DIR}/package_info/${package}/dependencies) + list(APPEND packages_deps + ${CGAL_BINARY_DIR}/package_info/${package}/dependencies) endif() # if the package has an include directory if(packages_deps) list(REMOVE_DUPLICATES packages_deps) @@ -1300,26 +1458,26 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" endforeach() # loop on packages #Now check that a cpp file including all documented headers compiles - file(WRITE ${CGAL_BINARY_DIR}/test_headers.cpp "#define BOOST_PARAMETER_MAX_ARITY 12 \n") + file(WRITE ${CGAL_BINARY_DIR}/test_headers.cpp + "#define BOOST_PARAMETER_MAX_ARITY 12 \n") foreach(header ${list_of_headers_to_test}) file(APPEND ${CGAL_BINARY_DIR}/test_headers.cpp "#include <${header}>\n") endforeach() #loop on headers to include in test file file(APPEND ${CGAL_BINARY_DIR}/test_headers.cpp "int main(){}\n") - add_custom_target(check_headers - DEPENDS ${check_pkg_target_list}) + add_custom_target(check_headers DEPENDS ${check_pkg_target_list}) string(REPLACE " " ";" compile_options ${compile_options}) string(REPLACE " " ";" include_options ${include_options_str}) - add_custom_command(TARGET check_headers - POST_BUILD - COMMAND ${CMAKE_CXX_COMPILER} - ${compile_options} ${include_options} - -x c++ -fsyntax-only ${CGAL_BINARY_DIR}/test_headers.cpp - ) + add_custom_command( + TARGET check_headers + POST_BUILD + COMMAND ${CMAKE_CXX_COMPILER} ${compile_options} ${include_options} -x + c++ -fsyntax-only ${CGAL_BINARY_DIR}/test_headers.cpp) add_custom_target(packages_dependencies DEPENDS ${packages_deps}) - message( " \n\ + message( + " \n\ You can now check the headers with the target `check_headers`\n\ and the package dependencies with the target `packages_dependencies`.\n\ Results are in the `package_info/` sub-directory of the build directory:\n\ @@ -1328,9 +1486,9 @@ ${CMAKE_CURRENT_SOURCE_DIR}/../${package}/include/${header}" - package_info//included_headers\n\ - package_info//check_headers/ (error messages from \ the headers checks)\n") - message( "== Setting header checking (DONE) ==\n" ) + message("== Setting header checking (DONE) ==\n") endif() -endif( CGAL_BRANCH_BUILD ) +endif(CGAL_BRANCH_BUILD) if(NOT CGAL_BRANCH_BUILD AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doc") # in a non-branch build this is the top-level CMakeLists.txt diff --git a/Installation/demo/CMakeLists.txt b/Installation/demo/CMakeLists.txt index 0e3700ad729..8f0b28cb33a 100644 --- a/Installation/demo/CMakeLists.txt +++ b/Installation/demo/CMakeLists.txt @@ -1,22 +1,21 @@ cmake_minimum_required(VERSION 3.1...3.15) project(CGAL_DEMOS) +if(CGAL_BRANCH_BUILD) -if (CGAL_BRANCH_BUILD) - -foreach (package ${CGAL_CONFIGURED_PACKAGES}) - #message (STATUS "Current package: ${package}") - file( GLOB listtmp "${package}/demo/*") - list(APPEND list ${listtmp}) -endforeach() + foreach(package ${CGAL_CONFIGURED_PACKAGES}) + #message (STATUS "Current package: ${package}") + file(GLOB listtmp "${package}/demo/*") + list(APPEND list ${listtmp}) + endforeach() else() - file( GLOB list "*") + file(GLOB list "*") endif() -list( SORT list ) +list(SORT list) if(NOT CGAL_BUILDING_LIBS) find_package(CGAL REQUIRED) @@ -24,17 +23,17 @@ if(NOT CGAL_BUILDING_LIBS) endif() message("== Generating build files for demos ==") -foreach( entry ${list} ) +foreach(entry ${list}) - if (NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry} ) + if(NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry}) file(GLOB files "${entry}/*.cpp") # If there is no .cpp files, ignore the sub-directory if(files) - process_CGAL_subdirectory("${entry}" demo demo) + process_cgal_subdirectory("${entry}" demo demo) # Note: process_CGAL_subdirectory is defined in cmake/modules/CGAL_Macros.cmake - endif() + endif() endif() diff --git a/Installation/examples/CMakeLists.txt b/Installation/examples/CMakeLists.txt index 4c415c99731..cf7b9e215a2 100644 --- a/Installation/examples/CMakeLists.txt +++ b/Installation/examples/CMakeLists.txt @@ -1,22 +1,21 @@ cmake_minimum_required(VERSION 3.1...3.15) project(CGAL_EXAMPLES) +if(CGAL_BRANCH_BUILD) -if (CGAL_BRANCH_BUILD) - -foreach (package ${CGAL_CONFIGURED_PACKAGES}) - #message (STATUS "Current package: ${package}") - file( GLOB listtmp "${package}/examples/*") - list(APPEND list ${listtmp}) -endforeach() + foreach(package ${CGAL_CONFIGURED_PACKAGES}) + #message (STATUS "Current package: ${package}") + file(GLOB listtmp "${package}/examples/*") + list(APPEND list ${listtmp}) + endforeach() else() - file( GLOB list "*") + file(GLOB list "*") endif() -list( SORT list ) +list(SORT list) if(NOT CGAL_BUILDING_LIBS) find_package(CGAL REQUIRED) @@ -24,17 +23,17 @@ if(NOT CGAL_BUILDING_LIBS) endif() message("== Generating build files for examples ==") -foreach( entry ${list} ) +foreach(entry ${list}) - if (NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry} ) + if(NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry}) file(GLOB files "${entry}/*.cpp") # If there is no .cpp files, ignore the sub-directory if(files) - process_CGAL_subdirectory("${entry}" examples example) + process_cgal_subdirectory("${entry}" examples example) # Note: process_CGAL_subdirectory is defined in cmake/modules/CGAL_Macros.cmake - endif() + endif() endif() diff --git a/Installation/src/CGAL/CMakeLists.txt b/Installation/src/CGAL/CMakeLists.txt index 34e2be2081f..d4474a5138f 100644 --- a/Installation/src/CGAL/CMakeLists.txt +++ b/Installation/src/CGAL/CMakeLists.txt @@ -8,7 +8,7 @@ if(CGAL_HEADER_ONLY) set(keyword "INTERFACE") endif() -CGAL_setup_CGAL_dependencies(CGAL ${keyword}) +cgal_setup_cgal_dependencies(CGAL ${keyword}) if(NOT CGAL_HEADER_ONLY) target_compile_definitions(CGAL INTERFACE CGAL_NOT_HEADER_ONLY=1) @@ -19,6 +19,9 @@ if(NOT CGAL_DISABLE_GMP) get_dependency_version(MPFR) endif() -message( STATUS "USING BOOST_VERSION = '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'" ) +message( + STATUS + "USING BOOST_VERSION = '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'" +) message("libCGAL is configured") diff --git a/Installation/src/CMakeLists.txt b/Installation/src/CMakeLists.txt index 7ed919fab92..a4684d2b13b 100644 --- a/Installation/src/CMakeLists.txt +++ b/Installation/src/CMakeLists.txt @@ -1,31 +1,33 @@ -function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) +function(collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) - if (NOT CGAL_HEADER_ONLY) - # IMPORTANT: First delete all_files.cpp - if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp) - file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp) - endif() + if(NOT CGAL_HEADER_ONLY) + # IMPORTANT: First delete all_files.cpp + if(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp) + file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp) + endif() - # THEN collect *.cpp - foreach (package ${CGAL_CONFIGURED_PACKAGES} ) - file(GLOB CGAL_LIBRARY_SOURCE_FILES_TMP ${package}/src/${LIBRARY_NAME}/*.cpp) - list(SORT CGAL_LIBRARY_SOURCE_FILES_TMP) - foreach(file ${CGAL_LIBRARY_SOURCE_FILES_TMP}) - if(NOT ${file} MATCHES "/qrc_.*") - list(APPEND CGAL_LIBRARY_SOURCE_FILES ${file}) + # THEN collect *.cpp + foreach(package ${CGAL_CONFIGURED_PACKAGES}) + file(GLOB CGAL_LIBRARY_SOURCE_FILES_TMP + ${package}/src/${LIBRARY_NAME}/*.cpp) + list(SORT CGAL_LIBRARY_SOURCE_FILES_TMP) + foreach(file ${CGAL_LIBRARY_SOURCE_FILES_TMP}) + if(NOT ${file} MATCHES "/qrc_.*") + list(APPEND CGAL_LIBRARY_SOURCE_FILES ${file}) + endif() + endforeach() + endforeach() + + foreach(source ${CGAL_LIBRARY_SOURCE_FILES}) + # It may happen that a file all_files.cpp had been created in-source by + # a previous in-source build. We certainly do not want to include that + # file in the new all_files.cpp because .cpp files would be included + # twice, and that breaks the one-definition rule (ODR). + if(NOT source MATCHES ".*/all_files.cpp") + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp + "\#include \"${source}\"\n") endif() endforeach() - endforeach() - - foreach(source ${CGAL_LIBRARY_SOURCE_FILES}) - # It may happen that a file all_files.cpp had been created in-source by - # a previous in-source build. We certainly do not want to include that - # file in the new all_files.cpp because .cpp files would be included - # twice, and that breaks the one-definition rule (ODR). - if(NOT source MATCHES ".*/all_files.cpp") - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp "\#include \"${source}\"\n") - endif() - endforeach() endif() if(CGAL_BUILD_SHARED_LIBS) @@ -34,30 +36,34 @@ function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) set(CGAL_LIB_PREFIX "lib") endif() - set(RELEASE_MANGLED_NAME "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-${CGAL_FULL_VERSION}" ) - set(DEBUG_MANGLED_NAME "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-gd-${CGAL_FULL_VERSION}" ) + set(RELEASE_MANGLED_NAME + "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-${CGAL_FULL_VERSION}" + ) + set(DEBUG_MANGLED_NAME + "${CGAL_LIB_PREFIX}${LIBRARY_NAME}-${CGAL_TOOLSET}-mt-gd-${CGAL_FULL_VERSION}" + ) if(CGAL_BUILD_SHARED_LIBS AND WIN32) - configure_file(${CGAL_INSTALLATION_PACKAGE_DIR}/src/CGAL_libs_verinfo.rc.in ${LIBRARY_NAME}_verinfo.rc @ONLY) + configure_file(${CGAL_INSTALLATION_PACKAGE_DIR}/src/CGAL_libs_verinfo.rc.in + ${LIBRARY_NAME}_verinfo.rc @ONLY) set(rc_file ${CMAKE_CURRENT_BINARY_DIR}/${LIBRARY_NAME}_verinfo.rc) else() - set(rc_file ) + set(rc_file) endif() - if (NOT CGAL_HEADER_ONLY) - add_library (${LIBRARY_NAME} - ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp - ${rc_file} - ${ADDITIONAL_FILES}) + if(NOT CGAL_HEADER_ONLY) + add_library(${LIBRARY_NAME} ${CMAKE_CURRENT_BINARY_DIR}/all_files.cpp + ${rc_file} ${ADDITIONAL_FILES}) # add_library (${LIBRARY_NAME} ${CGAL_LIBRARY_SOURCE_FILES} ${rc_file} ${ADDITIONAL_FILES}) # builing not creating temporary all_files.cpp if(${LIBRARY_NAME}_SOVERSION AND ${LIBRARY_NAME}_SONAME_VERSION) - set_target_properties(${LIBRARY_NAME} PROPERTIES - VERSION "${${LIBRARY_NAME}_SOVERSION}" - SOVERSION "${${LIBRARY_NAME}_SONAME_VERSION}") + set_target_properties( + ${LIBRARY_NAME} + PROPERTIES VERSION "${${LIBRARY_NAME}_SOVERSION}" + SOVERSION "${${LIBRARY_NAME}_SONAME_VERSION}") elseif(CGAL_SOVERSION AND CGAL_SONAME_VERSION) - set_target_properties(${LIBRARY_NAME} PROPERTIES - VERSION "${CGAL_SOVERSION}" - SOVERSION "${CGAL_SONAME_VERSION}") + set_target_properties( + ${LIBRARY_NAME} PROPERTIES VERSION "${CGAL_SOVERSION}" + SOVERSION "${CGAL_SONAME_VERSION}") endif() else() if(${LIBRARY_NAME}_LIB_DEPENDS) @@ -73,49 +79,69 @@ function (collect_cgal_library LIBRARY_NAME ADDITIONAL_FILES) # target. add_library(CGAL::${LIBRARY_NAME} ALIAS ${LIBRARY_NAME}) if(NOT TARGET ALL_CGAL_TARGETS) - add_custom_target( ALL_CGAL_TARGETS ) + add_custom_target(ALL_CGAL_TARGETS) endif() - add_dependencies( ALL_CGAL_TARGETS ${LIBRARY_NAME} ) + add_dependencies(ALL_CGAL_TARGETS ${LIBRARY_NAME}) if(CGAL_AUTO_LINK_ENABLED) - if (NOT CGAL_HEADER_ONLY) - set_target_properties( ${LIBRARY_NAME} PROPERTIES - OUTPUT_NAME_DEBUG "${DEBUG_MANGLED_NAME}" - OUTPUT_NAME_RELEASE "${RELEASE_MANGLED_NAME}" - OUTPUT_NAME_MINSIZEREL "${RELEASE_MANGLED_NAME}" - OUTPUT_NAME_RELWITHDEBINFO "${RELEASE_MANGLED_NAME}" - ) + if(NOT CGAL_HEADER_ONLY) + set_target_properties( + ${LIBRARY_NAME} + PROPERTIES OUTPUT_NAME_DEBUG "${DEBUG_MANGLED_NAME}" + OUTPUT_NAME_RELEASE "${RELEASE_MANGLED_NAME}" + OUTPUT_NAME_MINSIZEREL "${RELEASE_MANGLED_NAME}" + OUTPUT_NAME_RELWITHDEBINFO "${RELEASE_MANGLED_NAME}") - if ( HAS_CFG_INTDIR ) - add_custom_command(TARGET ${LIBRARY_NAME} POST_BUILD COMMAND if exist \"$(TargetDir)$(TargetName).dll\" copy /Y \"$(TargetDir)$(TargetName).dll\" \"$(TargetDir)..\" ) - add_custom_command(TARGET ${LIBRARY_NAME} POST_BUILD COMMAND if exist \"$(TargetDir)$(TargetName).pdb\" copy /Y \"$(TargetDir)$(TargetName).pdb\" \"$(TargetDir)..\" ) - add_custom_command(TARGET ${LIBRARY_NAME} POST_BUILD COMMAND if exist \"$(SolutionDir)lib\\$(ConfigurationName)\\$(TargetName).lib\" copy /Y \"$(SolutionDir)lib\\$(ConfigurationName)\\$(TargetName).lib\" \"$(SolutionDir)lib\" ) + if(HAS_CFG_INTDIR) + add_custom_command( + TARGET ${LIBRARY_NAME} + POST_BUILD + COMMAND if exist \"$(TargetDir)$(TargetName).dll\" copy /Y + \"$(TargetDir)$(TargetName).dll\" \"$(TargetDir)..\") + add_custom_command( + TARGET ${LIBRARY_NAME} + POST_BUILD + COMMAND if exist \"$(TargetDir)$(TargetName).pdb\" copy /Y + \"$(TargetDir)$(TargetName).pdb\" \"$(TargetDir)..\") + add_custom_command( + TARGET ${LIBRARY_NAME} + POST_BUILD + COMMAND + if exist + \"$(SolutionDir)lib\\$(ConfigurationName)\\$(TargetName).lib\" copy + /Y \"$(SolutionDir)lib\\$(ConfigurationName)\\$(TargetName).lib\" + \"$(SolutionDir)lib\") endif() endif() endif() - if (NOT CGAL_HEADER_ONLY) - install(TARGETS ${LIBRARY_NAME} EXPORT ${LIBRARY_NAME}Exports + if(NOT CGAL_HEADER_ONLY) + install( + TARGETS ${LIBRARY_NAME} + EXPORT ${LIBRARY_NAME}Exports RUNTIME DESTINATION "${CGAL_INSTALL_BIN_DIR}" LIBRARY DESTINATION "${CGAL_INSTALL_LIB_DIR}" ARCHIVE DESTINATION "${CGAL_INSTALL_LIB_DIR}") - install(EXPORT ${LIBRARY_NAME}Exports + install( + EXPORT ${LIBRARY_NAME}Exports DESTINATION "${CGAL_INSTALL_CMAKE_DIR}" NAMESPACE CGAL::) # We have to call configure_file twice to force double expansion of variables. configure_file("${CGAL_MODULES_DIR}/CGALLibConfig.cmake.in" - "${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" @ONLY) + "${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" @ONLY) configure_file("${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" - "${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" @ONLY) - install(FILES "${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" DESTINATION ${CGAL_INSTALL_CMAKE_DIR}) + "${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" @ONLY) + install(FILES "${CMAKE_BINARY_DIR}/${LIBRARY_NAME}LibConfig.cmake" + DESTINATION ${CGAL_INSTALL_CMAKE_DIR}) endif() endfunction() -function( configure_component DIR COMPONENT ) +function(configure_component DIR COMPONENT) set(enabled_by_default ON) - option( WITH_${COMPONENT} "Enable CGAL component ${COMPONENT}" ${enabled_by_default}) - if ( WITH_${COMPONENT}) - add_subdirectory( ${DIR} ${COMPONENT} ) + option(WITH_${COMPONENT} "Enable CGAL component ${COMPONENT}" + ${enabled_by_default}) + if(WITH_${COMPONENT}) + add_subdirectory(${DIR} ${COMPONENT}) endif() endfunction() @@ -143,7 +169,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CGAL_RUNTIME_DIR}) # TODO: Seems useless, because it is called again in ../CMakeLists.txt # Should probably be removed. -- Laurent Rineau, 2014/07/22 if(NOT CGAL_HEADER_ONLY) - create_CGALconfig_files() + create_cgalconfig_files() endif() set(CGAL_DIR ${CMAKE_BINARY_DIR}) @@ -156,37 +182,46 @@ set(CGAL_CONFIGURED_LIBRARIES "") foreach(package ${CGAL_CONFIGURED_PACKAGES}) file(GLOB CONFIGURED_LIBS_IN_PACKAGE ${package}/src/CGAL_*/CMakeLists.txt) list(SORT CONFIGURED_LIBS_IN_PACKAGE) - foreach (libconfigfile ${CONFIGURED_LIBS_IN_PACKAGE}) + foreach(libconfigfile ${CONFIGURED_LIBS_IN_PACKAGE}) get_filename_component(CGAL_CONFIGURED_LIBRARY_NAME ${libconfigfile} PATH) - get_filename_component(CGAL_CONFIGURED_LIBRARY_NAME ${CGAL_CONFIGURED_LIBRARY_NAME} NAME) + get_filename_component(CGAL_CONFIGURED_LIBRARY_NAME + ${CGAL_CONFIGURED_LIBRARY_NAME} NAME) - if (NOT ${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL") + if(NOT ${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL") - message(STATUS "Sources for CGAL component library '${CGAL_CONFIGURED_LIBRARY_NAME}' detected") + message( + STATUS + "Sources for CGAL component library '${CGAL_CONFIGURED_LIBRARY_NAME}' detected" + ) list(APPEND CGAL_CONFIGURED_LIBRARIES ${CGAL_CONFIGURED_LIBRARY_NAME}) #message(STATUS "Library config detected: ${CGAL_CONFIGURED_LIBRARIES}") - cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_LIBRARY "" ) - cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_DEFINITIONS "" ) - cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_INCLUDE_DIRS "" ) - cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES "" ) - cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS "" ) - if (${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL_Core") - if (NOT CGAL_NO_CORE) - configure_component( ${package}/src/${CGAL_CONFIGURED_LIBRARY_NAME} ${CGAL_CONFIGURED_LIBRARY_NAME}) + cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_LIBRARY "") + cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_DEFINITIONS "") + cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_INCLUDE_DIRS "") + cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES "") + cache_set(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS "") + if(${CGAL_CONFIGURED_LIBRARY_NAME} STREQUAL "CGAL_Core") + if(NOT CGAL_NO_CORE) + configure_component(${package}/src/${CGAL_CONFIGURED_LIBRARY_NAME} + ${CGAL_CONFIGURED_LIBRARY_NAME}) else(NOT CGAL_NO_CORE) - message( STATUS "CGAL_Core is not being configured (missing GMP, or 64bit architecture).") + message( + STATUS + "CGAL_Core is not being configured (missing GMP, or 64bit architecture)." + ) endif(NOT CGAL_NO_CORE) else() - configure_component( ${package}/src/${CGAL_CONFIGURED_LIBRARY_NAME} ${CGAL_CONFIGURED_LIBRARY_NAME}) + configure_component(${package}/src/${CGAL_CONFIGURED_LIBRARY_NAME} + ${CGAL_CONFIGURED_LIBRARY_NAME}) endif() - cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_LIBRARY) + cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_LIBRARY) - cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_DEFINITIONS ) - cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_INCLUDE_DIRS ) - cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES ) - cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS) + cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_DEFINITIONS) + cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_INCLUDE_DIRS) + cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES) + cache_get(${CGAL_CONFIGURED_LIBRARY_NAME}_3RD_PARTY_LIBRARIES_DIRS) else() @@ -196,8 +231,11 @@ foreach(package ${CGAL_CONFIGURED_PACKAGES}) endforeach() endforeach() -if (NOT CGAL_CONFIGURED_LIBRARIES) - message(FATAL_ERROR "No component library in configured packages found. Please fix package-file.") +if(NOT CGAL_CONFIGURED_LIBRARIES) + message( + FATAL_ERROR + "No component library in configured packages found. Please fix package-file." + ) endif() list(REMOVE_DUPLICATES CGAL_CONFIGURED_LIBRARIES) @@ -217,16 +255,22 @@ macro(CGAL_add_if_target TARGET) endif() endmacro() -CGAL_add_if_target(CGAL) -CGAL_add_if_target(CGAL_Core) -CGAL_add_if_target(CGAL_ImageIO) -CGAL_add_if_target(CGAL_Qt5) +cgal_add_if_target(CGAL) +cgal_add_if_target(CGAL_Core) +cgal_add_if_target(CGAL_ImageIO) +cgal_add_if_target(CGAL_Qt5) -cache_set(CGAL_ACTUAL_CONFIGURED_LIBRARIES "${CGAL_ACTUAL_CONFIGURED_LIBRARIES}") +cache_set(CGAL_ACTUAL_CONFIGURED_LIBRARIES + "${CGAL_ACTUAL_CONFIGURED_LIBRARIES}") -if (NOT CGAL_HEADER_ONLY) - export(TARGETS ${CGAL_ACTUAL_CONFIGURED_LIBRARIES} NAMESPACE CGAL:: FILE "${CMAKE_BINARY_DIR}/CGALExports.cmake") +if(NOT CGAL_HEADER_ONLY) + export( + TARGETS ${CGAL_ACTUAL_CONFIGURED_LIBRARIES} + NAMESPACE CGAL:: + FILE "${CMAKE_BINARY_DIR}/CGALExports.cmake") endif() -message(STATUS "Sources for CGAL component libraries '${CGAL_CONFIGURED_LIBRARIES}' detected") - +message( + STATUS + "Sources for CGAL component libraries '${CGAL_CONFIGURED_LIBRARIES}' detected" +) diff --git a/Installation/test/CMakeLists.txt b/Installation/test/CMakeLists.txt index df238f83028..d01cbc74f7c 100644 --- a/Installation/test/CMakeLists.txt +++ b/Installation/test/CMakeLists.txt @@ -1,22 +1,21 @@ cmake_minimum_required(VERSION 3.1...3.15) project(CGAL_TESTS) +if(CGAL_BRANCH_BUILD) -if (CGAL_BRANCH_BUILD) - -foreach (package ${CGAL_CONFIGURED_PACKAGES}) - #message (STATUS "Current package: ${package}") - file( GLOB listtmp "${package}/test/*") - list(APPEND list ${listtmp}) -endforeach() + foreach(package ${CGAL_CONFIGURED_PACKAGES}) + #message (STATUS "Current package: ${package}") + file(GLOB listtmp "${package}/test/*") + list(APPEND list ${listtmp}) + endforeach() else() - file( GLOB list "*") + file(GLOB list "*") endif() -list( SORT list ) +list(SORT list) if(NOT CGAL_BUILDING_LIBS) find_package(CGAL REQUIRED) @@ -24,17 +23,17 @@ if(NOT CGAL_BUILDING_LIBS) endif() message("== Generating build files for tests ==") -foreach( entry ${list} ) +foreach(entry ${list}) - if (NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry} ) + if(NOT ${entry} MATCHES ".*\\.svn\$" AND IS_DIRECTORY ${entry}) file(GLOB files "${entry}/*.cpp") # If there is no .cpp files, ignore the sub-directory if(files) - process_CGAL_subdirectory("${entry}" test test) + process_cgal_subdirectory("${entry}" test test) # Note: process_CGAL_subdirectory is defined in cmake/modules/CGAL_Macros.cmake - endif() + endif() endif() diff --git a/Installation/test/Installation/CMakeLists.txt b/Installation/test/Installation/CMakeLists.txt index eeb855c2b3f..81412b6862f 100644 --- a/Installation/test/Installation/CMakeLists.txt +++ b/Installation/test/Installation/CMakeLists.txt @@ -1,104 +1,96 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Installation_Tests ) +project(Installation_Tests) +macro(create_link_to_program COMPONENT) + add_executable(link_to_${COMPONENT} link_to_${COMPONENT}.cpp) -macro(create_link_to_program COMPONENT ) + include_directories(${${COMPONENT}_3RD_PARTY_INCLUDE_DIRS}) - add_executable(link_to_${COMPONENT} link_to_${COMPONENT}.cpp ) + add_definitions(${${COMPONENT}_3RD_PARTY_DEFINITIONS}) - include_directories ( ${${COMPONENT}_3RD_PARTY_INCLUDE_DIRS} ) - - add_definitions( ${${COMPONENT}_3RD_PARTY_DEFINITIONS} ) - - link_directories( ${${COMPONENT}_3RD_PARTY_LIBRARIES_DIRS}) + link_directories(${${COMPONENT}_3RD_PARTY_LIBRARIES_DIRS}) # Link the executable to CGAL and third-party libraries - if ( CGAL_AUTO_LINK_ENABLED OR CGAL_HEADER_ONLY) - target_link_libraries(link_to_${COMPONENT} ${CGAL_3RD_PARTY_LIBRARIES} ${${COMPONENT}_3RD_PARTY_LIBRARIES} ) + if(CGAL_AUTO_LINK_ENABLED OR CGAL_HEADER_ONLY) + target_link_libraries(link_to_${COMPONENT} ${CGAL_3RD_PARTY_LIBRARIES} + ${${COMPONENT}_3RD_PARTY_LIBRARIES}) else() - target_link_libraries(link_to_${COMPONENT} CGAL::${COMPONENT} ${CGAL_3RD_PARTY_LIBRARIES} ${${COMPONENT}_3RD_PARTY_LIBRARIES} ) + target_link_libraries( + link_to_${COMPONENT} CGAL::${COMPONENT} ${CGAL_3RD_PARTY_LIBRARIES} + ${${COMPONENT}_3RD_PARTY_LIBRARIES}) endif() - add_to_cached_list( CGAL_EXECUTABLE_TARGETS link_to_${COMPONENT} ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS link_to_${COMPONENT}) endmacro() -find_package(CGAL QUIET COMPONENTS Core) +find_package(CGAL REQUIRED COMPONENTS Core) -if ( CGAL_FOUND ) +include(${CGAL_USE_FILE}) - include( ${CGAL_USE_FILE} ) +include(CGAL_CreateSingleSourceCGALProgram) - include( CGAL_CreateSingleSourceCGALProgram ) +create_single_source_cgal_program("endian.cpp") - create_single_source_cgal_program( "endian.cpp" ) +create_single_source_cgal_program("deprecation_warning.cpp") - create_single_source_cgal_program( "deprecation_warning.cpp" ) +create_single_source_cgal_program("test_use_h.cpp") - create_single_source_cgal_program( "test_use_h.cpp" ) +create_single_source_cgal_program(will_fail.cpp will_fail_aux.cpp) +if(BUILD_TESTING) + set_property(TEST execution___of__will_fail PROPERTY WILL_FAIL TRUE) +endif() - create_single_source_cgal_program( will_fail.cpp will_fail_aux.cpp ) - if(BUILD_TESTING) - set_property(TEST execution___of__will_fail PROPERTY WILL_FAIL TRUE) +find_package(TBB QUIET) +include(CGAL_TBB_support) +create_single_source_cgal_program("test_TBB.cpp") +if(TARGET CGAl::TBB_support) + target_link_libraries(test_TBB PUBLIC CGAL::TBB_support) +endif() + +create_link_to_program(CGAL) + +if(WITH_CGAL_Core) + create_link_to_program(CGAL_Core) +endif() + +if(WITH_CGAL_ImageIO) + create_link_to_program(CGAL_ImageIO) +endif() + +if(WITH_CGAL_Qt4) + find_package(Qt4 QUIET) + if(QT4_FOUND) + include(${QT_USE_FILE}) + create_link_to_program(CGAL_Qt4) endif() +endif() - find_package( TBB QUIET ) - include(CGAL_TBB_support) - create_single_source_cgal_program( "test_TBB.cpp" ) - if(TARGET CGAl::TBB_support) - target_link_libraries(test_TBB PUBLIC CGAL::TBB_support) +if(WITH_CGAL_Qt5) + find_package(Qt5 QUIET) + if(Qt5_FOUND) + create_link_to_program(CGAL_Qt5) endif() +endif() - create_link_to_program(CGAL) - - if ( WITH_CGAL_Core ) - create_link_to_program(CGAL_Core) - endif() - - if ( WITH_CGAL_ImageIO ) - create_link_to_program(CGAL_ImageIO) - endif() - - if ( WITH_CGAL_Qt4 ) - find_package(Qt4 QUIET) - if( QT4_FOUND ) - include(${QT_USE_FILE}) - create_link_to_program(CGAL_Qt4) - endif() - endif() - - if ( WITH_CGAL_Qt5 ) - find_package(Qt5 QUIET) - if( Qt5_FOUND ) - create_link_to_program(CGAL_Qt5) - endif() - endif() - - if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Windows) - add_executable(display_dll_version_info display_dll_version_info.cpp) - target_link_libraries(display_dll_version_info version) - add_executable(test_gmp_mpfr_dll test_gmp_mpfr_dll.cpp) - target_link_libraries(test_gmp_mpfr_dll version) - CGAL_add_test(test_gmp_mpfr_dll) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS test_gmp_mpfr_dll ) - endif() - - find_package( LEDA QUIET) - if(LEDA_FOUND) - include( ${LEDA_USE_FILE} ) - add_executable(test_LEDA_IO test_LEDA_IO.cpp) - target_link_libraries(test_LEDA_IO ${LEDA_LIBRARIES}) - endif() - -else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") +if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Windows) + add_executable(display_dll_version_info display_dll_version_info.cpp) + target_link_libraries(display_dll_version_info version) + add_executable(test_gmp_mpfr_dll test_gmp_mpfr_dll.cpp) + target_link_libraries(test_gmp_mpfr_dll version) + cgal_add_test(test_gmp_mpfr_dll) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS test_gmp_mpfr_dll) +endif() +find_package(LEDA QUIET) +if(LEDA_FOUND) + include(${LEDA_USE_FILE}) + add_executable(test_LEDA_IO test_LEDA_IO.cpp) + target_link_libraries(test_LEDA_IO ${LEDA_LIBRARIES}) endif() function(CGAL_installation_test_find_package_version mode) @@ -110,33 +102,43 @@ function(CGAL_installation_test_find_package_version mode) set(CGAL_MAJOR_VERSION 0) endif() if(mode STREQUAL "greater" OR mode STREQUAL "fail-exact") - MATH(EXPR CGAL_MINOR_VERSION "${CGAL_MINOR_VERSION} + 1") + math(EXPR CGAL_MINOR_VERSION "${CGAL_MINOR_VERSION} + 1") endif() if(mode STREQUAL "exact" OR mode STREQUAL "fail-exact") set(EXACT "EXACT ") endif() - if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) - set(VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") + if(CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0) + set(VERSION + "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}.${CGAL_BUGFIX_VERSION}") else() set(VERSION "${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}") endif() - file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode}") - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode}) - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode}) - configure_file(test_find_package.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode}/CMakeLists.txt) - add_test(NAME test_find_package_version_${mode} - COMMAND ${CMAKE_COMMAND} -S ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode} -B ${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode} -DCGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE=ON) + file(REMOVE_RECURSE + "${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode}") + file(MAKE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode}) + file(MAKE_DIRECTORY + ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode}) + configure_file( + test_find_package.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode}/CMakeLists.txt + ) + add_test( + NAME test_find_package_version_${mode} + COMMAND + ${CMAKE_COMMAND} -S + ${CMAKE_CURRENT_BINARY_DIR}/test_find_package_version_${mode} -B + ${CMAKE_CURRENT_BINARY_DIR}/build-test_find_package_version_${mode} + -DCGAL_DO_NOT_WARN_ABOUT_CMAKE_BUILD_TYPE=ON) cgal_setup_test_properties(test_find_package_version_${mode}) endfunction() -CGAL_installation_test_find_package_version(less) -CGAL_installation_test_find_package_version(less_major) -CGAL_installation_test_find_package_version(equal) -CGAL_installation_test_find_package_version(greater) -CGAL_installation_test_find_package_version(exact) -CGAL_installation_test_find_package_version(fail-exact) +cgal_installation_test_find_package_version(less) +cgal_installation_test_find_package_version(less_major) +cgal_installation_test_find_package_version(equal) +cgal_installation_test_find_package_version(greater) +cgal_installation_test_find_package_version(exact) +cgal_installation_test_find_package_version(fail-exact) set_tests_properties( - test_find_package_version_greater - test_find_package_version_less_major - test_find_package_version_fail-exact - PROPERTIES WILL_FAIL TRUE) + test_find_package_version_greater test_find_package_version_less_major + test_find_package_version_fail-exact PROPERTIES WILL_FAIL TRUE) diff --git a/Interpolation/demo/Interpolation/CMakeLists.txt b/Interpolation/demo/Interpolation/CMakeLists.txt index 826a95d9713..687da543de9 100644 --- a/Interpolation/demo/Interpolation/CMakeLists.txt +++ b/Interpolation/demo/Interpolation/CMakeLists.txt @@ -1,9 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Interpolation_Demo ) +project(Interpolation_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,16 +11,7 @@ endif() set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "interpolation_2_demo.cpp" ) - create_single_source_cgal_program( "surface_voronoi.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +find_package(CGAL REQUIRED) +create_single_source_cgal_program("interpolation_2_demo.cpp") +create_single_source_cgal_program("surface_voronoi.cpp") diff --git a/Interpolation/examples/Interpolation/CMakeLists.txt b/Interpolation/examples/Interpolation/CMakeLists.txt index fec645432fa..04d873ebcda 100644 --- a/Interpolation/examples/Interpolation/CMakeLists.txt +++ b/Interpolation/examples/Interpolation/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Interpolation_Examples ) +project(Interpolation_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Interpolation/test/Interpolation/CMakeLists.txt b/Interpolation/test/Interpolation/CMakeLists.txt index f8b0f4f9af6..3050a0ce05f 100644 --- a/Interpolation/test/Interpolation/CMakeLists.txt +++ b/Interpolation/test/Interpolation/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Interpolation_Tests ) +project(Interpolation_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Intersections_2/test/Intersections_2/CMakeLists.txt b/Intersections_2/test/Intersections_2/CMakeLists.txt index 14f81ee8fa7..fb56ae4d58f 100644 --- a/Intersections_2/test/Intersections_2/CMakeLists.txt +++ b/Intersections_2/test/Intersections_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Intersections_2_Tests ) +project(Intersections_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Intersections_3/test/Intersections_3/CMakeLists.txt b/Intersections_3/test/Intersections_3/CMakeLists.txt index 5b289115cc8..ddacfb2434c 100644 --- a/Intersections_3/test/Intersections_3/CMakeLists.txt +++ b/Intersections_3/test/Intersections_3/CMakeLists.txt @@ -1,23 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Intersections_3_Tests ) +project(Intersections_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt b/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt index c01ef28e572..ad971bc9b79 100644 --- a/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt +++ b/Interval_skip_list/examples/Interval_skip_list/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Interval_skip_list_Examples ) +project(Interval_skip_list_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt b/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt index 60eb8232fd5..dfee9ae6e85 100644 --- a/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt +++ b/Interval_skip_list/test/Interval_skip_list/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Interval_skip_list_Tests ) +project(Interval_skip_list_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Interval_support/test/Interval_support/CMakeLists.txt b/Interval_support/test/Interval_support/CMakeLists.txt index f1b50541ed7..e5e1d9abcc6 100644 --- a/Interval_support/test/Interval_support/CMakeLists.txt +++ b/Interval_support/test/Interval_support/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Interval_support_Tests ) +project(Interval_support_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Inventor/test/Inventor/CMakeLists.txt b/Inventor/test/Inventor/CMakeLists.txt index f613c7acce1..c743b62d2b1 100644 --- a/Inventor/test/Inventor/CMakeLists.txt +++ b/Inventor/test/Inventor/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Inventor_Tests ) +project(Inventor_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt index 74595d7724f..6b6a120bea7 100644 --- a/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/examples/Jet_fitting_3/CMakeLists.txt @@ -1,46 +1,39 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Jet_fitting_3_Examples ) +project(Jet_fitting_3_Examples) +find_package(CGAL REQUIRED) - -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # use Eigen - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - # Link with Boost.ProgramOptions (optional) - find_package(Boost QUIET COMPONENTS program_options) - if(Boost_PROGRAM_OPTIONS_FOUND) - if(TARGET Boost::program_options) - set(Boost_PROGRAM_OPTIONS_LIBRARY Boost::program_options) - endif() - if( CGAL_AUTO_LINK_ENABLED ) - message( STATUS "Boost.ProgramOptions library: found" ) - else() - message( STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}" ) - endif() - add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" ) - list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) - endif() - - create_single_source_cgal_program( "Mesh_estimation.cpp" ) - target_link_libraries(Mesh_estimation PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "Single_estimation.cpp" ) - target_link_libraries(Single_estimation PUBLIC CGAL::Eigen_support) - - else() - message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") +# use Eigen +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + # Link with Boost.ProgramOptions (optional) + find_package(Boost QUIET COMPONENTS program_options) + if(Boost_PROGRAM_OPTIONS_FOUND) + if(TARGET Boost::program_options) + set(Boost_PROGRAM_OPTIONS_LIBRARY Boost::program_options) + endif() + if(CGAL_AUTO_LINK_ENABLED) + message(STATUS "Boost.ProgramOptions library: found") + else() + message( + STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}") + endif() + add_definitions("-DCGAL_USE_BOOST_PROGRAM_OPTIONS") + list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) endif() + create_single_source_cgal_program("Mesh_estimation.cpp") + target_link_libraries(Mesh_estimation PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("Single_estimation.cpp") + target_link_libraries(Single_estimation PUBLIC CGAL::Eigen_support) + else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt index 2ff8f62b541..72054804f9c 100644 --- a/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt +++ b/Jet_fitting_3/test/Jet_fitting_3/CMakeLists.txt @@ -1,28 +1,20 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Jet_fitting_3_Tests ) +project(Jet_fitting_3_Tests) +find_package(CGAL REQUIRED) - -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # use Eigen - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "blind_1pt.cpp" ) - target_link_libraries(blind_1pt PUBLIC CGAL::Eigen_support) - else() - message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") - endif() - +# use Eigen +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("blind_1pt.cpp") + target_link_libraries(blind_1pt PUBLIC CGAL::Eigen_support) else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/Kernel_23/examples/Kernel_23/CMakeLists.txt b/Kernel_23/examples/Kernel_23/CMakeLists.txt index ca0cbaba208..fb490446754 100644 --- a/Kernel_23/examples/Kernel_23/CMakeLists.txt +++ b/Kernel_23/examples/Kernel_23/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Kernel_23_Examples ) +project(Kernel_23_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Kernel_23/test/Kernel_23/CMakeLists.txt b/Kernel_23/test/Kernel_23/CMakeLists.txt index 8b2ed37665f..f4663d657f1 100644 --- a/Kernel_23/test/Kernel_23/CMakeLists.txt +++ b/Kernel_23/test/Kernel_23/CMakeLists.txt @@ -1,27 +1,19 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Kernel_23_Tests ) +project(Kernel_23_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL and CGAL_Core libraries, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Kernel_d/test/Kernel_d/CMakeLists.txt b/Kernel_d/test/Kernel_d/CMakeLists.txt index 16da7d47f30..01fce21c850 100644 --- a/Kernel_d/test/Kernel_d/CMakeLists.txt +++ b/Kernel_d/test/Kernel_d/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Kernel_d_Tests ) +project(Kernel_d_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() 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 c3c7aa9a7b2..28f298d7390 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_2/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.1...3.15) project(LCC_performance_2) - set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/) add_subdirectory(surface_mesh) @@ -10,7 +9,7 @@ find_package(CGAL REQUIRED) include_directories(BEFORE "./surface_mesh") include_directories(BEFORE "./cgogn" "./cgogn/include") -LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/cgogn/lib/Release) +link_directories(${CMAKE_CURRENT_SOURCE_DIR}/cgogn/lib/Release) include_directories(BEFORE "/usr/include/libxml2/") # For profilling with gprof @@ -25,47 +24,71 @@ include_directories(${OPENMESH_INCLUDE_DIR}) link_directories(${OPENMESH_LIBRARY_DIR}) # Polyhedron -add_executable(polyhedron_performance performance_2.h polyhedron_performance.h polyhedron_performance.cpp) +add_executable(polyhedron_performance performance_2.h polyhedron_performance.h + polyhedron_performance.cpp) target_link_libraries(polyhedron_performance ${CGAL_LIBRARIES}) # LCC_2 -add_executable(lcc_performance_2 performance_2.h lcc_performance_2.h lcc_performance_2.cpp) +add_executable(lcc_performance_2 performance_2.h lcc_performance_2.h + lcc_performance_2.cpp) target_link_libraries(lcc_performance_2 ${CGAL_LIBRARIES}) # Surface_mesh -add_executable(surface_mesh_performance performance_2.h surface_mesh_performance.h surface_mesh_performance.cpp) +add_executable( + surface_mesh_performance performance_2.h surface_mesh_performance.h + surface_mesh_performance.cpp) target_link_libraries(surface_mesh_performance surface_mesh) # Open_mesh -add_executable(openmesh_performance performance_2.h openmesh_performance.h openmesh_performance.cpp) +add_executable(openmesh_performance performance_2.h openmesh_performance.h + openmesh_performance.cpp) target_link_libraries(openmesh_performance ${OPENMESH_LIBRARIES}) # CGoGN find_package(Qt REQUIRED) -SET(QT_USE_QTSVG TRUE) -SET(QT_USE_QTXML TRUE ) -INCLUDE(${QT_USE_FILE}) -ADD_DEFINITIONS(${QT_DEFINITIONS}) -SET (CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR} ) -SET (CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} ${QT_LIBRARIES} ) +set(QT_USE_QTSVG TRUE) +set(QT_USE_QTXML TRUE) +include(${QT_USE_FILE}) +add_definitions(${QT_DEFINITIONS}) +set(CGoGN_EXT_INCLUDES ${CGoGN_EXT_INCLUDES} ${QT_INCLUDE_DIR}) +set(CGoGN_EXT_LIBS ${CGoGN_EXT_LIBS} ${QT_LIBRARIES}) -add_executable(cgogn_performance_2 performance_2.h cgogn_performance_2.h cgogn_performance_2.cpp) -target_link_libraries(cgogn_performance_2 algo assimp container nl topology utils Zinri z ${QT_LIBRARIES} ) +add_executable(cgogn_performance_2 performance_2.h cgogn_performance_2.h + cgogn_performance_2.cpp) +target_link_libraries( + cgogn_performance_2 + algo + assimp + container + nl + topology + utils + Zinri + z + ${QT_LIBRARIES}) # Performance_2 -add_executable(performance_2 +add_executable( + performance_2 performance_2.cpp performance_2.h polyhedron_performance.h openmesh_performance.h surface_mesh_performance.h cgogn_performance_2.h - lcc_performance_2.h -) + lcc_performance_2.h) -target_link_libraries(performance_2 +target_link_libraries( + performance_2 ${CGAL_LIBRARIES} surface_mesh - algo assimp container nl topology utils Zinri z ${QT_LIBRARIES} - ${OPENMESH_LIBRARIES} -) + algo + assimp + container + nl + topology + utils + Zinri + z + ${QT_LIBRARIES} + ${OPENMESH_LIBRARIES}) diff --git a/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt b/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt index 5deb9decee3..75f2c864dad 100644 --- a/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt +++ b/Linear_cell_complex/benchmark/Linear_cell_complex_3/CMakeLists.txt @@ -10,9 +10,9 @@ find_package(CGAL REQUIRED) find_package(Boost 1.43.0) if(Boost_FOUND) - include_directories(${Boost_INCLUDE_DIRS}) + include_directories(${Boost_INCLUDE_DIRS}) else() - set (USE_IN_SOURCE_TREE_BOOST true) + set(USE_IN_SOURCE_TREE_BOOST true) endif() add_subdirectory(openvolumemesh) @@ -22,29 +22,62 @@ include_directories(BEFORE "./cgogn" "./cgogn/include") include_directories(BEFORE "/usr/include/libxml2/") include_directories(BEFORE "/usr/include/eigen3/") -LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/cgogn/lib/Release) +link_directories(${CMAKE_CURRENT_SOURCE_DIR}/cgogn/lib/Release) find_package(Qt REQUIRED) -SET(QT_USE_QTSVG TRUE) -SET(QT_USE_QTXML TRUE ) -INCLUDE(${QT_USE_FILE}) -ADD_DEFINITIONS(${QT_DEFINITIONS}) +set(QT_USE_QTSVG TRUE) +set(QT_USE_QTXML TRUE) +include(${QT_USE_FILE}) +add_definitions(${QT_DEFINITIONS}) add_definitions(-DINCLUDE_TEMPLATES) # Performance_3 add_executable(performance_3 performance_3.cpp) add_dependencies(performance_3 OpenVolumeMesh) -target_link_libraries(performance_3 OpenVolumeMesh boost_timer boost_system ${CGAL_LIBRARIES} algo assimp container nl topology utils Zinri z xml2 ${QT_LIBRARIES} ${MAP_VIEWER_LIBRARIES}) +target_link_libraries( + performance_3 + OpenVolumeMesh + boost_timer + boost_system + ${CGAL_LIBRARIES} + algo + assimp + container + nl + topology + utils + Zinri + z + xml2 + ${QT_LIBRARIES} + ${MAP_VIEWER_LIBRARIES}) # CGoGN -add_executable(cgogn_performance_3 performance_3.h cgogn_performance_3.h cgogn_performance_3.cpp) -target_link_libraries(cgogn_performance_3 algo assimp container nl topology utils Zinri z xml2 ${QT_LIBRARIES} ) +add_executable(cgogn_performance_3 performance_3.h cgogn_performance_3.h + cgogn_performance_3.cpp) +target_link_libraries( + cgogn_performance_3 + algo + assimp + container + nl + topology + utils + Zinri + z + xml2 + ${QT_LIBRARIES}) # LCC_3 -add_executable(lcc_performance_3 performance_3.h lcc_performance_3.h lcc_performance_3.cpp) -target_link_libraries(lcc_performance_3 ${CGAL_LIBRARIES} ${MAP_VIEWER_LIBRARIES}) +add_executable(lcc_performance_3 performance_3.h lcc_performance_3.h + lcc_performance_3.cpp) +target_link_libraries(lcc_performance_3 ${CGAL_LIBRARIES} + ${MAP_VIEWER_LIBRARIES}) # OpenVolumeMesh -add_executable(openvolumemesh_performance performance_3.h openvolumemesh_performance.h openvolumemesh_performance.cpp) -target_link_libraries(openvolumemesh_performance OpenVolumeMesh boost_timer boost_system) +add_executable( + openvolumemesh_performance performance_3.h openvolumemesh_performance.h + openvolumemesh_performance.cpp) +target_link_libraries(openvolumemesh_performance OpenVolumeMesh boost_timer + boost_system) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt index 23122c42449..1d49f69cf2f 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt @@ -3,7 +3,7 @@ # cmake ../ -DCMAKE_BUILD_TYPE=Debug cmake_minimum_required(VERSION 3.1...3.15) -project (Linear_cell_complex_Demo) +project(Linear_cell_complex_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -35,38 +35,46 @@ set(CMAKE_AUTOMOC ON) add_definitions(-DCGAL_PROFILE_LCC_DEMO) ################## -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -if ( NOT (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) ) +if(NOT + (CGAL_Qt5_FOUND + AND Qt5_FOUND)) - MESSAGE(STATUS "NOTICE: This demo requires CGAL, " - "and Qt5, and will not be compiled.") + message(STATUS "NOTICE: This demo requires CGAL, " + "and Qt5, and will not be compiled.") else() -add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) -# ui file, created wih Qt Designer -qt5_wrap_ui(uis MainWindow.ui CreateMesh.ui CreateMenger.ui - CreateSierpinskiCarpet.ui CreateSierpinskiTriangle.ui) + # ui file, created wih Qt Designer + qt5_wrap_ui(uis MainWindow.ui CreateMesh.ui CreateMenger.ui + CreateSierpinskiCarpet.ui CreateSierpinskiTriangle.ui) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources (CGAL_Qt5_RESOURCE_FILES ./Linear_cell_complex_3.qrc) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Linear_cell_complex_3.qrc) -add_executable(Linear_cell_complex_3_demo - Linear_cell_complex_3_demo.cpp MainWindow.cpp - Viewer.cpp Linear_cell_complex_3_subdivision.cpp - Linear_cell_complex_pqq_subdivision.cpp - typedefs.h import_moka.h - ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_executable( + Linear_cell_complex_3_demo + Linear_cell_complex_3_demo.cpp + MainWindow.cpp + Viewer.cpp + Linear_cell_complex_3_subdivision.cpp + Linear_cell_complex_pqq_subdivision.cpp + typedefs.h + import_moka.h + ${uis} + ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES}) -add_to_cached_list(CGAL_EXECUTABLE_TARGETS Linear_cell_complex_3_demo) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Linear_cell_complex_3_demo) -target_link_libraries(Linear_cell_complex_3_demo PUBLIC - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui Qt5::OpenGL) + target_link_libraries(Linear_cell_complex_3_demo + PUBLIC CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui Qt5::OpenGL) -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Linear_cell_complex_3_demo) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Linear_cell_complex_3_demo) endif() diff --git a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt index 12f9e6ab63c..6ec867e1daa 100644 --- a/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/examples/Linear_cell_complex/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Linear_cell_complex_Examples ) +project(Linear_cell_complex_Examples) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,7 +13,7 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) @@ -26,27 +26,20 @@ endif() # To use valgrind, we must disable rounding math ckeck. # add_definitions(-DCGAL_DISABLE_ROUNDING_MATH_CHECK) -if (CGAL_FOUND) - - create_single_source_cgal_program("gmap_linear_cell_complex_3.cpp") - create_single_source_cgal_program("linear_cell_complex_3.cpp") - create_single_source_cgal_program("linear_cell_complex_3_attributes_management.cpp") - create_single_source_cgal_program("linear_cell_complex_3_operations.cpp") - create_single_source_cgal_program("linear_cell_complex_3_with_colored_vertices.cpp") - create_single_source_cgal_program("linear_cell_complex_3_with_mypoint.cpp") - create_single_source_cgal_program("linear_cell_complex_4.cpp") - create_single_source_cgal_program("plane_graph_to_lcc_2.cpp") - create_single_source_cgal_program("voronoi_2.cpp") - create_single_source_cgal_program("voronoi_3.cpp") - - create_single_source_cgal_program("draw_linear_cell_complex.cpp") - if(CGAL_Qt5_FOUND) - target_link_libraries(draw_linear_cell_complex PUBLIC CGAL::CGAL_Qt5) - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +create_single_source_cgal_program("gmap_linear_cell_complex_3.cpp") +create_single_source_cgal_program("linear_cell_complex_3.cpp") +create_single_source_cgal_program( + "linear_cell_complex_3_attributes_management.cpp") +create_single_source_cgal_program("linear_cell_complex_3_operations.cpp") +create_single_source_cgal_program( + "linear_cell_complex_3_with_colored_vertices.cpp") +create_single_source_cgal_program("linear_cell_complex_3_with_mypoint.cpp") +create_single_source_cgal_program("linear_cell_complex_4.cpp") +create_single_source_cgal_program("plane_graph_to_lcc_2.cpp") +create_single_source_cgal_program("voronoi_2.cpp") +create_single_source_cgal_program("voronoi_3.cpp") +create_single_source_cgal_program("draw_linear_cell_complex.cpp") +if(CGAL_Qt5_FOUND) + target_link_libraries(draw_linear_cell_complex PUBLIC CGAL::CGAL_Qt5) endif() - diff --git a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt index 10bdb9e68b2..32b71fab7ae 100644 --- a/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/test/Linear_cell_complex/CMakeLists.txt @@ -1,28 +1,21 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Linear_cell_complex_Tests ) +project(Linear_cell_complex_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - file(GLOB hfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.h) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" "${hfiles}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +file( + GLOB hfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.h) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}" "${hfiles}") +endforeach() diff --git a/Matrix_search/examples/Matrix_search/CMakeLists.txt b/Matrix_search/examples/Matrix_search/CMakeLists.txt index 4e9988d7eb6..d7e55f718fe 100644 --- a/Matrix_search/examples/Matrix_search/CMakeLists.txt +++ b/Matrix_search/examples/Matrix_search/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Matrix_search_Examples ) +project(Matrix_search_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Matrix_search/test/Matrix_search/CMakeLists.txt b/Matrix_search/test/Matrix_search/CMakeLists.txt index bda7b6b88c4..2a436b82a55 100644 --- a/Matrix_search/test/Matrix_search/CMakeLists.txt +++ b/Matrix_search/test/Matrix_search/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Matrix_search_Tests ) +project(Matrix_search_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Mesh_2/demo/Mesh_2/CMakeLists.txt b/Mesh_2/demo/Mesh_2/CMakeLists.txt index 5d2a871c8bd..82e60abddd8 100644 --- a/Mesh_2/demo/Mesh_2/CMakeLists.txt +++ b/Mesh_2/demo/Mesh_2/CMakeLists.txt @@ -2,35 +2,27 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Mesh_2_Demo ) +project(Mesh_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. cmake_policy(SET CMP0053 OLD) endif() -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) +include(${CGAL_USE_FILE}) -if ( CGAL_FOUND ) - include(${CGAL_USE_FILE}) +# conform target +add_executable(conform conform.cpp) +target_link_libraries(conform ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +add_to_cached_list(CGAL_EXECUTABLE_TARGETS conform) - # conform target - add_executable (conform conform.cpp) - target_link_libraries(conform ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS conform ) +# mesh target +add_executable(mesh mesh.cpp) +target_link_libraries(mesh ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +add_to_cached_list(CGAL_EXECUTABLE_TARGETS mesh) - # mesh target - add_executable (mesh mesh.cpp) - target_link_libraries(mesh ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS mesh ) - - include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) - cgal_add_compilation_test(conform) - cgal_add_compilation_test(mesh) - -else() - - message(STATUS "NOTICE: This demo requires CGAL and will not be compiled.") - -endif() +include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) +cgal_add_compilation_test(conform) +cgal_add_compilation_test(mesh) diff --git a/Mesh_2/examples/Mesh_2/CMakeLists.txt b/Mesh_2/examples/Mesh_2/CMakeLists.txt index d1c294b5a1a..2d72451f5dc 100644 --- a/Mesh_2/examples/Mesh_2/CMakeLists.txt +++ b/Mesh_2/examples/Mesh_2/CMakeLists.txt @@ -1,19 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Mesh_2_Examples ) +project(Mesh_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Mesh_2/test/Mesh_2/CMakeLists.txt b/Mesh_2/test/Mesh_2/CMakeLists.txt index 6702712b4b4..c718cc98268 100644 --- a/Mesh_2/test/Mesh_2/CMakeLists.txt +++ b/Mesh_2/test/Mesh_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Mesh_2_Tests ) +project(Mesh_2_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Mesh_3/archive/applications/CMakeLists.txt b/Mesh_3/archive/applications/CMakeLists.txt index 275882fea39..a12805344ef 100644 --- a/Mesh_3/archive/applications/CMakeLists.txt +++ b/Mesh_3/archive/applications/CMakeLists.txt @@ -1,43 +1,43 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Mesh_3_applications ) +project(Mesh_3_applications) include_directories(../include) - find_package(CGAL COMPONENTS ImageIO) -if ( CGAL_FOUND ) - find_package( Boost COMPONENTS program_options filesystem system) +find_package(Boost COMPONENTS program_options filesystem system) - if ( Boost_FOUND AND Boost_VERSION GREATER 103400) - if ( Boost_PROGRAM_OPTIONS_FOUND AND Boost_FILESYSTEM_FOUND ) - include_directories(${Boost_INCLUDE_DIRS}) - list(APPEND CGAL_3RD_PARTY_LIBRARIES "${Boost_LIBRARIES}") - else() - message(FATAL_ERROR "This program requires libs boost_program_options, boost_filesystem and boost_system") - endif() +if(Boost_FOUND AND Boost_VERSION GREATER 103400) + if(Boost_PROGRAM_OPTIONS_FOUND AND Boost_FILESYSTEM_FOUND) + include_directories(${Boost_INCLUDE_DIRS}) + list(APPEND CGAL_3RD_PARTY_LIBRARIES "${Boost_LIBRARIES}") else() - message(FATAL_ERROR "This program requires Boost >= 1.34.1") + message( + FATAL_ERROR + "This program requires libs boost_program_options, boost_filesystem and boost_system" + ) endif() +else() + message(FATAL_ERROR "This program requires Boost >= 1.34.1") +endif() # Compilable examples - create_single_source_cgal_program( "mesh_implicit_domains.cpp" "../examples/Mesh_3/implicit_functions.cpp" ) - if( CGAL_ImageIO_USE_ZLIB ) - create_single_source_cgal_program( "mesh_3D_image.cpp" ) - else() - message( STATUS "NOTICE: The example mesh_3D_image.cpp needs CGAL_ImageIO to be configured with ZLIB support, and will not be compiled." ) - endif() - create_single_source_cgal_program( "mesh_polyhedral_domain.cpp" ) - create_single_source_cgal_program( "output_distribution_to_stdout.cpp" ) - create_single_source_cgal_program( "mesher_tester.cpp" "../examples/Mesh_3/implicit_functions.cpp" ) - create_single_source_cgal_program( "mesher_tester_image.cpp" ) - create_single_source_cgal_program( "mesher_tester_polyhedron.cpp" ) +create_single_source_cgal_program("mesh_implicit_domains.cpp" + "../examples/Mesh_3/implicit_functions.cpp") +if(CGAL_ImageIO_USE_ZLIB) + create_single_source_cgal_program("mesh_3D_image.cpp") else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: The example mesh_3D_image.cpp needs CGAL_ImageIO to be configured with ZLIB support, and will not be compiled." + ) endif() +create_single_source_cgal_program("mesh_polyhedral_domain.cpp") +create_single_source_cgal_program("output_distribution_to_stdout.cpp") +create_single_source_cgal_program("mesher_tester.cpp" + "../examples/Mesh_3/implicit_functions.cpp") +create_single_source_cgal_program("mesher_tester_image.cpp") +create_single_source_cgal_program("mesher_tester_polyhedron.cpp") diff --git a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt index 1987d458724..d383dc91755 100644 --- a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt +++ b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt @@ -1,36 +1,38 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Mesh_3_benchmark ) - - +project(Mesh_3_benchmark) # Creates a new CMake option, turned ON by default -option(ACTIVATE_MSVC_PRECOMPILED_HEADERS - "Activate precompiled headers in MSVC" - OFF) +option(ACTIVATE_MSVC_PRECOMPILED_HEADERS "Activate precompiled headers in MSVC" + OFF) # Macro to add precompiled headers for MSVC # This function does two things: # 1. Enable precompiled headers on each file which is listed in "SourcesVar". # 2. Add the content of "PrecompiledSource" (e.g. "StdAfx.cpp") to "SourcesVar". -MACRO(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource SourcesVar) - IF(MSVC AND ACTIVATE_MSVC_PRECOMPILED_HEADERS) - GET_FILENAME_COMPONENT(PrecompiledBasename ${PrecompiledHeader} NAME_WE) - SET(Sources ${${SourcesVar}}) +macro(ADD_MSVC_PRECOMPILED_HEADER PrecompiledHeader PrecompiledSource + SourcesVar) + if(MSVC AND ACTIVATE_MSVC_PRECOMPILED_HEADERS) + get_filename_component(PrecompiledBasename ${PrecompiledHeader} NAME_WE) + set(Sources ${${SourcesVar}}) - SET_SOURCE_FILES_PROPERTIES(${PrecompiledSource} - PROPERTIES COMPILE_FLAGS "/Yc\"${PrecompiledHeader}\"") - SET_SOURCE_FILES_PROPERTIES(${Sources} - PROPERTIES COMPILE_FLAGS "/Yu\"${PrecompiledHeaders}\" /FI\"${PrecompiledHeader}\"") + set_source_files_properties( + ${PrecompiledSource} PROPERTIES COMPILE_FLAGS + "/Yc\"${PrecompiledHeader}\"") + set_source_files_properties( + ${Sources} + PROPERTIES COMPILE_FLAGS + "/Yu\"${PrecompiledHeaders}\" /FI\"${PrecompiledHeader}\"") # Add precompiled header to SourcesVar - LIST(APPEND ${SourcesVar} ${PrecompiledSource}) - ENDIF(MSVC AND ACTIVATE_MSVC_PRECOMPILED_HEADERS) -ENDMACRO(ADD_MSVC_PRECOMPILED_HEADER) + list(APPEND ${SourcesVar} ${PrecompiledSource}) + endif(MSVC AND ACTIVATE_MSVC_PRECOMPILED_HEADERS) +endmacro(ADD_MSVC_PRECOMPILED_HEADER) # The compiler might need more memory because of precompiled headers -if(MSVC AND ACTIVATE_MSVC_PRECOMPILED_HEADERS AND NOT(MSVC_VERSION LESS 1310)) +if(MSVC + AND ACTIVATE_MSVC_PRECOMPILED_HEADERS + AND NOT (MSVC_VERSION LESS 1310)) set(CGAL_C_FLAGS "${CGAL_C_FLAGS} /Zm1000") set(CGAL_CXX_FLAGS "${CGAL_CXX_FLAGS} /Zm1000") endif() @@ -41,58 +43,54 @@ include_directories(../../../AABB_tree/include) add_definitions(-DCGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX -DCGAL_MESH_3_NO_DEPRECATED_C3T3_ITERATORS) -if ( MESH_3_VERBOSE ) +if(MESH_3_VERBOSE) add_definitions(-DCGAL_MESH_3_VERBOSE) endif() -find_package(CGAL COMPONENTS ImageIO) +find_package(CGAL REQUIRED COMPONENTS ImageIO) -if ( CGAL_FOUND ) - # Activate concurrency ? (turned OFF by default) - option(CGAL_ACTIVATE_CONCURRENT_MESH_3 - "Activate parallelism in Mesh_3" - OFF) +# Activate concurrency ? (turned OFF by default) +option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF) - # And add -DCGAL_CONCURRENT_MESH_3 if that option is ON - if( CGAL_ACTIVATE_CONCURRENT_MESH_3 ) - add_definitions( -DCGAL_CONCURRENT_MESH_3 ) - find_package( TBB REQUIRED ) +# And add -DCGAL_CONCURRENT_MESH_3 if that option is ON +if(CGAL_ACTIVATE_CONCURRENT_MESH_3) + add_definitions(-DCGAL_CONCURRENT_MESH_3) + find_package(TBB REQUIRED) + include(CGAL_TBB_support) +else() + option(LINK_WITH_TBB + "Link with TBB anyway so we can use TBB timers for profiling" ON) + if(LINK_WITH_TBB) + find_package(TBB) include(CGAL_TBB_support) + endif(LINK_WITH_TBB) +endif() + +# Link with Boost.ProgramOptions (optional) +find_package(Boost QUIET COMPONENTS program_options) +if(Boost_PROGRAM_OPTIONS_FOUND) + if(CGAL_AUTO_LINK_ENABLED) + message(STATUS "Boost.ProgramOptions library: found") else() - option( LINK_WITH_TBB - "Link with TBB anyway so we can use TBB timers for profiling" - ON) - if( LINK_WITH_TBB ) - find_package( TBB ) - include(CGAL_TBB_support) - endif( LINK_WITH_TBB ) + message( + STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}") endif() + add_definitions("-DCGAL_USE_BOOST_PROGRAM_OPTIONS") + list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_LIBRARIES}) +endif() - # Link with Boost.ProgramOptions (optional) - find_package(Boost QUIET COMPONENTS program_options) - if(Boost_PROGRAM_OPTIONS_FOUND) - if( CGAL_AUTO_LINK_ENABLED ) - message( STATUS "Boost.ProgramOptions library: found" ) - else() - message( STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}" ) - endif() - add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" ) - list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_LIBRARIES}) - endif() - - if ( Boost_FOUND AND Boost_VERSION GREATER 103400 ) - # Compilable benchmark - set (BENCHMARK_SOURCE_FILES "concurrency.cpp") - ADD_MSVC_PRECOMPILED_HEADER("StdAfx.h" "StdAfx.cpp" BENCHMARK_SOURCE_FILES) - create_single_source_cgal_program( ${BENCHMARK_SOURCE_FILES} ) - if(TARGET CGAL::TBB_support) - target_link_libraries(concurrency PUBLIC CGAL::TBB_support) - endif() - - else() - message(STATUS "NOTICE: This program requires Boost >= 1.34.1, and will not be compiled.") +if(Boost_FOUND AND Boost_VERSION GREATER 103400) + # Compilable benchmark + set(BENCHMARK_SOURCE_FILES "concurrency.cpp") + add_msvc_precompiled_header("StdAfx.h" "StdAfx.cpp" BENCHMARK_SOURCE_FILES) + create_single_source_cgal_program(${BENCHMARK_SOURCE_FILES}) + if(TARGET CGAL::TBB_support) + target_link_libraries(concurrency PUBLIC CGAL::TBB_support) endif() else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") + message( + STATUS + "NOTICE: This program requires Boost >= 1.34.1, and will not be compiled." + ) endif() diff --git a/Mesh_3/examples/Mesh_3/CMakeLists.txt b/Mesh_3/examples/Mesh_3/CMakeLists.txt index a97ae6fcb26..20170938095 100644 --- a/Mesh_3/examples/Mesh_3/CMakeLists.txt +++ b/Mesh_3/examples/Mesh_3/CMakeLists.txt @@ -1,21 +1,21 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Mesh_3_Examples ) +project(Mesh_3_Examples) add_definitions(-DCGAL_MESH_3_NO_DEPRECATED_SURFACE_INDEX -DCGAL_MESH_3_NO_DEPRECATED_C3T3_ITERATORS) -if ( CGAL_MESH_3_VERBOSE ) +if(CGAL_MESH_3_VERBOSE) add_definitions(-DCGAL_MESH_3_VERBOSE) endif() -find_package(CGAL COMPONENTS ImageIO) +find_package(CGAL REQUIRED COMPONENTS ImageIO) find_package(Boost) option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF) -if( CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3} ) - add_definitions( -DCGAL_CONCURRENT_MESH_3 ) - find_package( TBB REQUIRED ) +if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}) + add_definitions(-DCGAL_CONCURRENT_MESH_3) + find_package(TBB REQUIRED) include(CGAL_TBB_support) endif() @@ -28,7 +28,7 @@ if(VTK_FOUND) if(VTK_USE_FILE) include(${VTK_USE_FILE}) endif() - if ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) + if("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) message(STATUS "VTK found") if(TARGET VTK::IOImage) set(VTK_LIBRARIES VTK::ImagingGeneral VTK::IOImage) @@ -40,117 +40,144 @@ else() message(STATUS "VTK was not found") endif() -create_single_source_cgal_program( "mesh_hybrid_mesh_domain.cpp" ) +create_single_source_cgal_program("mesh_hybrid_mesh_domain.cpp") target_link_libraries(mesh_hybrid_mesh_domain PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_implicit_sphere.cpp" ) +create_single_source_cgal_program("mesh_implicit_sphere.cpp") target_link_libraries(mesh_implicit_sphere PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_implicit_sphere_variable_size.cpp" ) -target_link_libraries(mesh_implicit_sphere_variable_size PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("mesh_implicit_sphere_variable_size.cpp") +target_link_libraries(mesh_implicit_sphere_variable_size + PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_two_implicit_spheres_with_balls.cpp" ) -target_link_libraries(mesh_two_implicit_spheres_with_balls PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("mesh_two_implicit_spheres_with_balls.cpp") +target_link_libraries(mesh_two_implicit_spheres_with_balls + PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_implicit_domains_2.cpp" "implicit_functions.cpp" ) +create_single_source_cgal_program("mesh_implicit_domains_2.cpp" + "implicit_functions.cpp") target_link_libraries(mesh_implicit_domains_2 PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_cubes_intersection.cpp" ) +create_single_source_cgal_program("mesh_cubes_intersection.cpp") target_link_libraries(mesh_cubes_intersection PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_cubes_intersection_with_features.cpp" ) -target_link_libraries(mesh_cubes_intersection_with_features PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("mesh_cubes_intersection_with_features.cpp") +target_link_libraries(mesh_cubes_intersection_with_features + PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_implicit_domains.cpp" "implicit_functions.cpp" ) +create_single_source_cgal_program("mesh_implicit_domains.cpp" + "implicit_functions.cpp") target_link_libraries(mesh_implicit_domains PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_polyhedral_domain.cpp" ) +create_single_source_cgal_program("mesh_polyhedral_domain.cpp") target_link_libraries(mesh_polyhedral_domain PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_polyhedral_domain_sm.cpp" ) +create_single_source_cgal_program("mesh_polyhedral_domain_sm.cpp") target_link_libraries(mesh_polyhedral_domain_sm PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_polyhedral_domain_with_surface_inside.cpp" ) -target_link_libraries(mesh_polyhedral_domain_with_surface_inside PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program( + "mesh_polyhedral_domain_with_surface_inside.cpp") +target_link_libraries(mesh_polyhedral_domain_with_surface_inside + PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "remesh_polyhedral_surface.cpp" ) +create_single_source_cgal_program("remesh_polyhedral_surface.cpp") target_link_libraries(remesh_polyhedral_surface PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "remesh_polyhedral_surface_sm.cpp" ) +create_single_source_cgal_program("remesh_polyhedral_surface_sm.cpp") target_link_libraries(remesh_polyhedral_surface_sm PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_polyhedral_domain_with_features.cpp" ) -target_link_libraries(mesh_polyhedral_domain_with_features PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("mesh_polyhedral_domain_with_features.cpp") +target_link_libraries(mesh_polyhedral_domain_with_features + PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_polyhedral_domain_with_features_sm.cpp" ) -target_link_libraries(mesh_polyhedral_domain_with_features_sm PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("mesh_polyhedral_domain_with_features_sm.cpp") +target_link_libraries(mesh_polyhedral_domain_with_features_sm + PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_polyhedral_domain_with_lipschitz_sizing.cpp" ) -target_link_libraries(mesh_polyhedral_domain_with_lipschitz_sizing PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program( + "mesh_polyhedral_domain_with_lipschitz_sizing.cpp") +target_link_libraries(mesh_polyhedral_domain_with_lipschitz_sizing + PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_polyhedral_complex.cpp" ) +create_single_source_cgal_program("mesh_polyhedral_complex.cpp") target_link_libraries(mesh_polyhedral_complex PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mesh_polyhedral_complex_sm.cpp" ) +create_single_source_cgal_program("mesh_polyhedral_complex_sm.cpp") target_link_libraries(mesh_polyhedral_complex_sm PUBLIC CGAL::Eigen_support) -if( TARGET CGAL::CGAL_ImageIO) - if( VTK_FOUND AND ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) ) - add_executable ( mesh_3D_gray_vtk_image mesh_3D_gray_vtk_image.cpp ) - target_link_libraries( mesh_3D_gray_vtk_image PUBLIC CGAL::Eigen_support CGAL::CGAL CGAL::CGAL_ImageIO ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${VTK_LIBRARIES}) - cgal_add_test( mesh_3D_gray_vtk_image ) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS mesh_3D_gray_vtk_image ) +if(TARGET CGAL::CGAL_ImageIO) + if(VTK_FOUND AND ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION + VERSION_GREATER 5)) + add_executable(mesh_3D_gray_vtk_image mesh_3D_gray_vtk_image.cpp) + target_link_libraries( + mesh_3D_gray_vtk_image + PUBLIC CGAL::Eigen_support CGAL::CGAL CGAL::CGAL_ImageIO + ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${VTK_LIBRARIES}) + cgal_add_test(mesh_3D_gray_vtk_image) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS mesh_3D_gray_vtk_image) endif() - create_single_source_cgal_program( "mesh_3D_gray_image.cpp" ) + create_single_source_cgal_program("mesh_3D_gray_image.cpp") target_link_libraries(mesh_3D_gray_image PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "mesh_3D_gray_image_multiple_values.cpp" ) - target_link_libraries(mesh_3D_gray_image_multiple_values PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("mesh_3D_gray_image_multiple_values.cpp") + target_link_libraries(mesh_3D_gray_image_multiple_values + PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "mesh_3D_image_with_features.cpp" ) + create_single_source_cgal_program("mesh_3D_image_with_features.cpp") target_link_libraries(mesh_3D_image_with_features PUBLIC CGAL::Eigen_support) - if( CGAL_ImageIO_USE_ZLIB ) - create_single_source_cgal_program( "mesh_optimization_example.cpp" ) + if(CGAL_ImageIO_USE_ZLIB) + create_single_source_cgal_program("mesh_optimization_example.cpp") target_link_libraries(mesh_optimization_example PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "mesh_optimization_lloyd_example.cpp" ) - target_link_libraries(mesh_optimization_lloyd_example PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("mesh_optimization_lloyd_example.cpp") + target_link_libraries(mesh_optimization_lloyd_example + PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "mesh_3D_image.cpp" ) + create_single_source_cgal_program("mesh_3D_image.cpp") target_link_libraries(mesh_3D_image PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "mesh_3D_image_with_custom_initialization.cpp" ) - target_link_libraries(mesh_3D_image_with_custom_initialization PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program( + "mesh_3D_image_with_custom_initialization.cpp") + target_link_libraries(mesh_3D_image_with_custom_initialization + PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "mesh_3D_image_variable_size.cpp" ) - target_link_libraries(mesh_3D_image_variable_size PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("mesh_3D_image_variable_size.cpp") + target_link_libraries(mesh_3D_image_variable_size + PUBLIC CGAL::Eigen_support) else() - message( STATUS "NOTICE: The examples mesh_3D_image.cpp, mesh_3D_image_variable_size.cpp, mesh_optimization_example.cpp and mesh_optimization_lloyd_example.cpp need CGAL_ImageIO to be configured with ZLIB support, and will not be compiled." ) + message( + STATUS + "NOTICE: The examples mesh_3D_image.cpp, mesh_3D_image_variable_size.cpp, mesh_optimization_example.cpp and mesh_optimization_lloyd_example.cpp need CGAL_ImageIO to be configured with ZLIB support, and will not be compiled." + ) endif() else() - message( STATUS "NOTICE: Some examples need the CGAL_ImageIO library, and will not be compiled." ) + message( + STATUS + "NOTICE: Some examples need the CGAL_ImageIO library, and will not be compiled." + ) endif() if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support) - foreach(target - mesh_3D_image - mesh_3D_image_variable_size - mesh_3D_image_with_custom_initialization - mesh_3D_image_with_features - mesh_implicit_sphere - mesh_implicit_sphere_variable_size - mesh_optimization_example - mesh_optimization_lloyd_example - mesh_polyhedral_complex - mesh_polyhedral_complex_sm - mesh_polyhedral_domain - mesh_polyhedral_domain_sm - mesh_polyhedral_domain_with_features - mesh_polyhedral_domain_with_features_sm - mesh_polyhedral_domain_with_lipschitz_sizing - mesh_two_implicit_spheres_with_balls) + foreach( + target + mesh_3D_image + mesh_3D_image_variable_size + mesh_3D_image_with_custom_initialization + mesh_3D_image_with_features + mesh_implicit_sphere + mesh_implicit_sphere_variable_size + mesh_optimization_example + mesh_optimization_lloyd_example + mesh_polyhedral_complex + mesh_polyhedral_complex_sm + mesh_polyhedral_domain + mesh_polyhedral_domain_sm + mesh_polyhedral_domain_with_features + mesh_polyhedral_domain_with_features_sm + mesh_polyhedral_domain_with_lipschitz_sizing + mesh_two_implicit_spheres_with_balls) if(TARGET ${target}) target_link_libraries(${target} PUBLIC CGAL::TBB_support) endif() diff --git a/Mesh_3/test/Mesh_3/CMakeLists.txt b/Mesh_3/test/Mesh_3/CMakeLists.txt index d731e12d4e4..83dea289157 100644 --- a/Mesh_3/test/Mesh_3/CMakeLists.txt +++ b/Mesh_3/test/Mesh_3/CMakeLists.txt @@ -1,125 +1,124 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Mesh_3_Tests ) - +project(Mesh_3_Tests) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() -find_package(CGAL QUIET COMPONENTS ImageIO) +find_package(CGAL REQUIRED COMPONENTS ImageIO) -if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) +include(${CGAL_USE_FILE}) - find_package( TBB QUIET ) - include(CGAL_TBB_support) +find_package(TBB QUIET) +include(CGAL_TBB_support) - # Use Eigen - find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) - include(CGAL_Eigen_support) - if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") - return() +# Use Eigen +find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +include(CGAL_Eigen_support) +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") + return() +endif() + +create_single_source_cgal_program("test_boost_has_xxx.cpp") +create_single_source_cgal_program("test_c3t3.cpp") +create_single_source_cgal_program("test_mesh_capsule_var_distance_bound.cpp") +create_single_source_cgal_program( + "test_implicit_multi_domain_to_labeling_function_wrapper.cpp") +create_single_source_cgal_program("test_c3t3_io.cpp") +create_single_source_cgal_program("test_c3t3_with_features.cpp") +create_single_source_cgal_program("test_criteria.cpp") +create_single_source_cgal_program("test_domain_with_polyline_features.cpp") +create_single_source_cgal_program("test_labeled_mesh_domain_3.cpp") +create_single_source_cgal_program("test_mesh_criteria_creation.cpp") +create_single_source_cgal_program("test_c3t3_into_facegraph.cpp") +create_single_source_cgal_program("test_without_detect_features.cpp") +if(CGAL_ImageIO_USE_ZLIB) + create_single_source_cgal_program("test_meshing_3D_image.cpp") + create_single_source_cgal_program("test_meshing_3D_image_deprecated.cpp") + create_single_source_cgal_program("test_meshing_3D_gray_image.cpp") + create_single_source_cgal_program("test_meshing_3D_gray_image_deprecated.cpp") +else() + message( + STATUS + "test_meshing_3D_image requires the ZLIB library, and will not be compiled." + ) +endif() +create_single_source_cgal_program("test_meshing_implicit_function.cpp") +create_single_source_cgal_program( + "test_meshing_implicit_function_deprecated.cpp") +create_single_source_cgal_program("test_meshing_polyhedral_complex.cpp") +create_single_source_cgal_program("test_meshing_polyhedron.cpp") +create_single_source_cgal_program("test_meshing_polylines_only.cpp") +create_single_source_cgal_program("test_meshing_polyhedron_with_features.cpp") +create_single_source_cgal_program("test_meshing_verbose.cpp") +create_single_source_cgal_program("test_meshing_unit_tetrahedron.cpp") +create_single_source_cgal_program("test_meshing_with_default_edge_size.cpp") +create_single_source_cgal_program("test_meshing_determinism.cpp") +create_single_source_cgal_program("test_c3t3_extract_subdomains_boundaries.cpp") +create_single_source_cgal_program("test_mesh_3_issue_1554.cpp") +create_single_source_cgal_program( + "test_mesh_polyhedral_domain_with_features_deprecated.cpp") +create_single_source_cgal_program("test_meshing_with_one_step.cpp") + +foreach( + target + test_boost_has_xxx + test_c3t3 + test_mesh_capsule_var_distance_bound + test_implicit_multi_domain_to_labeling_function_wrapper + test_c3t3_io + test_c3t3_with_features + test_criteria + test_domain_with_polyline_features + test_labeled_mesh_domain_3 + test_mesh_criteria_creation + test_c3t3_into_facegraph + test_without_detect_features + test_meshing_3D_image + test_meshing_3D_image_deprecated + test_meshing_3D_gray_image + test_meshing_3D_gray_image_deprecated + test_meshing_implicit_function + test_meshing_implicit_function_deprecated + test_meshing_polyhedral_complex + test_meshing_polyhedron + test_meshing_polylines_only + test_meshing_polyhedron_with_features + test_meshing_verbose + test_meshing_unit_tetrahedron + test_meshing_with_default_edge_size + test_meshing_determinism + test_c3t3_extract_subdomains_boundaries + test_mesh_3_issue_1554 + test_mesh_polyhedral_domain_with_features_deprecated + test_meshing_with_one_step.cpp) + if(TARGET ${target}) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) endif() +endforeach() - create_single_source_cgal_program( "test_boost_has_xxx.cpp" ) - create_single_source_cgal_program( "test_c3t3.cpp" ) - create_single_source_cgal_program( "test_mesh_capsule_var_distance_bound.cpp" ) - create_single_source_cgal_program( "test_implicit_multi_domain_to_labeling_function_wrapper.cpp" ) - create_single_source_cgal_program( "test_c3t3_io.cpp" ) - create_single_source_cgal_program( "test_c3t3_with_features.cpp" ) - create_single_source_cgal_program( "test_criteria.cpp" ) - create_single_source_cgal_program( "test_domain_with_polyline_features.cpp" ) - create_single_source_cgal_program( "test_labeled_mesh_domain_3.cpp" ) - create_single_source_cgal_program( "test_mesh_criteria_creation.cpp" ) - create_single_source_cgal_program( "test_c3t3_into_facegraph.cpp" ) - create_single_source_cgal_program( "test_without_detect_features.cpp" ) - if(CGAL_ImageIO_USE_ZLIB) - create_single_source_cgal_program( "test_meshing_3D_image.cpp" ) - create_single_source_cgal_program( "test_meshing_3D_image_deprecated.cpp" ) - create_single_source_cgal_program( "test_meshing_3D_gray_image.cpp" ) - create_single_source_cgal_program( "test_meshing_3D_gray_image_deprecated.cpp" ) - else() - message(STATUS "test_meshing_3D_image requires the ZLIB library, and will not be compiled.") - endif() - create_single_source_cgal_program( "test_meshing_implicit_function.cpp" ) - create_single_source_cgal_program( "test_meshing_implicit_function_deprecated.cpp" ) - create_single_source_cgal_program( "test_meshing_polyhedral_complex.cpp" ) - create_single_source_cgal_program( "test_meshing_polyhedron.cpp" ) - create_single_source_cgal_program( "test_meshing_polylines_only.cpp" ) - create_single_source_cgal_program( "test_meshing_polyhedron_with_features.cpp" ) - create_single_source_cgal_program( "test_meshing_verbose.cpp" ) - create_single_source_cgal_program( "test_meshing_unit_tetrahedron.cpp" ) - create_single_source_cgal_program( "test_meshing_with_default_edge_size.cpp" ) - create_single_source_cgal_program( "test_meshing_determinism.cpp" ) - create_single_source_cgal_program( "test_c3t3_extract_subdomains_boundaries.cpp" ) - create_single_source_cgal_program( "test_mesh_3_issue_1554.cpp" ) - create_single_source_cgal_program( "test_mesh_polyhedral_domain_with_features_deprecated.cpp" ) - create_single_source_cgal_program( "test_meshing_with_one_step.cpp" ) - - foreach(target - test_boost_has_xxx - test_c3t3 - test_mesh_capsule_var_distance_bound - test_implicit_multi_domain_to_labeling_function_wrapper - test_c3t3_io - test_c3t3_with_features - test_criteria - test_domain_with_polyline_features - test_labeled_mesh_domain_3 - test_mesh_criteria_creation - test_c3t3_into_facegraph - test_without_detect_features - test_meshing_3D_image - test_meshing_3D_image_deprecated - test_meshing_3D_gray_image - test_meshing_3D_gray_image_deprecated - test_meshing_implicit_function - test_meshing_implicit_function_deprecated - test_meshing_polyhedral_complex - test_meshing_polyhedron - test_meshing_polylines_only - test_meshing_polyhedron_with_features - test_meshing_verbose - test_meshing_unit_tetrahedron - test_meshing_with_default_edge_size - test_meshing_determinism - test_c3t3_extract_subdomains_boundaries - test_mesh_3_issue_1554 - test_mesh_polyhedral_domain_with_features_deprecated - test_meshing_with_one_step.cpp) +if(TARGET CGAL::TBB_support) + foreach( + target + test_meshing_verbose + test_meshing_polyhedron_with_features + test_meshing_utilities.h + test_meshing_implicit_function + test_meshing_3D_image + test_meshing_3D_gray_image + test_meshing_unit_tetrahedron + test_meshing_polyhedron + test_meshing_polyhedral_complex + test_mesh_capsule_var_distance_bound + test_mesh_3_issue_1554 + test_mesh_polyhedral_domain_with_features_deprecated) if(TARGET ${target}) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + target_link_libraries(${target} PUBLIC CGAL::TBB_support) endif() endforeach() - - if(TARGET CGAL::TBB_support) - foreach(target - test_meshing_verbose - test_meshing_polyhedron_with_features - test_meshing_utilities.h - test_meshing_implicit_function - test_meshing_3D_image - test_meshing_3D_gray_image - test_meshing_unit_tetrahedron - test_meshing_polyhedron - test_meshing_polyhedral_complex - test_mesh_capsule_var_distance_bound - test_mesh_3_issue_1554 - test_mesh_polyhedral_domain_with_features_deprecated - ) - if(TARGET ${target}) - target_link_libraries(${target} PUBLIC CGAL::TBB_support) - endif() - endforeach() - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - endif() diff --git a/Minkowski_sum_2/examples/Minkowski_sum_2/CMakeLists.txt b/Minkowski_sum_2/examples/Minkowski_sum_2/CMakeLists.txt index 93727f69aaa..d168091c9d5 100644 --- a/Minkowski_sum_2/examples/Minkowski_sum_2/CMakeLists.txt +++ b/Minkowski_sum_2/examples/Minkowski_sum_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Minkowski_sum_2_Examples ) +project(Minkowski_sum_2_Examples) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt b/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt index 1399a98fe6b..831697fb97a 100644 --- a/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt +++ b/Minkowski_sum_2/test/Minkowski_sum_2/CMakeLists.txt @@ -1,10 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Minkowski_sum_2_Tests ) - +project(Minkowski_sum_2_Tests) # Commented out C++11 for now # list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11) @@ -17,20 +15,15 @@ project( Minkowski_sum_2_Tests ) # set(CMAKE_CXX_STANDARD 11) # set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -find_package(CGAL QUIET COMPONENTS Core ) +find_package(CGAL REQUIRED COMPONENTS Core) -if ( CGAL_FOUND ) +include(${CGAL_USE_FILE}) - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Minkowski_sum_3/examples/Minkowski_sum_3/CMakeLists.txt b/Minkowski_sum_3/examples/Minkowski_sum_3/CMakeLists.txt index befee7b6e47..1281891e896 100644 --- a/Minkowski_sum_3/examples/Minkowski_sum_3/CMakeLists.txt +++ b/Minkowski_sum_3/examples/Minkowski_sum_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Minkowski_sum_3_Examples ) +project(Minkowski_sum_3_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt b/Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt index bbe62fc768b..5de6d320c8b 100644 --- a/Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt +++ b/Minkowski_sum_3/test/Minkowski_sum_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Minkowski_sum_3_Tests ) +project(Minkowski_sum_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Modifier/test/Modifier/CMakeLists.txt b/Modifier/test/Modifier/CMakeLists.txt index 9d7960880d1..9210b6f446a 100644 --- a/Modifier/test/Modifier/CMakeLists.txt +++ b/Modifier/test/Modifier/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Modifier_Tests ) +project(Modifier_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Modular_arithmetic/examples/Modular_arithmetic/CMakeLists.txt b/Modular_arithmetic/examples/Modular_arithmetic/CMakeLists.txt index 5253aeb73c5..9c92ace370d 100644 --- a/Modular_arithmetic/examples/Modular_arithmetic/CMakeLists.txt +++ b/Modular_arithmetic/examples/Modular_arithmetic/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Modular_arithmetic_Examples ) +project(Modular_arithmetic_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Modular_arithmetic/test/Modular_arithmetic/CMakeLists.txt b/Modular_arithmetic/test/Modular_arithmetic/CMakeLists.txt index d867b90d18c..9e2247933a8 100644 --- a/Modular_arithmetic/test/Modular_arithmetic/CMakeLists.txt +++ b/Modular_arithmetic/test/Modular_arithmetic/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Modular_arithmetic_Tests ) +project(Modular_arithmetic_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Nef_2/examples/Nef_2/CMakeLists.txt b/Nef_2/examples/Nef_2/CMakeLists.txt index 9fa46fd26b3..fae016065d4 100644 --- a/Nef_2/examples/Nef_2/CMakeLists.txt +++ b/Nef_2/examples/Nef_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Nef_2_Examples ) +project(Nef_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Nef_2/test/Nef_2/CMakeLists.txt b/Nef_2/test/Nef_2/CMakeLists.txt index 146a6f24ad7..e705e8bd9b5 100644 --- a/Nef_2/test/Nef_2/CMakeLists.txt +++ b/Nef_2/test/Nef_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Nef_2_Tests ) +project(Nef_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Nef_3/examples/Nef_3/CMakeLists.txt b/Nef_3/examples/Nef_3/CMakeLists.txt index 1dc62e9b098..74babd6486f 100644 --- a/Nef_3/examples/Nef_3/CMakeLists.txt +++ b/Nef_3/examples/Nef_3/CMakeLists.txt @@ -1,32 +1,24 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Nef_3_Examples ) +project(Nef_3_Examples) - -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) - add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - if(CGAL_Qt5_FOUND) - target_link_libraries(draw_nef_3 PUBLIC CGAL::CGAL_Qt5) - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +if(CGAL_Qt5_FOUND) + target_link_libraries(draw_nef_3 PUBLIC CGAL::CGAL_Qt5) endif() - diff --git a/Nef_3/test/Nef_3/CMakeLists.txt b/Nef_3/test/Nef_3/CMakeLists.txt index 3bfee8a90ce..54c783d3b25 100644 --- a/Nef_3/test/Nef_3/CMakeLists.txt +++ b/Nef_3/test/Nef_3/CMakeLists.txt @@ -1,40 +1,33 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Nef_3_Tests ) +project(Nef_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +include_directories(BEFORE "include") -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - if(BUILD_TESTING) - set_tests_properties( - execution___of__Nef_3_problematic_construction - execution___of__test_nef_3_io_Cartesian - execution___of__test_nef_3_io_Cartesian_Lazy - execution___of__test_nef_3_io_EPEC - execution___of__test_nef_3_io_EPIC - execution___of__test_nef_3_io_Homogeneous - execution___of__test_nef_3_io_Homogenoeus_Lazy - execution___of__test_with_extended_homogeneous - execution___of__test_with_homogeneous - execution___of__test_with_lazy - PROPERTIES RESOURCE_LOCK Nef_3_Tests_IO) - endif() -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +if(BUILD_TESTING) + set_tests_properties( + execution___of__Nef_3_problematic_construction + execution___of__test_nef_3_io_Cartesian + execution___of__test_nef_3_io_Cartesian_Lazy + execution___of__test_nef_3_io_EPEC + execution___of__test_nef_3_io_EPIC + execution___of__test_nef_3_io_Homogeneous + execution___of__test_nef_3_io_Homogenoeus_Lazy + execution___of__test_with_extended_homogeneous + execution___of__test_with_homogeneous + execution___of__test_with_lazy + PROPERTIES RESOURCE_LOCK Nef_3_Tests_IO) endif() - diff --git a/Nef_S2/examples/Nef_S2/CMakeLists.txt b/Nef_S2/examples/Nef_S2/CMakeLists.txt index af7b5183285..ef64ca0ef2e 100644 --- a/Nef_S2/examples/Nef_S2/CMakeLists.txt +++ b/Nef_S2/examples/Nef_S2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Nef_S2_Examples ) +project(Nef_S2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Nef_S2/test/Nef_S2/CMakeLists.txt b/Nef_S2/test/Nef_S2/CMakeLists.txt index 81dea1dbe18..21f0baac7cc 100644 --- a/Nef_S2/test/Nef_S2/CMakeLists.txt +++ b/Nef_S2/test/Nef_S2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Nef_S2_Tests ) +project(Nef_S2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/NewKernel_d/test/NewKernel_d/CMakeLists.txt b/NewKernel_d/test/NewKernel_d/CMakeLists.txt index ba586fee06d..fc1b4ecd97e 100644 --- a/NewKernel_d/test/NewKernel_d/CMakeLists.txt +++ b/NewKernel_d/test/NewKernel_d/CMakeLists.txt @@ -2,33 +2,29 @@ # This is the CMake script for compiling a CGAL application. # Then modified by hand to add Eigen3. - cmake_minimum_required(VERSION 3.1...3.15) -project( NewKernel_d_Tests ) - +project(NewKernel_d_Tests) if(CMAKE_COMPILER_IS_GNUCCX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - message(STATUS "NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled.") + message( + STATUS + "NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled." + ) return() endif() -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - find_package(Eigen3) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "Epick_d.cpp" ) - target_link_libraries(Epick_d PUBLIC CGAL::Eigen_support) - else() - - message(STATUS "NOTICE: This program requires the Eigen3 library, and will not be compiled.") - - endif() +find_package(CGAL REQUIRED) +find_package(Eigen3) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("Epick_d.cpp") + target_link_libraries(Epick_d PUBLIC CGAL::Eigen_support) else() - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") + message( + STATUS + "NOTICE: This program requires the Eigen3 library, and will not be compiled." + ) endif() diff --git a/Number_types/test/Number_types/CMakeLists.txt b/Number_types/test/Number_types/CMakeLists.txt index 68ff96cb432..e6bd7db16aa 100644 --- a/Number_types/test/Number_types/CMakeLists.txt +++ b/Number_types/test/Number_types/CMakeLists.txt @@ -4,94 +4,83 @@ # when it is not installed cmake_minimum_required(VERSION 3.1...3.15) -project( Number_types_Tests ) +project(Number_types_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) +include(${CGAL_USE_FILE}) +include(CGAL_VersionUtils) -find_package( CGAL QUIET COMPONENTS Core ) +include_directories(BEFORE include) -if ( CGAL_FOUND ) +create_single_source_cgal_program("bench_interval.cpp") +create_single_source_cgal_program("constant.cpp") +create_single_source_cgal_program("CORE_BigFloat.cpp") +create_single_source_cgal_program("CORE_BigInt.cpp") +create_single_source_cgal_program("CORE_BigRat.cpp") +create_single_source_cgal_program("CORE_Expr.cpp") +create_single_source_cgal_program("Counted_number.cpp") +create_single_source_cgal_program("double.cpp") +create_single_source_cgal_program("doubletst.cpp") +create_single_source_cgal_program("float.cpp") +create_single_source_cgal_program("floattst.cpp") +create_single_source_cgal_program("Gmpfr.cpp") +create_single_source_cgal_program("Gmpq.cpp") +create_single_source_cgal_program("Gmpq_new.cpp") +create_single_source_cgal_program("Gmpz.cpp") +create_single_source_cgal_program("Gmpzf_new.cpp") +create_single_source_cgal_program("int.cpp") +create_single_source_cgal_program("Interval_nt.cpp") +create_single_source_cgal_program("Interval_nt_new.cpp") +create_single_source_cgal_program("ioformat.cpp") +create_single_source_cgal_program("known_bit_size_integers.cpp") +create_single_source_cgal_program("Lazy_exact_nt.cpp") +create_single_source_cgal_program("Lazy_exact_nt_new.cpp") +create_single_source_cgal_program("leda_bigfloat.cpp") +create_single_source_cgal_program("leda_bigfloat_interval.cpp") +create_single_source_cgal_program("leda_integer.cpp") +create_single_source_cgal_program("leda_rational.cpp") +create_single_source_cgal_program("leda_real.cpp") +create_single_source_cgal_program("long_double.cpp") +create_single_source_cgal_program("long_doubletst.cpp") +create_single_source_cgal_program("long_long.cpp") +create_single_source_cgal_program("MP_Float.cpp") +create_single_source_cgal_program("MP_Float_exact.cpp") +create_single_source_cgal_program("mpq_class.cpp") +create_single_source_cgal_program("mpz_class.cpp") +create_single_source_cgal_program("Mpzf.cpp") +create_single_source_cgal_program("Nef_polynomial.cpp") +create_single_source_cgal_program("NT_checker.cpp") +create_single_source_cgal_program("Quotient.cpp") +create_single_source_cgal_program("quotient_io.cpp") +create_single_source_cgal_program("root_of_2.cpp") +create_single_source_cgal_program("Root_of_traits.cpp") +create_single_source_cgal_program("rounding_modes.cpp") +create_single_source_cgal_program("simplest_rational.cpp") +create_single_source_cgal_program("Sqrt_extension_false.cpp") +create_single_source_cgal_program("Sqrt_extension_true.cpp") +create_single_source_cgal_program("_test_valid_finite_double.cpp") +create_single_source_cgal_program("_test_valid_finite_float.cpp") +create_single_source_cgal_program("to_interval_test.cpp") +create_single_source_cgal_program("unsigned.cpp") +create_single_source_cgal_program("utilities.cpp") +find_package(GMP) +if(GMP_FOUND) + create_single_source_cgal_program("CORE_Expr_ticket_4296.cpp") + find_package(MPFI) + if(MPFI_FOUND) + include(${MPFI_USE_FILE}) + endif(MPFI_FOUND) +endif(GMP_FOUND) +# all the programs below will be linked against MPFI in case it is present +create_single_source_cgal_program("Gmpfi.cpp") +create_single_source_cgal_program("Gmpfr_bug.cpp") +create_single_source_cgal_program("Quotient_new.cpp") +create_single_source_cgal_program("test_nt_Coercion_traits.cpp") - include(${CGAL_USE_FILE}) - include( CGAL_VersionUtils ) - - include_directories( BEFORE include ) - - create_single_source_cgal_program( "bench_interval.cpp" ) - create_single_source_cgal_program( "constant.cpp" ) - create_single_source_cgal_program( "CORE_BigFloat.cpp" ) - create_single_source_cgal_program( "CORE_BigInt.cpp" ) - create_single_source_cgal_program( "CORE_BigRat.cpp" ) - create_single_source_cgal_program( "CORE_Expr.cpp" ) - create_single_source_cgal_program( "Counted_number.cpp" ) - create_single_source_cgal_program( "double.cpp" ) - create_single_source_cgal_program( "doubletst.cpp" ) - create_single_source_cgal_program( "float.cpp" ) - create_single_source_cgal_program( "floattst.cpp" ) - create_single_source_cgal_program( "Gmpfr.cpp" ) - create_single_source_cgal_program( "Gmpq.cpp" ) - create_single_source_cgal_program( "Gmpq_new.cpp" ) - create_single_source_cgal_program( "Gmpz.cpp" ) - create_single_source_cgal_program( "Gmpzf_new.cpp" ) - create_single_source_cgal_program( "int.cpp" ) - create_single_source_cgal_program( "Interval_nt.cpp" ) - create_single_source_cgal_program( "Interval_nt_new.cpp" ) - create_single_source_cgal_program( "ioformat.cpp" ) - create_single_source_cgal_program( "known_bit_size_integers.cpp" ) - create_single_source_cgal_program( "Lazy_exact_nt.cpp" ) - create_single_source_cgal_program( "Lazy_exact_nt_new.cpp" ) - create_single_source_cgal_program( "leda_bigfloat.cpp" ) - create_single_source_cgal_program( "leda_bigfloat_interval.cpp" ) - create_single_source_cgal_program( "leda_integer.cpp" ) - create_single_source_cgal_program( "leda_rational.cpp" ) - create_single_source_cgal_program( "leda_real.cpp" ) - create_single_source_cgal_program( "long_double.cpp" ) - create_single_source_cgal_program( "long_doubletst.cpp" ) - create_single_source_cgal_program( "long_long.cpp" ) - create_single_source_cgal_program( "MP_Float.cpp" ) - create_single_source_cgal_program( "MP_Float_exact.cpp" ) - create_single_source_cgal_program( "mpq_class.cpp" ) - create_single_source_cgal_program( "mpz_class.cpp" ) - create_single_source_cgal_program( "Mpzf.cpp" ) - create_single_source_cgal_program( "Nef_polynomial.cpp" ) - create_single_source_cgal_program( "NT_checker.cpp" ) - create_single_source_cgal_program( "Quotient.cpp" ) - create_single_source_cgal_program( "quotient_io.cpp" ) - create_single_source_cgal_program( "root_of_2.cpp" ) - create_single_source_cgal_program( "Root_of_traits.cpp" ) - create_single_source_cgal_program( "rounding_modes.cpp" ) - create_single_source_cgal_program( "simplest_rational.cpp" ) - create_single_source_cgal_program( "Sqrt_extension_false.cpp" ) - create_single_source_cgal_program( "Sqrt_extension_true.cpp" ) - create_single_source_cgal_program( "_test_valid_finite_double.cpp" ) - create_single_source_cgal_program( "_test_valid_finite_float.cpp" ) - create_single_source_cgal_program( "to_interval_test.cpp" ) - create_single_source_cgal_program( "unsigned.cpp" ) - create_single_source_cgal_program( "utilities.cpp" ) - find_package( GMP ) - if( GMP_FOUND ) - create_single_source_cgal_program( "CORE_Expr_ticket_4296.cpp" ) - find_package( MPFI ) - if( MPFI_FOUND ) - include( ${MPFI_USE_FILE} ) - endif( MPFI_FOUND ) - endif( GMP_FOUND ) - # all the programs below will be linked against MPFI in case it is present - create_single_source_cgal_program( "Gmpfi.cpp" ) - create_single_source_cgal_program( "Gmpfr_bug.cpp" ) - create_single_source_cgal_program( "Quotient_new.cpp" ) - create_single_source_cgal_program( "test_nt_Coercion_traits.cpp" ) - - create_single_source_cgal_program( "eigen.cpp" ) - find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - target_link_libraries(eigen PUBLIC CGAL::Eigen_support) - endif() - -else( CGAL_FOUND ) - - message(STATUS - "These tests require the CGAL library and will not be compiled.") - -endif( CGAL_FOUND ) +create_single_source_cgal_program("eigen.cpp") +find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + target_link_libraries(eigen PUBLIC CGAL::Eigen_support) +endif() diff --git a/Optimal_bounding_box/benchmarks/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/benchmarks/Optimal_bounding_box/CMakeLists.txt index 86632a0be7c..4049c0d61f8 100644 --- a/Optimal_bounding_box/benchmarks/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/benchmarks/Optimal_bounding_box/CMakeLists.txt @@ -2,23 +2,19 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Optimal_bounding_box_Benchmark ) +project(Optimal_bounding_box_Benchmark) # CGAL and its components -find_package( CGAL QUIET ) - -if ( NOT CGAL_FOUND ) - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() -endif() +find_package(CGAL REQUIRED) # include helper file -include( ${CGAL_USE_FILE} ) +include(${CGAL_USE_FILE}) find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") return() endif() diff --git a/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt index 9b657c24e1b..9fdfcadbd14 100644 --- a/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt @@ -2,21 +2,17 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Optimal_bounding_box_Examples ) +project(Optimal_bounding_box_Examples) -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if (NOT CGAL_FOUND) - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() -endif() - -include( ${CGAL_USE_FILE} ) +include(${CGAL_USE_FILE}) find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") return() endif() @@ -24,9 +20,7 @@ create_single_source_cgal_program("obb_example.cpp") create_single_source_cgal_program("obb_with_point_maps_example.cpp") create_single_source_cgal_program("rotated_aabb_tree_example.cpp") -foreach(target - obb_example - obb_with_point_maps_example - rotated_aabb_tree_example) +foreach(target obb_example obb_with_point_maps_example + rotated_aabb_tree_example) target_link_libraries(${target} PUBLIC CGAL::Eigen_support) endforeach() diff --git a/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt index 1ba260a6b92..28101edbef2 100644 --- a/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt @@ -2,21 +2,17 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Optimal_bounding_box_Tests ) +project(Optimal_bounding_box_Tests) -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if (NOT CGAL_FOUND) - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() -endif() - -include( ${CGAL_USE_FILE} ) +include(${CGAL_USE_FILE}) find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") return() endif() @@ -24,9 +20,6 @@ create_single_source_cgal_program("test_OBB_traits.cpp") create_single_source_cgal_program("test_nelder_mead.cpp") create_single_source_cgal_program("test_optimization_algorithms.cpp") -foreach(target - test_OBB_traits - test_nelder_mead - test_optimization_algorithms) +foreach(target test_OBB_traits test_nelder_mead test_optimization_algorithms) target_link_libraries(${target} PUBLIC CGAL::Eigen_support) endforeach() diff --git a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt index f85ab571b3e..f9745ca9715 100644 --- a/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/demo/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -13,10 +13,10 @@ if(POLICY CMP0071) endif() # Include this package's headers first -include_directories( BEFORE ./ ./include ) +include_directories(BEFORE ./ ./include) # Find CGAL and CGAL Qt5 -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) # Find Qt5 itself find_package(Qt5 5.4 QUIET COMPONENTS OpenGL) @@ -26,86 +26,77 @@ if(Qt5_FOUND) endif(Qt5_FOUND) # Find CImg -find_path(CIMG_INCLUDE_DIR - NAMES CImg.h - HINTS ENV CIMG_INC_DIR - DOC "Path to the header of the CImg library") +find_path( + CIMG_INCLUDE_DIR + NAMES CImg.h + HINTS ENV CIMG_INC_DIR + DOC "Path to the header of the CImg library") -if (CIMG_INCLUDE_DIR) - MESSAGE(STATUS "CImg library found, the demo can load point set from image files.") +if(CIMG_INCLUDE_DIR) + message( + STATUS "CImg library found, the demo can load point set from image files.") else() - MESSAGE(STATUS "CImg library was not found, the demo will not be able to load point set from image files. " - "Try setting the environment variable CIMG_INC_DIR to point to the path of the directory containing CImg.h.") + message( + STATUS + "CImg library was not found, the demo will not be able to load point set from image files. " + "Try setting the environment variable CIMG_INC_DIR to point to the path of the directory containing CImg.h." + ) endif() -if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) - set( - SRCS - glviewer.cpp - scene.cpp - Otr2_demo.cpp - window.cpp - render.cpp - ) + set(SRCS glviewer.cpp scene.cpp Otr2_demo.cpp window.cpp render.cpp) - set( - CGAL_Qt5_MOC_FILES - moc_dialog_options.cxx - moc_glviewer.cxx - moc_window.cxx - ) + set(CGAL_Qt5_MOC_FILES moc_dialog_options.cxx moc_glviewer.cxx moc_window.cxx) - set( - UIS - pwsrec.ui - options.ui - ) + set(UIS pwsrec.ui options.ui) - qt5_wrap_ui( UI_FILES ${UIS} ) + qt5_wrap_ui(UI_FILES ${UIS}) include(AddFileDependencies) - qt5_generate_moc( "window.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_window.cxx" ) - add_file_dependencies( moc_window.cxx "${CMAKE_CURRENT_SOURCE_DIR}/window.h" ) + qt5_generate_moc("window.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_window.cxx") + add_file_dependencies(moc_window.cxx "${CMAKE_CURRENT_SOURCE_DIR}/window.h") - qt5_generate_moc( "glviewer.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_glviewer.cxx" ) - add_file_dependencies( moc_glviewer.cxx "${CMAKE_CURRENT_SOURCE_DIR}/glviewer.h" ) + qt5_generate_moc("glviewer.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_glviewer.cxx") + add_file_dependencies(moc_glviewer.cxx + "${CMAKE_CURRENT_SOURCE_DIR}/glviewer.h") - qt5_generate_moc( "dialog_options.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_dialog_options.cxx" ) - add_file_dependencies( moc_dialog_options.cxx "${CMAKE_CURRENT_SOURCE_DIR}/dialog_options.h" ) + qt5_generate_moc("dialog_options.h" + "${CMAKE_CURRENT_BINARY_DIR}/moc_dialog_options.cxx") + add_file_dependencies(moc_dialog_options.cxx + "${CMAKE_CURRENT_SOURCE_DIR}/dialog_options.h") - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES pwsrec.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES pwsrec.qrc) - add_executable ( Otr2_demo ${SRCS} ${CGAL_Qt5_MOC_FILES} ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}) + add_executable(Otr2_demo ${SRCS} ${CGAL_Qt5_MOC_FILES} ${UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES}) - target_link_libraries( Otr2_demo PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui Qt5::OpenGL ) + target_link_libraries(Otr2_demo PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui + Qt5::OpenGL) # Link with pthread if necessary - if (CIMG_INCLUDE_DIR) - target_compile_definitions( Otr2_demo PRIVATE -DCGAL_USE_CIMG ) - target_include_directories( Otr2_demo PRIVATE ${CIMG_INCLUDE_DIR} ) + if(CIMG_INCLUDE_DIR) + target_compile_definitions(Otr2_demo PRIVATE -DCGAL_USE_CIMG) + target_include_directories(Otr2_demo PRIVATE ${CIMG_INCLUDE_DIR}) # Is pthread around? If yes, we need to link against it set(CMAKE_THREAD_PREFER_PTHREAD TRUE) - find_package (Threads) - if (CMAKE_USE_PTHREADS_INIT) - target_link_libraries( Otr2_demo PRIVATE ${CMAKE_THREAD_LIBS_INIT} ) + find_package(Threads) + if(CMAKE_USE_PTHREADS_INIT) + target_link_libraries(Otr2_demo PRIVATE ${CMAKE_THREAD_LIBS_INIT}) endif() endif() - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Otr2_demo ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Otr2_demo) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Otr2_demo) -else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +else( + CGAL_Qt5_FOUND + AND Qt5_FOUND) set(OTR2_MISSING_DEPS "") - if(NOT CGAL_FOUND) - set(OTR2_MISSING_DEPS "the CGAL library, ${OTR2_MISSING_DEPS}") - endif() - if(NOT CGAL_Qt5_FOUND) set(OTR2_MISSING_DEPS "the CGAL Qt5 library, ${OTR2_MISSING_DEPS}") endif() @@ -114,6 +105,11 @@ else (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) set(OTR2_MISSING_DEPS "Qt5.4, ${OTR2_MISSING_DEPS}") endif() - message(STATUS "NOTICE: This demo requires ${OTR2_MISSING_DEPS}and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires ${OTR2_MISSING_DEPS}and will not be compiled." + ) -endif (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) +endif( + CGAL_Qt5_FOUND + AND Qt5_FOUND) diff --git a/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt index 2a1b3c54e13..e69bd583481 100644 --- a/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/examples/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -1,19 +1,10 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Optimal_transportation_reconstruction_2_Examples ) +project(Optimal_transportation_reconstruction_2_Examples) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "otr2_simplest_example.cpp" ) - create_single_source_cgal_program( "otr2_simplest_example_with_tolerance.cpp" ) - create_single_source_cgal_program( "otr2_list_output_example.cpp" ) - create_single_source_cgal_program( "otr2_indexed_output_example.cpp" ) - create_single_source_cgal_program( "otr2_mass_example.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +find_package(CGAL REQUIRED) +create_single_source_cgal_program("otr2_simplest_example.cpp") +create_single_source_cgal_program("otr2_simplest_example_with_tolerance.cpp") +create_single_source_cgal_program("otr2_list_output_example.cpp") +create_single_source_cgal_program("otr2_indexed_output_example.cpp") +create_single_source_cgal_program("otr2_mass_example.cpp") diff --git a/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt b/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt index 2b3e42955b8..b3f684685e4 100644 --- a/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt +++ b/Optimal_transportation_reconstruction_2/test/Optimal_transportation_reconstruction_2/CMakeLists.txt @@ -1,23 +1,14 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Optimal_transportation_reconstruction_2_Tests ) +project(Optimal_transportation_reconstruction_2_Tests) -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - create_single_source_cgal_program( "test_basic.cpp" ) - create_single_source_cgal_program( "test_flip_procedure.cpp" ) - create_single_source_cgal_program( "test_output_modules.cpp" ) - create_single_source_cgal_program( "test_quality.cpp" ) - create_single_source_cgal_program( "test_reconstruction_until.cpp" ) - create_single_source_cgal_program( "test_vertex_edge.cpp" ) - create_single_source_cgal_program( "otr2_epeck.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +create_single_source_cgal_program("test_basic.cpp") +create_single_source_cgal_program("test_flip_procedure.cpp") +create_single_source_cgal_program("test_output_modules.cpp") +create_single_source_cgal_program("test_quality.cpp") +create_single_source_cgal_program("test_reconstruction_until.cpp") +create_single_source_cgal_program("test_vertex_edge.cpp") +create_single_source_cgal_program("otr2_epeck.cpp") diff --git a/Partition_2/examples/Partition_2/CMakeLists.txt b/Partition_2/examples/Partition_2/CMakeLists.txt index 2ef27f359ae..e46b0eb635a 100644 --- a/Partition_2/examples/Partition_2/CMakeLists.txt +++ b/Partition_2/examples/Partition_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Partition_2_Examples ) +project(Partition_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Partition_2/test/Partition_2/CMakeLists.txt b/Partition_2/test/Partition_2/CMakeLists.txt index 5c6765c013b..6754e27e390 100644 --- a/Partition_2/test/Partition_2/CMakeLists.txt +++ b/Partition_2/test/Partition_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Partition_2_Tests ) +project(Partition_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt index 77aa297fabc..369a68ad0e1 100644 --- a/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt +++ b/Periodic_2_triangulation_2/examples/Periodic_2_triangulation_2/CMakeLists.txt @@ -1,31 +1,24 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_2_triangulation_2_Examples ) +project(Periodic_2_triangulation_2_Examples) - -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - if(CGAL_Qt5_FOUND) - target_link_libraries(draw_periodic_2_triangulation_2 PUBLIC CGAL::CGAL_Qt5) - endif() -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +if(CGAL_Qt5_FOUND) + target_link_libraries(draw_periodic_2_triangulation_2 PUBLIC CGAL::CGAL_Qt5) endif() - diff --git a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt index f47d27d37ad..eb748ac24bd 100644 --- a/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt +++ b/Periodic_2_triangulation_2/test/Periodic_2_triangulation_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_2_triangulation_2_Tests ) +project(Periodic_2_triangulation_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt index 0b936e2c370..373da679ef9 100644 --- a/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt +++ b/Periodic_3_mesh_3/examples/Periodic_3_mesh_3/CMakeLists.txt @@ -2,56 +2,50 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_3_mesh_3_Examples ) - +project(Periodic_3_mesh_3_Examples) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() # CGAL and its components -find_package( CGAL QUIET COMPONENTS ImageIO ) +find_package(CGAL REQUIRED COMPONENTS ImageIO) -if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) -else() - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() -endif() +include(${CGAL_USE_FILE}) # include for local package # Use Eigen find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") return() endif() # Boost and its components -find_package( Boost ) +find_package(Boost) -if ( NOT Boost_FOUND ) - message(STATUS "This project requires the Boost library, and will not be compiled.") +if(NOT Boost_FOUND) + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() # Creating entries for all C++ files with "main" routine # ########################################################## -create_single_source_cgal_program( "mesh_implicit_shape.cpp" ) -create_single_source_cgal_program( "mesh_implicit_multi_domain.cpp" ) -create_single_source_cgal_program( "mesh_implicit_shape_with_subdomains.cpp" ) -create_single_source_cgal_program( "mesh_implicit_shape_with_optimizers.cpp" ) -create_single_source_cgal_program( "mesh_implicit_shape_with_features.cpp" ) +create_single_source_cgal_program("mesh_implicit_shape.cpp") +create_single_source_cgal_program("mesh_implicit_multi_domain.cpp") +create_single_source_cgal_program("mesh_implicit_shape_with_subdomains.cpp") +create_single_source_cgal_program("mesh_implicit_shape_with_optimizers.cpp") +create_single_source_cgal_program("mesh_implicit_shape_with_features.cpp") - -foreach(target - mesh_implicit_shape - mesh_implicit_multi_domain - mesh_implicit_shape_with_subdomains - mesh_implicit_shape_with_optimizers - mesh_implicit_shape_with_features) +foreach( + target + mesh_implicit_shape mesh_implicit_multi_domain + mesh_implicit_shape_with_subdomains mesh_implicit_shape_with_optimizers + mesh_implicit_shape_with_features) target_link_libraries(${target} PUBLIC CGAL::Eigen_support) endforeach() diff --git a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt index ceba5546a54..8dfc601878a 100644 --- a/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt +++ b/Periodic_3_mesh_3/test/Periodic_3_mesh_3/CMakeLists.txt @@ -2,35 +2,30 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_3_mesh_3_Tests ) - +project(Periodic_3_mesh_3_Tests) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() -find_package( CGAL QUIET COMPONENTS ImageIO ) +find_package(CGAL REQUIRED COMPONENTS ImageIO) -if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) - - # Use Eigen - find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) - include(CGAL_Eigen_support) - if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") - return() - endif() - - create_single_source_cgal_program( "test_implicit_shapes_bunch.cpp" ) - target_link_libraries(test_implicit_shapes_bunch PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "test_implicit_shapes_with_features.cpp" ) - target_link_libraries(test_implicit_shapes_with_features PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "test_triply_periodic_minimal_surfaces.cpp" ) - target_link_libraries(test_triply_periodic_minimal_surfaces PUBLIC CGAL::Eigen_support) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +include(${CGAL_USE_FILE}) +# Use Eigen +find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +include(CGAL_Eigen_support) +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") + return() endif() + +create_single_source_cgal_program("test_implicit_shapes_bunch.cpp") +target_link_libraries(test_implicit_shapes_bunch PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("test_implicit_shapes_with_features.cpp") +target_link_libraries(test_implicit_shapes_with_features + PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("test_triply_periodic_minimal_surfaces.cpp") +target_link_libraries(test_triply_periodic_minimal_surfaces + PUBLIC CGAL::Eigen_support) diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt index eb9fc4be537..bbbeecc0371 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt @@ -1,9 +1,8 @@ - # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_3_triangulation_3_Demo ) +project(Periodic_3_triangulation_3_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -15,75 +14,92 @@ if(POLICY CMP0071) endif() # Find CGAL -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS Xml OpenGL Help Core) - if(Qt5_FOUND) add_definitions(-DQT_NO_KEYWORDS) set(CMAKE_INCLUDE_CURRENT_DIR ON) endif(Qt5_FOUND) -if( Qt5Help_VERSION VERSION_LESS 5.12 ) +if(Qt5Help_VERSION VERSION_LESS 5.12) set(CGAL_QCOLLECTIONGENERATOR_TARGET Qt5::qcollectiongenerator) else() set(CGAL_QCOLLECTIONGENERATOR_TARGET Qt5::qhelpgenerator) endif() -if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND TARGET ${CGAL_QCOLLECTIONGENERATOR_TARGET}) +if(CGAL_Qt5_FOUND + AND Qt5_FOUND + AND TARGET ${CGAL_QCOLLECTIONGENERATOR_TARGET}) # UI files (Qt Designer files) - qt5_wrap_ui ( UI_FILES MainWindow.ui ) + qt5_wrap_ui(UI_FILES MainWindow.ui) # qrc files (resource files) - qt5_add_resources( CGAL_Qt5_RESOURCE_FILES ./Periodic_3_triangulation_3.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Periodic_3_triangulation_3.qrc) # use the Qt MOC preprocessor on classes that derive from QObject - qt5_generate_moc( "Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_Scene.cpp" ) - qt5_generate_moc( "MainWindow.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_MainWindow.cpp" ) - qt5_generate_moc( "Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_Viewer.cpp" ) + qt5_generate_moc("Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_Scene.cpp") + qt5_generate_moc("MainWindow.h" + "${CMAKE_CURRENT_BINARY_DIR}/moc_MainWindow.cpp") + qt5_generate_moc("Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_Viewer.cpp") # generate QtAssistant collection file - add_custom_command ( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Periodic_3_triangulation_3.qhc - DEPENDS Periodic_3_triangulation_3.qhp Periodic_3_triangulation_3.qhcp - COMMAND ${CGAL_QCOLLECTIONGENERATOR_TARGET} - ${CMAKE_CURRENT_SOURCE_DIR}/Periodic_3_triangulation_3.qhcp - -o ${CMAKE_CURRENT_BINARY_DIR}/Periodic_3_triangulation_3.qhc - ) + add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Periodic_3_triangulation_3.qhc + DEPENDS Periodic_3_triangulation_3.qhp Periodic_3_triangulation_3.qhcp + COMMAND + ${CGAL_QCOLLECTIONGENERATOR_TARGET} + ${CMAKE_CURRENT_SOURCE_DIR}/Periodic_3_triangulation_3.qhcp -o + ${CMAKE_CURRENT_BINARY_DIR}/Periodic_3_triangulation_3.qhc) # The executable itself - add_executable ( periodic_3_triangulation_3_demo - Scene.cpp moc_Scene.cpp - Viewer.cpp moc_Viewer.cpp - periodic_3_triangulation_3_demo.cpp - MainWindow.ui moc_MainWindow.cpp - ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} Periodic_3_triangulation_3.qhc) + add_executable( + periodic_3_triangulation_3_demo + Scene.cpp + moc_Scene.cpp + Viewer.cpp + moc_Viewer.cpp + periodic_3_triangulation_3_demo.cpp + MainWindow.ui + moc_MainWindow.cpp + ${UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES} + Periodic_3_triangulation_3.qhc) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS periodic_3_triangulation_3_demo) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS periodic_3_triangulation_3_demo) - target_link_libraries(periodic_3_triangulation_3_demo PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::OpenGL) + target_link_libraries(periodic_3_triangulation_3_demo + PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::OpenGL) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(periodic_3_triangulation_3_demo) -else () +else() set(PERIODIC_TRIANGULATION_MISSING_DEPS "") if(NOT CGAL_Qt5_FOUND) - set(PERIODIC_TRIANGULATION_MISSING_DEPS "the CGAL Qt5 library, ${PERIODIC_TRIANGULATION_MISSING_DEPS}") + set(PERIODIC_TRIANGULATION_MISSING_DEPS + "the CGAL Qt5 library, ${PERIODIC_TRIANGULATION_MISSING_DEPS}") endif() if(NOT Qt5_FOUND) - set(PERIODIC_TRIANGULATION_MISSING_DEPS "Qt5, ${PERIODIC_TRIANGULATION_MISSING_DEPS}") + set(PERIODIC_TRIANGULATION_MISSING_DEPS + "Qt5, ${PERIODIC_TRIANGULATION_MISSING_DEPS}") endif() - if (NOT TARGET ${CGAL_QCOLLECTIONGENERATOR_TARGET}) - set(PERIODIC_TRIANGULATION_MISSING_DEPS "${CGAL_QCOLLECTIONGENERATOR_TARGET}, ${PERIODIC_TRIANGULATION_MISSING_DEPS}") + if(NOT TARGET ${CGAL_QCOLLECTIONGENERATOR_TARGET}) + set(PERIODIC_TRIANGULATION_MISSING_DEPS + "${CGAL_QCOLLECTIONGENERATOR_TARGET}, ${PERIODIC_TRIANGULATION_MISSING_DEPS}" + ) endif() - message(STATUS "NOTICE: This demo requires ${PERIODIC_TRIANGULATION_MISSING_DEPS}and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires ${PERIODIC_TRIANGULATION_MISSING_DEPS}and will not be compiled." + ) -endif () +endif() diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt index 82f1bf13ae7..ee10c5ac9ca 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Periodic_Lloyd_3_Demo) +project(Periodic_Lloyd_3_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -17,56 +17,70 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS Xml Script Help OpenGL Svg) -if( Qt5Help_VERSION VERSION_LESS 5.12 ) +if(Qt5Help_VERSION VERSION_LESS 5.12) set(CGAL_QCOLLECTIONGENERATOR_TARGET Qt5::qcollectiongenerator) else() set(CGAL_QCOLLECTIONGENERATOR_TARGET Qt5::qhelpgenerator) endif() -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND TARGET ${CGAL_QCOLLECTIONGENERATOR_TARGET} ) +if(CGAL_Qt5_FOUND + AND Qt5_FOUND + AND TARGET ${CGAL_QCOLLECTIONGENERATOR_TARGET}) - include_directories (BEFORE ./ ) + include_directories(BEFORE ./) # ui file, created wih Qt Designer - qt5_wrap_ui( uis MainWindow.ui ) + qt5_wrap_ui(uis MainWindow.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Periodic_Lloyd_3.qrc ) - + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Periodic_Lloyd_3.qrc) if(DEFINED QT_QCOLLECTIONGENERATOR_EXECUTABLE) + else() set(QT_QCOLLECTIONGENERATOR_EXECUTABLE qcollectiongenerator) endif() # generate QtAssistant collection file - add_custom_command ( OUTPUT Periodic_Lloyd_3.qhc - DEPENDS Periodic_Lloyd_3.qhp Periodic_Lloyd_3.qhcp - COMMAND ${CGAL_QCOLLECTIONGENERATOR_TARGET} - ${CMAKE_CURRENT_SOURCE_DIR}/Periodic_Lloyd_3.qhcp - -o ${CMAKE_CURRENT_BINARY_DIR}/Periodic_Lloyd_3.qhc - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - ) + add_custom_command( + OUTPUT Periodic_Lloyd_3.qhc + DEPENDS Periodic_Lloyd_3.qhp Periodic_Lloyd_3.qhcp + COMMAND + ${CGAL_QCOLLECTIONGENERATOR_TARGET} + ${CMAKE_CURRENT_SOURCE_DIR}/Periodic_Lloyd_3.qhcp -o + ${CMAKE_CURRENT_BINARY_DIR}/Periodic_Lloyd_3.qhc + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - add_executable ( Periodic_Lloyd_3 Periodic_Lloyd_3.qhc Periodic_Lloyd_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_executable( + Periodic_Lloyd_3 + Periodic_Lloyd_3.qhc + Periodic_Lloyd_3.cpp + MainWindow.cpp + Viewer.cpp + ${uis} + ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Periodic_Lloyd_3 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Periodic_Lloyd_3) - target_link_libraries( Periodic_Lloyd_3 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::OpenGL) + target_link_libraries(Periodic_Lloyd_3 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::OpenGL) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Periodic_Lloyd_3) -else( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QT_QCOLLECTIONGENERATOR_EXECUTABLE ) +else(CGAL_Qt5_FOUND + AND Qt5_FOUND + AND QT_QCOLLECTIONGENERATOR_EXECUTABLE) set(PERIODIC_LLOYD_MISSING_DEPS "") if(NOT CGAL_Qt5_FOUND) - set(PERIODIC_LLOYD_MISSING_DEPS "the CGAL Qt5 library, ${PERIODIC_LLOYD_MISSING_DEPS}") + set(PERIODIC_LLOYD_MISSING_DEPS + "the CGAL Qt5 library, ${PERIODIC_LLOYD_MISSING_DEPS}") endif() if(NOT Qt5_FOUND) @@ -74,10 +88,13 @@ else( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND QT_QCOLLECTIONGENERATOR_EX endif() if(NOT QT_QCOLLECTIONGENERATOR_EXECUTABLE) - set(PERIODIC_LLOYD_MISSING_DEPS "${CGAL_QCOLLECTIONGENERATOR_TARGET}, ${PERIODIC_LLOYD_MISSING_DEPS}") + set(PERIODIC_LLOYD_MISSING_DEPS + "${CGAL_QCOLLECTIONGENERATOR_TARGET}, ${PERIODIC_LLOYD_MISSING_DEPS}") endif() - - message(STATUS "NOTICE: This demo requires ${PERIODIC_LLOYD_MISSING_DEPS}and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires ${PERIODIC_LLOYD_MISSING_DEPS}and will not be compiled." + ) endif() diff --git a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt index 0e4accef4f5..3ac254a8a5b 100644 --- a/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/examples/Periodic_3_triangulation_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_3_triangulation_3_Examples ) +project(Periodic_3_triangulation_3_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt index c25cc9c2c48..b9b13399738 100644 --- a/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/test/Periodic_3_triangulation_3/CMakeLists.txt @@ -1,37 +1,31 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_3_triangulation_3_Tests ) +project(Periodic_3_triangulation_3_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - include_directories (BEFORE "include") - - create_single_source_cgal_program( "test_p3rt3_as_p3t3.cpp" ) - create_single_source_cgal_program( "test_p3rt3_insert_remove_point_set.cpp" ) - create_single_source_cgal_program( "test_p3rt3_versus_rt3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_alpha_shape_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_delaunay_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_delaunay_hierarchy_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_offset_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_regular_triangulation_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_regular_triangulation_traits_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_triangulation_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_triangulation_tds.cpp" ) - create_single_source_cgal_program( "test_periodic_3_triangulation_traits_C_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_triangulation_traits_H_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_triangulation_traits_SC_3.cpp" ) - create_single_source_cgal_program( "test_periodic_3_triangulation_traits_SH_3.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +include_directories(BEFORE "include") +create_single_source_cgal_program("test_p3rt3_as_p3t3.cpp") +create_single_source_cgal_program("test_p3rt3_insert_remove_point_set.cpp") +create_single_source_cgal_program("test_p3rt3_versus_rt3.cpp") +create_single_source_cgal_program("test_periodic_3_alpha_shape_3.cpp") +create_single_source_cgal_program("test_periodic_3_delaunay_3.cpp") +create_single_source_cgal_program("test_periodic_3_delaunay_hierarchy_3.cpp") +create_single_source_cgal_program("test_periodic_3_offset_3.cpp") +create_single_source_cgal_program("test_periodic_3_regular_triangulation_3.cpp") +create_single_source_cgal_program( + "test_periodic_3_regular_triangulation_traits_3.cpp") +create_single_source_cgal_program("test_periodic_3_triangulation_3.cpp") +create_single_source_cgal_program("test_periodic_3_triangulation_tds.cpp") +create_single_source_cgal_program( + "test_periodic_3_triangulation_traits_C_3.cpp") +create_single_source_cgal_program( + "test_periodic_3_triangulation_traits_H_3.cpp") +create_single_source_cgal_program( + "test_periodic_3_triangulation_traits_SC_3.cpp") +create_single_source_cgal_program( + "test_periodic_3_triangulation_traits_SH_3.cpp") diff --git a/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index 63f6f796399..3bf54daf6b5 100644 --- a/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/benchmark/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,26 +1,15 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_4_hyperbolic_triangulation_2_Benchmarks ) +project(Periodic_4_hyperbolic_triangulation_2_Benchmarks) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) +include(${CGAL_USE_FILE}) -if ( CGAL_FOUND ) - - include( ${CGAL_USE_FILE} ) - - include( CGAL_CreateSingleSourceCGALProgram ) - - create_single_source_cgal_program( "bench_p4ht2_hyperbolic_vs_euclidean.cpp" ) - create_single_source_cgal_program( "bench_p4ht2_insertion.cpp" ) - create_single_source_cgal_program( "bench_p4ht2_remove_dummy_points.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(CGAL_CreateSingleSourceCGALProgram) +create_single_source_cgal_program("bench_p4ht2_hyperbolic_vs_euclidean.cpp") +create_single_source_cgal_program("bench_p4ht2_insertion.cpp") +create_single_source_cgal_program("bench_p4ht2_remove_dummy_points.cpp") diff --git a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index 2e709496225..987329fc301 100644 --- a/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/demo/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,45 +1,42 @@ - cmake_minimum_required(VERSION 3.1...3.15) -project (Periodic_4_hyperbolic_triangulation_2_Demo) +project(Periodic_4_hyperbolic_triangulation_2_Demo) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) -include_directories( ${CMAKE_BINARY_DIR} ) +include_directories(${CMAKE_BINARY_DIR}) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) -find_package(CGAL QUIET COMPONENTS Core Qt5) +find_package(CGAL REQUIRED COMPONENTS Core Qt5) include(${CGAL_USE_FILE}) find_package(LEDA QUIET) find_package(Qt5 QUIET COMPONENTS Widgets) -if(CGAL_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND) AND Qt5_FOUND AND CGAL_Qt5_FOUND) +if((CGAL_Core_FOUND OR LEDA_FOUND) + AND Qt5_FOUND + AND CGAL_Qt5_FOUND) - include_directories (BEFORE include ) + include_directories(BEFORE include) # ui files, created with Qt Designer - qt5_wrap_ui( UIS P4HDT2.ui ) + qt5_wrap_ui(UIS P4HDT2.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( RESOURCE_FILES Main_resources.qrc ) + qt5_add_resources(RESOURCE_FILES Main_resources.qrc) # cpp files - add_executable ( P4HDT2 - P4HDT2.cpp ${RESOURCE_FILES} ${UIS}) + add_executable(P4HDT2 P4HDT2.cpp ${RESOURCE_FILES} ${UIS}) - target_link_libraries( P4HDT2 PRIVATE - CGAL::CGAL - CGAL::CGAL_Qt5 - Qt5::Widgets ) + target_link_libraries(P4HDT2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets) if(TARGET CGAL::CGAL_Core) - target_link_libraries( P4HDT2 PRIVATE CGAL::CGAL_Core ) + target_link_libraries(P4HDT2 PRIVATE CGAL::CGAL_Core) endif() if(LEDA_FOUND) - target_link_libraries( P4HDT2 PRIVATE ${LEDA_LIBRARIES} ) + target_link_libraries(P4HDT2 PRIVATE ${LEDA_LIBRARIES}) endif() - add_to_cached_list( CGAL_EXECUTABLE_TARGETS P4HDT2 ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS P4HDT2) else() message(STATUS "NOTICE: This demo requires Qt5 and will not be compiled.") endif() diff --git a/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index f75164ae1d0..cbfb479c4c1 100644 --- a/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/examples/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,20 +1,19 @@ - cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_4_hyperbolic_triangulation_2_Examples ) +project(Periodic_4_hyperbolic_triangulation_2_Examples) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) -include( ${CGAL_USE_FILE} ) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +include(${CGAL_USE_FILE}) find_package(LEDA QUIET) -if ( CGAL_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND) ) +if((CGAL_Core_FOUND OR LEDA_FOUND)) - include( CGAL_CreateSingleSourceCGALProgram ) + include(CGAL_CreateSingleSourceCGALProgram) - create_single_source_cgal_program( "p4ht2_example_insertion.cpp" ) + create_single_source_cgal_program("p4ht2_example_insertion.cpp") else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") + message( + STATUS "This program requires the CGAL library, and will not be compiled.") endif() - diff --git a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt index 69506bde6cd..70ed3f055e0 100644 --- a/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt +++ b/Periodic_4_hyperbolic_triangulation_2/test/Periodic_4_hyperbolic_triangulation_2/CMakeLists.txt @@ -1,27 +1,28 @@ - cmake_minimum_required(VERSION 3.1...3.15) -project( Periodic_4_hyperbolic_triangulation_2_Tests ) +project(Periodic_4_hyperbolic_triangulation_2_Tests) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) -include( ${CGAL_USE_FILE} ) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +include(${CGAL_USE_FILE}) find_package(LEDA QUIET) -if ( CGAL_FOUND AND (CGAL_Core_FOUND OR LEDA_FOUND) ) +if((CGAL_Core_FOUND OR LEDA_FOUND)) - include( CGAL_CreateSingleSourceCGALProgram ) + include(CGAL_CreateSingleSourceCGALProgram) - create_single_source_cgal_program( "test_p4ht2_construct_point_2.cpp" ) - create_single_source_cgal_program( "test_p4ht2_exact_complex_numbers.cpp" ) - create_single_source_cgal_program( "test_p4ht2_intersections.cpp" ) - create_single_source_cgal_program( "test_p4ht2_locate.cpp" ) - create_single_source_cgal_program( "test_p4ht2_matrix.cpp" ) - create_single_source_cgal_program( "test_p4ht2_removal_iterator.cpp" ) - create_single_source_cgal_program( "test_p4ht2_removal.cpp" ) - create_single_source_cgal_program( "test_p4ht2_insert_degenerate.cpp" ) + create_single_source_cgal_program("test_p4ht2_construct_point_2.cpp") + create_single_source_cgal_program("test_p4ht2_exact_complex_numbers.cpp") + create_single_source_cgal_program("test_p4ht2_intersections.cpp") + create_single_source_cgal_program("test_p4ht2_locate.cpp") + create_single_source_cgal_program("test_p4ht2_matrix.cpp") + create_single_source_cgal_program("test_p4ht2_removal_iterator.cpp") + create_single_source_cgal_program("test_p4ht2_removal.cpp") + create_single_source_cgal_program("test_p4ht2_insert_degenerate.cpp") else() - message(STATUS "This program requires the CGAL library and the GMP library, and will not be compiled.") + message( + STATUS + "This program requires the CGAL library and the GMP library, and will not be compiled." + ) endif() - diff --git a/Point_set_2/examples/Point_set_2/CMakeLists.txt b/Point_set_2/examples/Point_set_2/CMakeLists.txt index b0c2d243e24..f7b51d16de5 100644 --- a/Point_set_2/examples/Point_set_2/CMakeLists.txt +++ b/Point_set_2/examples/Point_set_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Point_set_2_Examples ) +project(Point_set_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Point_set_2/test/Point_set_2/CMakeLists.txt b/Point_set_2/test/Point_set_2/CMakeLists.txt index 80e0dbb9577..9c5a5f50f5c 100644 --- a/Point_set_2/test/Point_set_2/CMakeLists.txt +++ b/Point_set_2/test/Point_set_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Point_set_2_Tests ) +project(Point_set_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Point_set_3/examples/Point_set_3/CMakeLists.txt b/Point_set_3/examples/Point_set_3/CMakeLists.txt index cc8a77fb8b6..e09a0d2188f 100644 --- a/Point_set_3/examples/Point_set_3/CMakeLists.txt +++ b/Point_set_3/examples/Point_set_3/CMakeLists.txt @@ -2,55 +2,47 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Point_set_3_Examples ) - - +project(Point_set_3_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS Qt5 ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) - add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() - # Creating entries for all C++ files with "main" routine # ########################################################## -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" ) +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" CXX_FEATURES + ${needed_cxx_features}) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) include(CGAL_Eigen_support) -if (EIGEN3_FOUND) - create_single_source_cgal_program( "point_set_algo.cpp" ) +if(EIGEN3_FOUND) + create_single_source_cgal_program("point_set_algo.cpp") target_link_libraries(point_set_algo PUBLIC CGAL::Eigen_support) endif() -create_single_source_cgal_program("draw_point_set_3.cpp" ) +create_single_source_cgal_program("draw_point_set_3.cpp") if(CGAL_Qt5_FOUND) target_link_libraries(draw_point_set_3 PUBLIC CGAL::CGAL_Qt5) endif() diff --git a/Point_set_3/test/Point_set_3/CMakeLists.txt b/Point_set_3/test/Point_set_3/CMakeLists.txt index c787e220761..3fb6595dcea 100644 --- a/Point_set_3/test/Point_set_3/CMakeLists.txt +++ b/Point_set_3/test/Point_set_3/CMakeLists.txt @@ -2,26 +2,18 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Point_set_3_Tests ) - - +project(Point_set_3_Tests) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -34,7 +26,5 @@ endif() # Creating entries for all C++ files with "main" routine # ########################################################## -create_single_source_cgal_program( "point_set_test.cpp" ) -create_single_source_cgal_program( "point_set_test_join.cpp" ) - - +create_single_source_cgal_program("point_set_test.cpp") +create_single_source_cgal_program("point_set_test_join.cpp") diff --git a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt index 83253368016..e876334f779 100644 --- a/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/examples/Point_set_processing_3/CMakeLists.txt @@ -1,131 +1,151 @@ # This is the CMake script for compiling this folder. cmake_minimum_required(VERSION 3.1...3.15) -project( Point_set_processing_3_Examples ) +project(Point_set_processing_3_Examples) # Find CGAL -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) +find_package(Boost QUIET) - find_package(Boost QUIET) +# VisualC++ optimization for applications dealing with large data +if(MSVC) + # Quit warning in the lasreader + add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) - # VisualC++ optimization for applications dealing with large data - if (MSVC) - # Quit warning in the lasreader - add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS) - - if ( CMAKE_SIZEOF_VOID_P EQUAL 4 ) - # Allow Windows 32bit applications to use up to 3GB of RAM - SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") - endif() - # Prints new compilation options - message( STATUS "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'" ) - message( STATUS "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" ) - message( STATUS "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" ) - message( STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" ) + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + # Allow Windows 32bit applications to use up to 3GB of RAM + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") endif() + # Prints new compilation options + message( + STATUS + "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") + message( + STATUS + "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" + ) + message( + STATUS + "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" + ) + message( + STATUS + "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" + ) +endif() - # Activate concurrency? - option(CGAL_ACTIVATE_CONCURRENT_PSP3 - "Enable concurrency" - OFF) +# Activate concurrency? +option(CGAL_ACTIVATE_CONCURRENT_PSP3 "Enable concurrency" OFF) - set(CGAL_libs CGAL::CGAL) - if( CGAL_ACTIVATE_CONCURRENT_PSP3 OR ENV{CGAL_ACTIVATE_CONCURRENT_PSP3} ) - find_package( TBB REQUIRED ) - include(CGAL_TBB_support) - if (TARGET CGAL::TBB_support) - set(CGAL_TBB_target ${CGAL_libs} CGAL::TBB_support) - endif() +set(CGAL_libs CGAL::CGAL) +if(CGAL_ACTIVATE_CONCURRENT_PSP3 OR ENV{CGAL_ACTIVATE_CONCURRENT_PSP3}) + find_package(TBB REQUIRED) + include(CGAL_TBB_support) + if(TARGET CGAL::TBB_support) + set(CGAL_TBB_target ${CGAL_libs} CGAL::TBB_support) endif() +endif() - # Executables that do *not* require EIGEN - foreach(target - average_spacing_example - bilateral_smooth_point_set_example - grid_simplification_example - grid_simplify_indices - property_map - random_simplification_example - read_write_xyz_point_set_example - remove_outliers_example - wlop_simplify_and_regularize_point_set_example - edge_aware_upsample_point_set_example - structuring_example - read_ply_points_with_colors_example - write_ply_points_example) +# Executables that do *not* require EIGEN +foreach( + target + average_spacing_example + bilateral_smooth_point_set_example + grid_simplification_example + grid_simplify_indices + property_map + random_simplification_example + read_write_xyz_point_set_example + remove_outliers_example + wlop_simplify_and_regularize_point_set_example + edge_aware_upsample_point_set_example + structuring_example + read_ply_points_with_colors_example + write_ply_points_example) + add_executable(${target} "${target}.cpp") + target_link_libraries(${target} ${CGAL_libs}) +endforeach() + +find_package(LASLIB) +include(CGAL_LASLIB_support) +if(TARGET CGAL::LASLIB_support) + add_executable(read_las_example "read_las_example.cpp") + target_link_libraries(read_las_example ${CGAL_libs} CGAL::LASLIB_support) +else() + message( + STATUS + "NOTICE : the LAS reader test requires LASlib and will not be compiled.") +endif() + +# Use Eigen +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + set(CGAL_libs ${CGAL_libs} CGAL::Eigen_support) + + # Executables that require Eigen + foreach( + target + jet_smoothing_example + normal_estimation + clustering_example + edges_example + callback_example + scale_estimation_example + scale_estimation_2d_example + hierarchy_simplification_example + normals_example) add_executable(${target} "${target}.cpp") target_link_libraries(${target} ${CGAL_libs}) endforeach() - find_package(LASLIB) - include(CGAL_LASLIB_support) - if (TARGET CGAL::LASLIB_support) - add_executable( read_las_example "read_las_example.cpp" ) - target_link_libraries(read_las_example ${CGAL_libs} CGAL::LASLIB_support) + # Executables that require libpointmatcher + find_package(libpointmatcher QUIET) + include(CGAL_pointmatcher_support) + if(TARGET CGAL::pointmatcher_support) + add_executable(registration_with_pointmatcher + "registration_with_pointmatcher.cpp") + target_link_libraries(registration_with_pointmatcher ${CGAL_libs} + CGAL::pointmatcher_support) else() - message(STATUS "NOTICE : the LAS reader test requires LASlib and will not be compiled.") + message( + STATUS + "NOTICE : the registration_with_pointmatcher test requires libpointmatcher and will not be compiled." + ) endif() - # Use Eigen - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - set(CGAL_libs ${CGAL_libs} CGAL::Eigen_support) - - # Executables that require Eigen - foreach(target - jet_smoothing_example - normal_estimation - clustering_example - edges_example - callback_example - scale_estimation_example - scale_estimation_2d_example - hierarchy_simplification_example - normals_example) - add_executable(${target} "${target}.cpp") - target_link_libraries(${target} ${CGAL_libs}) - endforeach() - - # Executables that require libpointmatcher - find_package(libpointmatcher QUIET) - include(CGAL_pointmatcher_support) - if (TARGET CGAL::pointmatcher_support) - add_executable(registration_with_pointmatcher "registration_with_pointmatcher.cpp") - target_link_libraries(registration_with_pointmatcher - ${CGAL_libs} CGAL::pointmatcher_support) - else() - message(STATUS "NOTICE : the registration_with_pointmatcher test requires libpointmatcher and will not be compiled.") - endif() - - # Executables that require OpenGR - find_package(OpenGR QUIET) - include(CGAL_OpenGR_support) - if (TARGET CGAL::OpenGR_support) - add_executable(registration_with_OpenGR "registration_with_OpenGR.cpp" ) - target_link_libraries(registration_with_OpenGR - ${CGAL_libs} CGAL::OpenGR_support) - else() - message(STATUS "NOTICE : registration_with_OpenGR requires OpenGR, and will not be compiled.") - endif() - - # Executables that require both libpointmatcher and OpenGR - if (TARGET CGAL::pointmatcher_support AND - TARGET CGAL::OpenGR_support) - add_executable(registration_with_opengr_pointmatcher_pipeline - "registration_with_opengr_pointmatcher_pipeline.cpp" ) - target_link_libraries(registration_with_opengr_pointmatcher_pipeline - ${CGAL_libs} CGAL::pointmatcher_support CGAL::OpenGR_support) - else() - message(STATUS "NOTICE : registration_with_opengr_pointmatcher_pipeline requires libpointmatcher and OpenGR, and will not be compiled.") - endif() - + # Executables that require OpenGR + find_package(OpenGR QUIET) + include(CGAL_OpenGR_support) + if(TARGET CGAL::OpenGR_support) + add_executable(registration_with_OpenGR "registration_with_OpenGR.cpp") + target_link_libraries(registration_with_OpenGR ${CGAL_libs} + CGAL::OpenGR_support) else() - message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.") + message( + STATUS + "NOTICE : registration_with_OpenGR requires OpenGR, and will not be compiled." + ) + endif() + + # Executables that require both libpointmatcher and OpenGR + if(TARGET CGAL::pointmatcher_support AND TARGET CGAL::OpenGR_support) + add_executable(registration_with_opengr_pointmatcher_pipeline + "registration_with_opengr_pointmatcher_pipeline.cpp") + target_link_libraries( + registration_with_opengr_pointmatcher_pipeline ${CGAL_libs} + CGAL::pointmatcher_support CGAL::OpenGR_support) + else() + message( + STATUS + "NOTICE : registration_with_opengr_pointmatcher_pipeline requires libpointmatcher and OpenGR, and will not be compiled." + ) endif() else() - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") + message( + STATUS + "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt index 33f229e2fe9..18b64066b9e 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt +++ b/Point_set_processing_3/test/Point_set_processing_3/CMakeLists.txt @@ -1,86 +1,89 @@ # This is the CMake script for compiling this folder. cmake_minimum_required(VERSION 3.1...3.15) -project( Point_set_processing_3_Tests ) - - +project(Point_set_processing_3_Tests) # Find CGAL -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) - - # VisualC++ optimization for applications dealing with large data - if (MSVC) - if ( CMAKE_SIZEOF_VOID_P EQUAL 4 ) - # Allow Windows 32bit applications to use up to 3GB of RAM - SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") - endif() - # Prints new compilation options - message( STATUS "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'" ) - message( STATUS "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" ) - message( STATUS "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" ) - message( STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" ) +# VisualC++ optimization for applications dealing with large data +if(MSVC) + if(CMAKE_SIZEOF_VOID_P EQUAL 4) + # Allow Windows 32bit applications to use up to 3GB of RAM + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") endif() - - # Temporary debugging stuff - ADD_DEFINITIONS( "-DDEBUG_TRACE" ) - - find_package( TBB QUIET ) - include(CGAL_TBB_support) - - # Executables that do *not* require Eigen - create_single_source_cgal_program( "read_test.cpp" ) - create_single_source_cgal_program( "read_test_with_different_pmaps.cpp" ) - create_single_source_cgal_program( "analysis_test.cpp" ) - create_single_source_cgal_program( "remove_outliers_test.cpp" ) - create_single_source_cgal_program( "wlop_simplify_and_regularize_test.cpp" ) - create_single_source_cgal_program( "bilateral_smoothing_test.cpp" ) - create_single_source_cgal_program( "edge_aware_upsample_test.cpp" ) - create_single_source_cgal_program( "structuring_test.cpp" ) - - # Use Eigen - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if (EIGEN3_FOUND) - # Executables that require Eigen - create_single_source_cgal_program( "normal_estimation_test.cpp" ) - target_link_libraries(normal_estimation_test PUBLIC CGAL::Eigen_support) - - create_single_source_cgal_program( "hierarchy_simplification_test.cpp" ) - target_link_libraries(hierarchy_simplification_test PUBLIC CGAL::Eigen_support) - - create_single_source_cgal_program( "smoothing_test.cpp" ) - target_link_libraries(smoothing_test PUBLIC CGAL::Eigen_support) - - create_single_source_cgal_program( "vcm_plane_test.cpp" ) - target_link_libraries(vcm_plane_test PUBLIC CGAL::Eigen_support) - - create_single_source_cgal_program( "vcm_all_test.cpp" ) - target_link_libraries(vcm_all_test PUBLIC CGAL::Eigen_support) - - create_single_source_cgal_program( "jet_pointer_as_property_map.cpp" ) - target_link_libraries(jet_pointer_as_property_map PUBLIC CGAL::Eigen_support) - else() - message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") - endif() - - if (TARGET CGAL::TBB_support) - foreach(target - analysis_test - smoothing_test - bilateral_smoothing_test - wlop_simplify_and_regularize_test - edge_aware_upsample_test - normal_estimation_test) - if(TARGET ${target}) - target_link_libraries(${target} PUBLIC CGAL::TBB_support) - endif() - endforeach() - endif() - -else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - + # Prints new compilation options + message( + STATUS + "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") + message( + STATUS + "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" + ) + message( + STATUS + "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" + ) + message( + STATUS + "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" + ) +endif() + +# Temporary debugging stuff +add_definitions("-DDEBUG_TRACE") + +find_package(TBB QUIET) +include(CGAL_TBB_support) + +# Executables that do *not* require Eigen +create_single_source_cgal_program("read_test.cpp") +create_single_source_cgal_program("read_test_with_different_pmaps.cpp") +create_single_source_cgal_program("analysis_test.cpp") +create_single_source_cgal_program("remove_outliers_test.cpp") +create_single_source_cgal_program("wlop_simplify_and_regularize_test.cpp") +create_single_source_cgal_program("bilateral_smoothing_test.cpp") +create_single_source_cgal_program("edge_aware_upsample_test.cpp") +create_single_source_cgal_program("structuring_test.cpp") + +# Use Eigen +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(EIGEN3_FOUND) + # Executables that require Eigen + create_single_source_cgal_program("normal_estimation_test.cpp") + target_link_libraries(normal_estimation_test PUBLIC CGAL::Eigen_support) + + create_single_source_cgal_program("hierarchy_simplification_test.cpp") + target_link_libraries(hierarchy_simplification_test + PUBLIC CGAL::Eigen_support) + + create_single_source_cgal_program("smoothing_test.cpp") + target_link_libraries(smoothing_test PUBLIC CGAL::Eigen_support) + + create_single_source_cgal_program("vcm_plane_test.cpp") + target_link_libraries(vcm_plane_test PUBLIC CGAL::Eigen_support) + + create_single_source_cgal_program("vcm_all_test.cpp") + target_link_libraries(vcm_all_test PUBLIC CGAL::Eigen_support) + + create_single_source_cgal_program("jet_pointer_as_property_map.cpp") + target_link_libraries(jet_pointer_as_property_map PUBLIC CGAL::Eigen_support) +else() + message( + STATUS + "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." + ) +endif() + +if(TARGET CGAL::TBB_support) + foreach( + target + analysis_test smoothing_test bilateral_smoothing_test + wlop_simplify_and_regularize_test edge_aware_upsample_test + normal_estimation_test) + if(TARGET ${target}) + target_link_libraries(${target} PUBLIC CGAL::TBB_support) + endif() + endforeach() endif() diff --git a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt index b67981f06b6..a2170d5334a 100644 --- a/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt +++ b/Poisson_surface_reconstruction_3/examples/Poisson_surface_reconstruction_3/CMakeLists.txt @@ -1,46 +1,51 @@ # This is the CMake script for compiling this folder. cmake_minimum_required(VERSION 3.1...3.15) -project( Poisson_surface_reconstruction_3_Examples ) - +project(Poisson_surface_reconstruction_3_Examples) # Find CGAL -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) - - # VisualC++ optimization for applications dealing with large data - if (MSVC) - # Allow Windows 32bit applications to use up to 3GB of RAM - SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") - - # Print new compilation options - message( STATUS "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'" ) - message( STATUS "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" ) - message( STATUS "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" ) - message( STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" ) - endif() - - # Find Eigen3 (requires 3.1.0 or greater) - find_package(Eigen3 3.1.0) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - # Executables that require Eigen 3 - create_single_source_cgal_program( "poisson_reconstruction_example.cpp" ) - target_link_libraries(poisson_reconstruction_example PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "poisson_reconstruction.cpp" ) - target_link_libraries(poisson_reconstruction PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "poisson_reconstruction_function.cpp" ) - target_link_libraries(poisson_reconstruction_function PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "tutorial_example.cpp" ) - target_link_libraries(tutorial_example PUBLIC CGAL::Eigen_support) - else() - message(STATUS "NOTICE: The examples need Eigen 3.1 (or greater) will not be compiled.") - endif() - - -else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") +# VisualC++ optimization for applications dealing with large data +if(MSVC) + # Allow Windows 32bit applications to use up to 3GB of RAM + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") + # Print new compilation options + message( + STATUS + "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") + message( + STATUS + "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" + ) + message( + STATUS + "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" + ) + message( + STATUS + "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" + ) +endif() + +# Find Eigen3 (requires 3.1.0 or greater) +find_package(Eigen3 3.1.0) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + # Executables that require Eigen 3 + create_single_source_cgal_program("poisson_reconstruction_example.cpp") + target_link_libraries(poisson_reconstruction_example + PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("poisson_reconstruction.cpp") + target_link_libraries(poisson_reconstruction PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("poisson_reconstruction_function.cpp") + target_link_libraries(poisson_reconstruction_function + PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("tutorial_example.cpp") + target_link_libraries(tutorial_example PUBLIC CGAL::Eigen_support) +else() + message( + STATUS + "NOTICE: The examples need Eigen 3.1 (or greater) will not be compiled.") endif() diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt index b8cb454be73..da38f9fbdb1 100644 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt @@ -1,42 +1,47 @@ # This is the CMake script for compiling this folder. cmake_minimum_required(VERSION 3.1...3.15) -project( Poisson_surface_reconstruction_3_Tests ) - +project(Poisson_surface_reconstruction_3_Tests) # Find CGAL -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) +# VisualC++ optimization for applications dealing with large data +if(MSVC) + # Allow Windows 32bit applications to use up to 3GB of RAM + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") - # VisualC++ optimization for applications dealing with large data - if (MSVC) - # Allow Windows 32bit applications to use up to 3GB of RAM - SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") + # Prints new compilation options + message( + STATUS + "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'") + message( + STATUS + "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" + ) + message( + STATUS + "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" + ) + message( + STATUS + "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" + ) +endif() - # Prints new compilation options - message( STATUS "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'" ) - message( STATUS "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" ) - message( STATUS "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" ) - message( STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" ) - endif() - - # Temporary debugging stuff - - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if(TARGET CGAL::Eigen_support) - # Executables that require Eigen 3.1 - create_single_source_cgal_program( "poisson_reconstruction_test.cpp" ) - target_link_libraries(poisson_reconstruction_test PUBLIC CGAL::Eigen_support) - else() - - message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.") - - endif() +# Temporary debugging stuff +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + # Executables that require Eigen 3.1 + create_single_source_cgal_program("poisson_reconstruction_test.cpp") + target_link_libraries(poisson_reconstruction_test PUBLIC CGAL::Eigen_support) else() - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") + message( + STATUS + "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/Polygon/examples/Polygon/CMakeLists.txt b/Polygon/examples/Polygon/CMakeLists.txt index 2a7edf1e39e..f0449feac92 100644 --- a/Polygon/examples/Polygon/CMakeLists.txt +++ b/Polygon/examples/Polygon/CMakeLists.txt @@ -1,33 +1,25 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polygon_Examples ) +project(Polygon_Examples) - -find_package(CGAL QUIET COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) - add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - if(CGAL_Qt5_FOUND) - target_link_libraries(draw_polygon PUBLIC CGAL::CGAL_Qt5) - target_link_libraries(draw_polygon_with_holes PUBLIC CGAL::CGAL_Qt5) - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +if(CGAL_Qt5_FOUND) + target_link_libraries(draw_polygon PUBLIC CGAL::CGAL_Qt5) + target_link_libraries(draw_polygon_with_holes PUBLIC CGAL::CGAL_Qt5) endif() - diff --git a/Polygon/test/Polygon/CMakeLists.txt b/Polygon/test/Polygon/CMakeLists.txt index b5730fbb90f..9fe20e20dee 100644 --- a/Polygon/test/Polygon/CMakeLists.txt +++ b/Polygon/test/Polygon/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polygon_Tests ) +project(Polygon_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt index 008b892cd43..f202163929b 100644 --- a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt @@ -2,24 +2,18 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Polygon_mesh_processing ) +project(Polygon_mesh_processing) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -34,11 +28,11 @@ include(CGAL_Eigen_support) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "polygon_mesh_slicer.cpp" ) +create_single_source_cgal_program("polygon_mesh_slicer.cpp") -create_single_source_cgal_program( "hole_filling.cpp" ) +create_single_source_cgal_program("hole_filling.cpp") -if (TARGET CGAL::Eigen_support) +if(TARGET CGAL::Eigen_support) target_link_libraries(polygon_mesh_slicer PUBLIC CGAL::Eigen_support) target_link_libraries(hole_filling PUBLIC CGAL::Eigen_support) endif() diff --git a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt index 8f748d69246..468768503af 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -2,34 +2,27 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Polygon_mesh_processing_Examples ) +project(Polygon_mesh_processing_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() +find_package(OpenMesh QUIET) -find_package( OpenMesh QUIET ) - -if ( OpenMesh_FOUND ) -include( UseOpenMesh ) +if(OpenMesh_FOUND) + include(UseOpenMesh) else() message(STATUS "Examples that use OpenMesh will not be compiled.") endif() @@ -40,95 +33,102 @@ endif() find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) include(CGAL_Eigen_support) - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "hausdorff_distance_remeshing_example.cpp") +create_single_source_cgal_program("hausdorff_distance_remeshing_example.cpp") -if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "hole_filling_example.cpp" ) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("hole_filling_example.cpp") target_link_libraries(hole_filling_example PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "hole_filling_example_SM.cpp" ) + create_single_source_cgal_program("hole_filling_example_SM.cpp") target_link_libraries(hole_filling_example_SM PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "refine_fair_example.cpp") + create_single_source_cgal_program("refine_fair_example.cpp") target_link_libraries(refine_fair_example PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "shape_smoothing_example.cpp") + create_single_source_cgal_program("shape_smoothing_example.cpp") target_link_libraries(shape_smoothing_example PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "hole_filling_example_LCC.cpp" ) + create_single_source_cgal_program("hole_filling_example_LCC.cpp") target_link_libraries(hole_filling_example_LCC PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "mesh_smoothing_example.cpp") + create_single_source_cgal_program("mesh_smoothing_example.cpp") target_link_libraries(mesh_smoothing_example PUBLIC CGAL::Eigen_support) endif() -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( "point_inside_example.cpp") -create_single_source_cgal_program( "triangulate_faces_example.cpp") -create_single_source_cgal_program( "connected_components_example.cpp") -create_single_source_cgal_program( "face_filtered_graph_example.cpp") -create_single_source_cgal_program( "orient_polygon_soup_example.cpp") -create_single_source_cgal_program( "triangulate_polyline_example.cpp") -create_single_source_cgal_program( "mesh_slicer_example.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("point_inside_example.cpp") +create_single_source_cgal_program("triangulate_faces_example.cpp") +create_single_source_cgal_program("connected_components_example.cpp") +create_single_source_cgal_program("face_filtered_graph_example.cpp") +create_single_source_cgal_program("orient_polygon_soup_example.cpp") +create_single_source_cgal_program("triangulate_polyline_example.cpp") +create_single_source_cgal_program("mesh_slicer_example.cpp") #create_single_source_cgal_program( "remove_degeneracies_example.cpp") -create_single_source_cgal_program( "isotropic_remeshing_example.cpp") -create_single_source_cgal_program( "isotropic_remeshing_of_patch_example.cpp") -create_single_source_cgal_program( "surface_mesh_intersection.cpp") -create_single_source_cgal_program( "corefinement_SM.cpp") -create_single_source_cgal_program( "corefinement_consecutive_bool_op.cpp" ) -create_single_source_cgal_program( "corefinement_difference_remeshed.cpp" ) -create_single_source_cgal_program( "corefinement_mesh_union.cpp" ) -create_single_source_cgal_program( "corefinement_mesh_union_and_intersection.cpp" ) -create_single_source_cgal_program( "corefinement_mesh_union_with_attributes.cpp" ) -create_single_source_cgal_program( "corefinement_polyhedron_union.cpp" ) -create_single_source_cgal_program( "random_perturbation_SM_example.cpp" ) -create_single_source_cgal_program( "corefinement_LCC.cpp") -create_single_source_cgal_program( "detect_features_example.cpp" ) -create_single_source_cgal_program( "volume_connected_components.cpp" ) -create_single_source_cgal_program( "manifoldness_repair_example.cpp" ) -create_single_source_cgal_program( "repair_polygon_soup_example.cpp" ) -create_single_source_cgal_program( "locate_example.cpp") -create_single_source_cgal_program( "orientation_pipeline_example.cpp") +create_single_source_cgal_program("isotropic_remeshing_example.cpp") +create_single_source_cgal_program("isotropic_remeshing_of_patch_example.cpp") +create_single_source_cgal_program("surface_mesh_intersection.cpp") +create_single_source_cgal_program("corefinement_SM.cpp") +create_single_source_cgal_program("corefinement_consecutive_bool_op.cpp") +create_single_source_cgal_program("corefinement_difference_remeshed.cpp") +create_single_source_cgal_program("corefinement_mesh_union.cpp") +create_single_source_cgal_program( + "corefinement_mesh_union_and_intersection.cpp") +create_single_source_cgal_program("corefinement_mesh_union_with_attributes.cpp") +create_single_source_cgal_program("corefinement_polyhedron_union.cpp") +create_single_source_cgal_program("random_perturbation_SM_example.cpp") +create_single_source_cgal_program("corefinement_LCC.cpp") +create_single_source_cgal_program("detect_features_example.cpp") +create_single_source_cgal_program("volume_connected_components.cpp") +create_single_source_cgal_program("manifoldness_repair_example.cpp") +create_single_source_cgal_program("repair_polygon_soup_example.cpp") +create_single_source_cgal_program("locate_example.cpp") +create_single_source_cgal_program("orientation_pipeline_example.cpp") #create_single_source_cgal_program( "self_snapping_example.cpp") #create_single_source_cgal_program( "snapping_example.cpp") - if(OpenMesh_FOUND) -create_single_source_cgal_program( "compute_normals_example_OM.cpp" ) -target_link_libraries( compute_normals_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) + create_single_source_cgal_program("compute_normals_example_OM.cpp") + target_link_libraries(compute_normals_example_OM + PRIVATE ${OPENMESH_LIBRARIES}) -if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "hole_filling_example_OM.cpp" ) - target_link_libraries( hole_filling_example_OM PRIVATE CGAL::Eigen_support ${OPENMESH_LIBRARIES} ) -endif() + if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("hole_filling_example_OM.cpp") + target_link_libraries(hole_filling_example_OM PRIVATE CGAL::Eigen_support + ${OPENMESH_LIBRARIES}) + endif() -create_single_source_cgal_program( "point_inside_example_OM.cpp") -target_link_libraries( point_inside_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) + create_single_source_cgal_program("point_inside_example_OM.cpp") + target_link_libraries(point_inside_example_OM PRIVATE ${OPENMESH_LIBRARIES}) -create_single_source_cgal_program( "stitch_borders_example_OM.cpp" ) -target_link_libraries( stitch_borders_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) + create_single_source_cgal_program("stitch_borders_example_OM.cpp") + target_link_libraries(stitch_borders_example_OM PRIVATE ${OPENMESH_LIBRARIES}) -#create_single_source_cgal_program( "remove_degeneracies_example.cpp") -#target_link_libraries( remove_degeneracies_example PRIVATE ${OPENMESH_LIBRARIES} ) + #create_single_source_cgal_program( "remove_degeneracies_example.cpp") + #target_link_libraries( remove_degeneracies_example PRIVATE ${OPENMESH_LIBRARIES} ) -create_single_source_cgal_program( "triangulate_faces_example_OM.cpp") -target_link_libraries( triangulate_faces_example_OM PRIVATE ${OPENMESH_LIBRARIES} ) + create_single_source_cgal_program("triangulate_faces_example_OM.cpp") + target_link_libraries(triangulate_faces_example_OM + PRIVATE ${OPENMESH_LIBRARIES}) endif(OpenMesh_FOUND) -find_package( TBB ) +find_package(TBB) include(CGAL_TBB_support) -if( TARGET CGAL::TBB_support ) +if(TARGET CGAL::TBB_support) target_link_libraries(self_intersections_example PUBLIC CGAL::TBB_support) - target_link_libraries(hausdorff_distance_remeshing_example PUBLIC CGAL::TBB_support) + target_link_libraries(hausdorff_distance_remeshing_example + PUBLIC CGAL::TBB_support) else() - message( STATUS "NOTICE: Intel TBB was not found. Sequential code will be used." ) + message( + STATUS "NOTICE: Intel TBB was not found. Sequential code will be used.") endif() find_package(Ceres QUIET) if(TARGET ceres) - target_compile_definitions( mesh_smoothing_example PRIVATE CGAL_PMP_USE_CERES_SOLVER ) - target_link_libraries( mesh_smoothing_example PRIVATE ceres ) + target_compile_definitions(mesh_smoothing_example + PRIVATE CGAL_PMP_USE_CERES_SOLVER) + target_link_libraries(mesh_smoothing_example PRIVATE ceres) endif(TARGET ceres) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index 214d55114f2..f711a5ee598 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -2,26 +2,20 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Polygon_mesh_processing_Tests ) +project(Polygon_mesh_processing_Tests) # CGAL and its components -find_package( CGAL QUIET COMPONENTS Core) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED COMPONENTS Core) include(${CGAL_USE_FILE}) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -33,103 +27,112 @@ endif() find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) include(CGAL_Eigen_support) -find_package( TBB ) +find_package(TBB) include(CGAL_TBB_support) -if (TARGET CGAL::Eigen_support) +if(TARGET CGAL::Eigen_support) # Creating entries for all .cpp/.C files with "main" routine # ########################################################## create_single_source_cgal_program("fairing_test.cpp") target_link_libraries(fairing_test PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program("triangulate_hole_Polyhedron_3_no_delaunay_test.cpp" ) - target_link_libraries(triangulate_hole_Polyhedron_3_no_delaunay_test PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program( + "triangulate_hole_Polyhedron_3_no_delaunay_test.cpp") + target_link_libraries(triangulate_hole_Polyhedron_3_no_delaunay_test + PUBLIC CGAL::Eigen_support) create_single_source_cgal_program("triangulate_hole_Polyhedron_3_test.cpp") - target_link_libraries(triangulate_hole_Polyhedron_3_test PUBLIC CGAL::Eigen_support) + target_link_libraries(triangulate_hole_Polyhedron_3_test + PUBLIC CGAL::Eigen_support) create_single_source_cgal_program("test_shape_smoothing.cpp") target_link_libraries(test_shape_smoothing PUBLIC CGAL::Eigen_support) endif() -find_package( OpenMesh QUIET ) -if ( OpenMesh_FOUND ) - include( UseOpenMesh ) +find_package(OpenMesh QUIET) +if(OpenMesh_FOUND) + include(UseOpenMesh) else() message(STATUS "Examples that use OpenMesh will not be compiled.") endif() - create_single_source_cgal_program("connected_component_polyhedron.cpp") - create_single_source_cgal_program("connected_component_surface_mesh.cpp") - create_single_source_cgal_program("test_detect_features.cpp") - create_single_source_cgal_program("pmp_compute_normals_test.cpp") - create_single_source_cgal_program("orient_polygon_mesh_test.cpp" ) - create_single_source_cgal_program("orient_polygon_soup_test.cpp") - create_single_source_cgal_program("point_inside_polyhedron_boundary_test.cpp") - create_single_source_cgal_program("point_inside_surface_mesh_test.cpp" ) - create_single_source_cgal_program("polygon_mesh_slicer_test.cpp" ) - create_single_source_cgal_program("self_intersection_polyhedron_test.cpp" ) - create_single_source_cgal_program("self_intersection_surface_mesh_test.cpp" ) - create_single_source_cgal_program("pmp_do_intersect_test.cpp" ) - create_single_source_cgal_program("test_is_polygon_soup_a_polygon_mesh.cpp") - create_single_source_cgal_program("test_stitching.cpp") - create_single_source_cgal_program("remeshing_test.cpp" ) - create_single_source_cgal_program("measures_test.cpp") - create_single_source_cgal_program("triangulate_faces_test.cpp") - create_single_source_cgal_program("triangulate_faces_hole_filling_dt3_test.cpp") - create_single_source_cgal_program("triangulate_faces_hole_filling_all_search_test.cpp") - create_single_source_cgal_program("test_pmp_remove_border_edge.cpp") - create_single_source_cgal_program("test_pmp_distance.cpp") - create_single_source_cgal_program("test_corefinement_and_constraints.cpp") - create_single_source_cgal_program("test_corefinement_bool_op.cpp") - create_single_source_cgal_program("test_corefine.cpp") - create_single_source_cgal_program("test_coref_epic_points_identity.cpp") - create_single_source_cgal_program("test_does_bound_a_volume.cpp") - create_single_source_cgal_program("test_pmp_clip.cpp") - create_single_source_cgal_program("test_autorefinement.cpp") - create_single_source_cgal_program("autorefinement_sm.cpp") - create_single_source_cgal_program("triangulate_hole_polyline_test.cpp") - create_single_source_cgal_program("surface_intersection_sm_poly.cpp" ) - create_single_source_cgal_program("test_orient_cc.cpp") - create_single_source_cgal_program("test_pmp_transform.cpp") - create_single_source_cgal_program("extrude_test.cpp") - create_single_source_cgal_program("test_split_volume.cpp") - create_single_source_cgal_program("test_merging_border_vertices.cpp") - create_single_source_cgal_program("test_repair_polygon_soup.cpp") - create_single_source_cgal_program("test_shape_predicates.cpp") - create_single_source_cgal_program("test_pmp_collision_detection.cpp") - create_single_source_cgal_program("test_pmp_locate.cpp") - create_single_source_cgal_program("test_pmp_snapping.cpp") - create_single_source_cgal_program("test_pmp_non_conforming_snapping.cpp") - create_single_source_cgal_program("test_pmp_repair_degeneracies.cpp") - create_single_source_cgal_program("test_pmp_manifoldness.cpp") - create_single_source_cgal_program("test_mesh_smoothing.cpp") - create_single_source_cgal_program("test_remove_caps_needles.cpp") +create_single_source_cgal_program("connected_component_polyhedron.cpp") +create_single_source_cgal_program("connected_component_surface_mesh.cpp") +create_single_source_cgal_program("test_detect_features.cpp") +create_single_source_cgal_program("pmp_compute_normals_test.cpp") +create_single_source_cgal_program("orient_polygon_mesh_test.cpp") +create_single_source_cgal_program("orient_polygon_soup_test.cpp") +create_single_source_cgal_program("point_inside_polyhedron_boundary_test.cpp") +create_single_source_cgal_program("point_inside_surface_mesh_test.cpp") +create_single_source_cgal_program("polygon_mesh_slicer_test.cpp") +create_single_source_cgal_program("self_intersection_polyhedron_test.cpp") +create_single_source_cgal_program("self_intersection_surface_mesh_test.cpp") +create_single_source_cgal_program("pmp_do_intersect_test.cpp") +create_single_source_cgal_program("test_is_polygon_soup_a_polygon_mesh.cpp") +create_single_source_cgal_program("test_stitching.cpp") +create_single_source_cgal_program("remeshing_test.cpp") +create_single_source_cgal_program("measures_test.cpp") +create_single_source_cgal_program("triangulate_faces_test.cpp") +create_single_source_cgal_program("triangulate_faces_hole_filling_dt3_test.cpp") +create_single_source_cgal_program( + "triangulate_faces_hole_filling_all_search_test.cpp") +create_single_source_cgal_program("test_pmp_remove_border_edge.cpp") +create_single_source_cgal_program("test_pmp_distance.cpp") +create_single_source_cgal_program("test_corefinement_and_constraints.cpp") +create_single_source_cgal_program("test_corefinement_bool_op.cpp") +create_single_source_cgal_program("test_corefine.cpp") +create_single_source_cgal_program("test_coref_epic_points_identity.cpp") +create_single_source_cgal_program("test_does_bound_a_volume.cpp") +create_single_source_cgal_program("test_pmp_clip.cpp") +create_single_source_cgal_program("test_autorefinement.cpp") +create_single_source_cgal_program("autorefinement_sm.cpp") +create_single_source_cgal_program("triangulate_hole_polyline_test.cpp") +create_single_source_cgal_program("surface_intersection_sm_poly.cpp") +create_single_source_cgal_program("test_orient_cc.cpp") +create_single_source_cgal_program("test_pmp_transform.cpp") +create_single_source_cgal_program("extrude_test.cpp") +create_single_source_cgal_program("test_split_volume.cpp") +create_single_source_cgal_program("test_merging_border_vertices.cpp") +create_single_source_cgal_program("test_repair_polygon_soup.cpp") +create_single_source_cgal_program("test_shape_predicates.cpp") +create_single_source_cgal_program("test_pmp_collision_detection.cpp") +create_single_source_cgal_program("test_pmp_locate.cpp") +create_single_source_cgal_program("test_pmp_snapping.cpp") +create_single_source_cgal_program("test_pmp_non_conforming_snapping.cpp") +create_single_source_cgal_program("test_pmp_repair_degeneracies.cpp") +create_single_source_cgal_program("test_pmp_manifoldness.cpp") +create_single_source_cgal_program("test_mesh_smoothing.cpp") +create_single_source_cgal_program("test_remove_caps_needles.cpp") # create_single_source_cgal_program("test_pmp_repair_self_intersections.cpp") - if( TARGET CGAL::TBB_support ) - target_link_libraries(test_pmp_distance PUBLIC CGAL::TBB_support) - target_link_libraries(orient_polygon_soup_test PUBLIC CGAL::TBB_support) - target_link_libraries(self_intersection_surface_mesh_test PUBLIC CGAL::TBB_support) - else() - message( STATUS "NOTICE: Intel TBB was not found. test_pmp_distance will use sequential code." ) - endif() +if(TARGET CGAL::TBB_support) + target_link_libraries(test_pmp_distance PUBLIC CGAL::TBB_support) + target_link_libraries(orient_polygon_soup_test PUBLIC CGAL::TBB_support) + target_link_libraries(self_intersection_surface_mesh_test + PUBLIC CGAL::TBB_support) +else() + message( + STATUS + "NOTICE: Intel TBB was not found. test_pmp_distance will use sequential code." + ) +endif() if(OpenMesh_FOUND) - create_single_source_cgal_program("remeshing_test_P_SM_OM.cpp" ) - target_link_libraries( remeshing_test_P_SM_OM PRIVATE ${OPENMESH_LIBRARIES} ) + create_single_source_cgal_program("remeshing_test_P_SM_OM.cpp") + target_link_libraries(remeshing_test_P_SM_OM PRIVATE ${OPENMESH_LIBRARIES}) endif() find_package(Ceres QUIET) if(TARGET ceres) - target_compile_definitions( test_mesh_smoothing PRIVATE CGAL_PMP_USE_CERES_SOLVER ) - target_link_libraries( test_mesh_smoothing PRIVATE ceres ) + target_compile_definitions(test_mesh_smoothing + PRIVATE CGAL_PMP_USE_CERES_SOLVER) + target_link_libraries(test_mesh_smoothing PRIVATE ceres) -# target_compile_definitions( test_pmp_repair_self_intersections PRIVATE CGAL_PMP_USE_CERES_SOLVER ) -# target_link_libraries( test_pmp_repair_self_intersections PRIVATE ceres ) + # target_compile_definitions( test_pmp_repair_self_intersections PRIVATE CGAL_PMP_USE_CERES_SOLVER ) + # target_link_libraries( test_pmp_repair_self_intersections PRIVATE ceres ) endif(TARGET ceres) if(BUILD_TESTING) set_tests_properties( - execution___of__triangulate_hole_Polyhedron_3_no_delaunay_test - execution___of__triangulate_hole_Polyhedron_3_test + execution___of__triangulate_hole_Polyhedron_3_no_delaunay_test + execution___of__triangulate_hole_Polyhedron_3_test PROPERTIES RESOURCE_LOCK Triangulation_with_hole) endif() diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt index 68eec9daba7..4a09e98674b 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt @@ -1,31 +1,25 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -project( Polygonal_surface_reconstruction_Examples ) - +project(Polygonal_surface_reconstruction_Examples) cmake_minimum_required(VERSION 3.1...3.15) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "NOTICE: This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # include helper file -include( ${CGAL_USE_FILE} ) - +include(${CGAL_USE_FILE}) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "NOTICE: This project requires the Boost library, and will not be compiled.") + message( + STATUS + "NOTICE: This project requires the Boost library, and will not be compiled." + ) return() @@ -34,38 +28,43 @@ endif() # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) +include(CGAL_CreateSingleSourceCGALProgram) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) include(CGAL_Eigen_support) if(NOT TARGET CGAL::Eigen_support) - message(STATUS "NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled.") + message( + STATUS + "NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled." + ) return() endif() find_package(SCIP QUIET) include(CGAL_SCIP_support) -if (NOT TARGET CGAL::SCIP_support ) - find_package( GLPK QUIET) +if(NOT TARGET CGAL::SCIP_support) + find_package(GLPK QUIET) include(CGAL_GLPK_support) - if (NOT TARGET CGAL::GLPK_support ) - message( STATUS "NOTICE: This project requires either SCIP or GLPK, and will not be compiled.") + if(NOT TARGET CGAL::GLPK_support) + message( + STATUS + "NOTICE: This project requires either SCIP or GLPK, and will not be compiled." + ) return() endif() endif() -create_single_source_cgal_program( "polyfit_example_without_input_planes.cpp" ) -create_single_source_cgal_program( "polyfit_example_user_provided_planes.cpp" ) -create_single_source_cgal_program( "polyfit_example_model_complexty_control.cpp" ) -create_single_source_cgal_program( "polyfit_example_with_region_growing.cpp" ) +create_single_source_cgal_program("polyfit_example_without_input_planes.cpp") +create_single_source_cgal_program("polyfit_example_user_provided_planes.cpp") +create_single_source_cgal_program("polyfit_example_model_complexty_control.cpp") +create_single_source_cgal_program("polyfit_example_with_region_growing.cpp") -foreach(target - polyfit_example_without_input_planes - polyfit_example_user_provided_planes - polyfit_example_model_complexty_control - polyfit_example_with_region_growing) +foreach( + target + polyfit_example_without_input_planes polyfit_example_user_provided_planes + polyfit_example_model_complexty_control polyfit_example_with_region_growing) target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - if (TARGET CGAL::SCIP_support) + if(TARGET CGAL::SCIP_support) target_link_libraries(${target} PUBLIC CGAL::SCIP_support) else() target_link_libraries(${target} PUBLIC CGAL::GLPK_support) diff --git a/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt b/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt index 7ce3ba34320..a45c4ded258 100644 --- a/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt +++ b/Polygonal_surface_reconstruction/test/Polygonal_surface_reconstruction/CMakeLists.txt @@ -1,31 +1,25 @@ # Created by the script cgal_create_CMakeLists # This is the CMake script for compiling a set of CGAL applications. -project( Polygonal_surface_reconstruction_Tests ) - +project(Polygonal_surface_reconstruction_Tests) cmake_minimum_required(VERSION 3.1...3.15) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "NOTICE: This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # include helper file -include( ${CGAL_USE_FILE} ) - +include(${CGAL_USE_FILE}) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "NOTICE: This project requires the Boost library, and will not be compiled.") + message( + STATUS + "NOTICE: This project requires the Boost library, and will not be compiled." + ) return() @@ -34,31 +28,39 @@ endif() # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - +include(CGAL_CreateSingleSourceCGALProgram) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) include(CGAL_Eigen_support) if(NOT TARGET CGAL::Eigen_support) - message(STATUS "NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled.") + message( + STATUS + "NOTICE: This project requires Eigen 3.1 (or greater) and will not be compiled." + ) return() endif() find_package(SCIP QUIET) include(CGAL_SCIP_support) -if (NOT TARGET CGAL::SCIP_support ) - find_package( GLPK QUIET) +if(NOT TARGET CGAL::SCIP_support) + find_package(GLPK QUIET) include(CGAL_GLPK_support) - if (NOT TARGET CGAL::GLPK_support ) - message( STATUS "NOTICE: This project requires either SCIP or GLPK, and will not be compiled.") + if(NOT TARGET CGAL::GLPK_support) + message( + STATUS + "NOTICE: This project requires either SCIP or GLPK, and will not be compiled." + ) return() endif() endif() -create_single_source_cgal_program( "polygonal_surface_reconstruction_test.cpp") -target_link_libraries(polygonal_surface_reconstruction_test PUBLIC CGAL::Eigen_support) -if (TARGET CGAL::SCIP_support) - target_link_libraries(polygonal_surface_reconstruction_test PUBLIC CGAL::SCIP_support) +create_single_source_cgal_program("polygonal_surface_reconstruction_test.cpp") +target_link_libraries(polygonal_surface_reconstruction_test + PUBLIC CGAL::Eigen_support) +if(TARGET CGAL::SCIP_support) + target_link_libraries(polygonal_surface_reconstruction_test + PUBLIC CGAL::SCIP_support) else() - target_link_libraries(polygonal_surface_reconstruction_test PUBLIC CGAL::GLPK_support) + target_link_libraries(polygonal_surface_reconstruction_test + PUBLIC CGAL::GLPK_support) endif() diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index 55cf03849d1..75c53e0c8b0 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Polyhedron_Demo ) +project(Polyhedron_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -17,6 +17,7 @@ if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() +include(FeatureSummary) # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) @@ -26,7 +27,9 @@ set(CMAKE_AUTOMOC ON) list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11) if(has_cpp11 LESS 0) - message(STATUS "NOTICE: This demo requires a C++11 compiler and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires a C++11 compiler and will not be compiled.") return() endif() @@ -35,36 +38,47 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) #Defines flags to emulate windows behavior for linking error generation -if(CMAKE_CXX_COMPILER_ID EQUAL Clang OR CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) +if(CMAKE_CXX_COMPILER_ID EQUAL Clang + OR CMAKE_COMPILER_IS_GNUCC + OR CMAKE_COMPILER_IS_GNUCXX) if(UNIX OR APPLE) - SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden" ) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") endif() if(UNIX AND NOT APPLE) - SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z defs") - SET( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -z defs") - SET( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z defs") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z defs") + set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -z defs") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z defs") endif() endif() # Let plugins be compiled in the same directory as the executable. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") # Include this package's headers first -include_directories( BEFORE ./ ./include ./CGAL_demo ) +include_directories(BEFORE ./ ./include ./CGAL_demo) list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}") # Find CGAL -option( POLYHEDRON_QTSCRIPT_DEBUGGER - "Activate the use of Qt Script Debugger in Polyhedron_3 demo" OFF) +option(POLYHEDRON_QTSCRIPT_DEBUGGER + "Activate the use of Qt Script Debugger in Polyhedron_3 demo" OFF) -# Find Qt5 itself -find_package(CGAL COMPONENTS Qt5 ImageIO) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 ImageIO) +set_package_properties(CGAL PROPERTIES TYPE REQUIRED) include(${CGAL_USE_FILE}) +# Find Qt5 itself -find_package(Qt5 - QUIET - COMPONENTS OpenGL Script - OPTIONAL_COMPONENTS ScriptTools WebSockets) +find_package( + Qt5 QUIET + COMPONENTS OpenGL Script + OPTIONAL_COMPONENTS ScriptTools WebSockets) + +set_package_properties( + Qt5 PROPERTIES + TYPE REQUIRED + PURPOSE "Enables the 3D Features, for GUI and visualization." + DESCRIPTION + "To find this package, it should be sufficient to fill the Qt5_DIR variable with : ///lib/cmake/Qt5" +) if(Qt5_FOUND) @@ -73,113 +87,137 @@ if(Qt5_FOUND) endif(Qt5_FOUND) find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +set_package_properties( + Eigen3 PROPERTIES + DESCRIPTION "A library for mathematical tools." + PURPOSE + "Requiered for the Polyhedron Edit, Parameterization, Jet fitting, Classification plugin, Surface reconstruction, Normal estimation, Smoothing, Average spacing, Feature detection, Hole Filling and Fairing plugins ." +) include(CGAL_Eigen_support) -find_package( METIS ) +find_package(METIS) +set_package_properties( + METIS PROPERTIES + DESCRIPTION "A library for partitionning." + PURPOSE "Requiered for the partition plugin.") -if( METIS_FOUND ) - include_directories(${METIS_INCLUDE_DIRS} ) +if(METIS_FOUND) + include_directories(${METIS_INCLUDE_DIRS}) endif() # Activate concurrency? -option(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY - "Enable concurrency" - ON) +option(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY "Enable concurrency" ON) -if( POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY ) - find_package( TBB ) +if(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY) + find_package(TBB) include(CGAL_TBB_support) - if( NOT TARGET CGAL::TBB_support ) - message( STATUS "NOTICE: Intel TBB was not found. Bilateral smoothing and WLOP plugins are faster if TBB is linked." ) + if(NOT TARGET CGAL::TBB_support) + message( + STATUS + "NOTICE: Intel TBB was not found. Bilateral smoothing and WLOP plugins are faster if TBB is linked." + ) endif() endif() #find libssh for scene sharing find_package(LibSSH) -if( NOT LIBSSH_FOUND ) +set_package_properties( + LibSSH PROPERTIES + DESCRIPTION "A library used to enable the SSH features. " + PURPOSE "Requiered for loading (saving) a scene to (from) a distant server.") + +if(NOT LIBSSH_FOUND) message("NOTICE : The SSH features will be disabled.") endif() # Activate concurrency ? (turned OFF by default) -option(CGAL_ACTIVATE_CONCURRENT_MESH_3 - "Activate parallelism in Mesh_3" - OFF) +option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF) # And add -DCGAL_CONCURRENT_MESH_3 if that option is ON -if( CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3} ) - add_definitions( -DCGAL_CONCURRENT_MESH_3 ) +if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}) + add_definitions(-DCGAL_CONCURRENT_MESH_3) if(NOT TBB_FOUND) - find_package( TBB REQUIRED ) - include( CGAL_TBB_support) - if( NOT TARGET CGAL::TBB_support ) - message(STATUS "NOTICE: Intel TBB was not found. Mesh_3 is faster if TBB is linked.") + find_package(TBB REQUIRED) + include(CGAL_TBB_support) + if(NOT TARGET CGAL::TBB_support) + message( + STATUS + "NOTICE: Intel TBB was not found. Mesh_3 is faster if TBB is linked.") endif() endif() -else( CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3} ) - option( LINK_WITH_TBB - "Link with TBB anyway so we can use TBB timers for profiling" - ON) - if( LINK_WITH_TBB ) - find_package( TBB ) - include( CGAL_TBB_support) - endif( LINK_WITH_TBB ) +else(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}) + option(LINK_WITH_TBB + "Link with TBB anyway so we can use TBB timers for profiling" ON) + if(LINK_WITH_TBB) + find_package(TBB) + include(CGAL_TBB_support) + endif(LINK_WITH_TBB) endif() +set_package_properties( + TBB PROPERTIES + DESCRIPTION + "A library for parallelism. Mesh_3, Bilateral smoothing and WLOP plugins are faster if TBB is linked." + PURPOSE "Requiered for running some algorithms in parallel.") + if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_USE_FILE}) - qt5_wrap_ui( MainWindowUI_files MainWindow.ui) - qt5_wrap_ui( SubViewerUI_files SubViewer.ui) - qt5_wrap_ui( statisticsUI_FILES Statistics_on_item_dialog.ui) - qt5_wrap_ui( FileLoaderDialogUI_files FileLoaderDialog.ui ) - qt5_wrap_ui( Show_point_dialogUI_FILES Show_point_dialog.ui ) - qt5_wrap_ui( PreferencesUI_FILES Preferences.ui Details.ui SSH_dialog.ui) - qt5_wrap_ui( Show_point_dialogUI_FILES Show_point_dialog.ui ) - qt5_wrap_ui( ViewerUI_FILES LightingDialog.ui) - qt5_generate_moc( "File_loader_dialog.h" "${CMAKE_CURRENT_BINARY_DIR}/File_loader_dialog_moc.cpp" ) + qt5_wrap_ui(MainWindowUI_files MainWindow.ui) + qt5_wrap_ui(SubViewerUI_files SubViewer.ui) + qt5_wrap_ui(statisticsUI_FILES Statistics_on_item_dialog.ui) + qt5_wrap_ui(FileLoaderDialogUI_files FileLoaderDialog.ui) + qt5_wrap_ui(Show_point_dialogUI_FILES Show_point_dialog.ui) + qt5_wrap_ui(PreferencesUI_FILES Preferences.ui Details.ui SSH_dialog.ui) + qt5_wrap_ui(Show_point_dialogUI_FILES Show_point_dialog.ui) + qt5_wrap_ui(ViewerUI_FILES LightingDialog.ui) + qt5_generate_moc("File_loader_dialog.h" + "${CMAKE_CURRENT_BINARY_DIR}/File_loader_dialog_moc.cpp") - include( ${CMAKE_CURRENT_SOURCE_DIR}/polyhedron_demo_macros.cmake ) + include(${CMAKE_CURRENT_SOURCE_DIR}/polyhedron_demo_macros.cmake) - - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES Polyhedron_3.qrc ) - find_path(CGAL_THREE_HEADERS_PATH + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES Polyhedron_3.qrc) + find_path( + CGAL_THREE_HEADERS_PATH NAMES CGAL/Three/Scene_item.h HINTS ${CGAL_INCLUDE_DIRS} - NO_DEFAULT_PATH - NO_CMAKE_FIND_ROOT_PATH + NO_DEFAULT_PATH NO_CMAKE_FIND_ROOT_PATH DOC "Path to CGAL/Three/Scene_item.h") if(CGAL_THREE_HEADERS_PATH) - qt5_generate_moc( "${CGAL_THREE_HEADERS_PATH}/CGAL/Three/Viewer_interface.h" - "${CMAKE_CURRENT_BINARY_DIR}/Viewer_interface_moc.cpp" ) - qt5_generate_moc( "${CGAL_THREE_HEADERS_PATH}/CGAL/Three/Scene_item.h" - "${CMAKE_CURRENT_BINARY_DIR}/Scene_item_moc.cpp" ) - qt5_generate_moc( "${CGAL_THREE_HEADERS_PATH}/CGAL/Three/Scene_group_item.h" - "${CMAKE_CURRENT_BINARY_DIR}/Scene_group_item_moc.cpp" ) - qt5_generate_moc( "${CGAL_THREE_HEADERS_PATH}/CGAL/Three/Scene_item_rendering_helper.h" - "${CMAKE_CURRENT_BINARY_DIR}/Scene_item_rendering_helper_moc.cpp" ) - qt5_generate_moc( "${CGAL_THREE_HEADERS_PATH}/CGAL/Three/TextRenderer.h" - "${CMAKE_CURRENT_BINARY_DIR}/TextRenderer_moc.cpp" ) + qt5_generate_moc("${CGAL_THREE_HEADERS_PATH}/CGAL/Three/Viewer_interface.h" + "${CMAKE_CURRENT_BINARY_DIR}/Viewer_interface_moc.cpp") + qt5_generate_moc("${CGAL_THREE_HEADERS_PATH}/CGAL/Three/Scene_item.h" + "${CMAKE_CURRENT_BINARY_DIR}/Scene_item_moc.cpp") + qt5_generate_moc("${CGAL_THREE_HEADERS_PATH}/CGAL/Three/Scene_group_item.h" + "${CMAKE_CURRENT_BINARY_DIR}/Scene_group_item_moc.cpp") + qt5_generate_moc( + "${CGAL_THREE_HEADERS_PATH}/CGAL/Three/Scene_item_rendering_helper.h" + "${CMAKE_CURRENT_BINARY_DIR}/Scene_item_rendering_helper_moc.cpp") + qt5_generate_moc("${CGAL_THREE_HEADERS_PATH}/CGAL/Three/TextRenderer.h" + "${CMAKE_CURRENT_BINARY_DIR}/TextRenderer_moc.cpp") else() message(FATAL_ERROR "Cannot find ") endif() unset(CGAL_THREE_HEADERS_PATH CACHE) -# AUXILIARY LIBRARIES + # AUXILIARY LIBRARIES # put s (which are shared libraries) at the same location as # executable files set(CGAL_POLYHEDRON_DEMO_PLUGINS_DIR "${RUNTIME_OUTPUT_PATH}") set(LIBRARY_OUTPUT_PATH "${CGAL_POLYHEDRON_DEMO_PLUGINS_DIR}") - add_library(demo_framework SHARED + add_library( + demo_framework SHARED Scene.cpp Viewer.cpp Three.cpp ${ViewerUI_FILES} - ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} + ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES} Viewer_interface_moc.cpp Scene_item_moc.cpp Scene_item.cpp @@ -195,12 +233,12 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) Primitive_container.cpp Polyhedron_demo_plugin_helper.cpp CGAL_double_edit.cpp) - target_link_libraries(demo_framework - PUBLIC Qt5::OpenGL Qt5::Widgets Qt5::Gui Qt5::Script - ) + target_link_libraries(demo_framework PUBLIC Qt5::OpenGL Qt5::Widgets Qt5::Gui + Qt5::Script) if(TARGET Qt5::WebSockets) target_link_libraries(demo_framework PUBLIC Qt5::WebSockets) - message(STATUS "Qt5WebSockets was found. Using WebSockets is therefore possible.") + message( + STATUS "Qt5WebSockets was found. Using WebSockets is therefore possible.") endif() cgal_add_compilation_test(demo_framework) @@ -213,45 +251,46 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) target_compile_definitions(demo_framework PRIVATE -DCGAL_USE_Qt5_RESOURCES) endif() - add_library(scene_basic_objects SHARED - Scene_plane_item.cpp - Scene_spheres_item.cpp - ) - target_link_libraries(scene_basic_objects - PUBLIC - demo_framework - ${CGAL_LIBRARIES} - Qt5::OpenGL Qt5::Gui Qt5::Script Qt5::Widgets) + add_library(scene_basic_objects SHARED Scene_plane_item.cpp + Scene_spheres_item.cpp) + target_link_libraries( + scene_basic_objects PUBLIC demo_framework ${CGAL_LIBRARIES} Qt5::OpenGL + Qt5::Gui Qt5::Script Qt5::Widgets) add_library(scene_color_ramp SHARED Color_ramp.cpp) target_link_libraries(scene_color_ramp PRIVATE Qt5::Core) add_library(scene_callback_signaler SHARED Callback_signaler.cpp) target_link_libraries(scene_callback_signaler PRIVATE Qt5::Core) - add_library(point_dialog SHARED Show_point_dialog.cpp Show_point_dialog.ui ${Show_point_dialogUI_FILES}) - target_link_libraries(point_dialog - PUBLIC Qt5::OpenGL Qt5::Gui Qt5::Script Qt5::Widgets) + add_library(point_dialog SHARED Show_point_dialog.cpp Show_point_dialog.ui + ${Show_point_dialogUI_FILES}) + target_link_libraries(point_dialog PUBLIC Qt5::OpenGL Qt5::Gui Qt5::Script + Qt5::Widgets) add_custom_target(all_scene_items) if(BUILD_TESTING) cgal_add_compilation_test(all_scene_items) - set_property(TEST compilation_of__all_scene_items - APPEND PROPERTY DEPENDS compilation_of__demo_framework) - set_property(TEST compilation_of__all_scene_items - APPEND PROPERTY TIMEOUT 1700) + set_property( + TEST compilation_of__all_scene_items + APPEND + PROPERTY DEPENDS compilation_of__demo_framework) + set_property(TEST compilation_of__all_scene_items APPEND PROPERTY TIMEOUT + 1700) endif(BUILD_TESTING) macro(add_item item_name) add_library(${item_name} SHARED ${ARGN}) - target_link_libraries(${item_name} - PUBLIC demo_framework ${CGAL_LIBRARIES} - Qt5::OpenGL Qt5::Gui Qt5::Script Qt5::Widgets) + target_link_libraries( + ${item_name} PUBLIC demo_framework ${CGAL_LIBRARIES} Qt5::OpenGL Qt5::Gui + Qt5::Script Qt5::Widgets) add_dependencies(all_scene_items ${item_name}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${item_name} ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS ${item_name}) endmacro(add_item) add_item(scene_c3t3_item Scene_c3t3_item.cpp) - target_link_libraries(scene_c3t3_item PUBLIC scene_surface_mesh_item scene_polygon_soup_item scene_basic_objects ${TBB_LIBRARIES}) + target_link_libraries( + scene_c3t3_item PUBLIC scene_surface_mesh_item scene_polygon_soup_item + scene_basic_objects ${TBB_LIBRARIES}) if(TARGET CGAL::TBB_support) target_link_libraries(scene_c3t3_item PUBLIC CGAL::TBB_support) endif() @@ -259,8 +298,8 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) # Support for precompiled headers, for Mesh_3 (since CMake 3.16) target_precompile_headers(scene_c3t3_item PUBLIC [["C3t3_type.h"]]) endif() - add_item(scene_transform_item Plugins/PCA/Scene_facegraph_transform_item.cpp ) - add_item(scene_edit_box_item Plugins/PCA/Scene_edit_box_item.cpp ) + add_item(scene_transform_item Plugins/PCA/Scene_facegraph_transform_item.cpp) + add_item(scene_edit_box_item Plugins/PCA/Scene_edit_box_item.cpp) add_item(scene_image_item Scene_image_item.cpp) add_item(scene_surface_mesh_item Scene_surface_mesh_item.cpp) @@ -269,87 +308,110 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) endif() # special - add_item(scene_item_decorator Scene_polyhedron_item_decorator.cpp ) + add_item(scene_item_decorator Scene_polyhedron_item_decorator.cpp) target_link_libraries(scene_item_decorator PUBLIC scene_surface_mesh_item) - add_item(scene_k_ring_selection Plugins/PMP/Scene_facegraph_item_k_ring_selection.cpp) + add_item(scene_k_ring_selection + Plugins/PMP/Scene_facegraph_item_k_ring_selection.cpp) target_link_libraries(scene_k_ring_selection PUBLIC scene_surface_mesh_item) add_item(scene_selection_item Scene_polyhedron_selection_item.cpp) - target_link_libraries(scene_selection_item PUBLIC scene_item_decorator scene_k_ring_selection) - if(TBB_FOUND) + target_link_libraries(scene_selection_item PUBLIC scene_item_decorator + scene_k_ring_selection) + if(TBB_FOUND) target_link_libraries(scene_selection_item PUBLIC CGAL::TBB_support) endif() - add_item(scene_shortest_path_item Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp) - target_link_libraries(scene_shortest_path_item PUBLIC scene_item_decorator scene_surface_mesh_item scene_polylines_item) + add_item(scene_shortest_path_item + Plugins/Surface_mesh/Scene_polyhedron_shortest_path_item.cpp) + target_link_libraries( + scene_shortest_path_item + PUBLIC scene_item_decorator scene_surface_mesh_item scene_polylines_item) add_item(scene_movable_sm_item Plugins/AABB_tree/Scene_movable_sm_item.cpp) - if(TARGET CGAL::Eigen_support ) - add_item(scene_textured_item Scene_textured_surface_mesh_item.cpp texture.cpp) + if(TARGET CGAL::Eigen_support) + add_item(scene_textured_item Scene_textured_surface_mesh_item.cpp + texture.cpp) target_link_libraries(scene_textured_item PUBLIC CGAL::Eigen_support) - qt5_wrap_ui( editionUI_FILES Plugins/Surface_mesh_deformation/Deform_mesh.ui ) - add_item(scene_edit_item Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp - ${editionUI_FILES}) - target_link_libraries(scene_edit_item PUBLIC CGAL::Eigen_support scene_surface_mesh_item scene_k_ring_selection - scene_basic_objects) + qt5_wrap_ui(editionUI_FILES Plugins/Surface_mesh_deformation/Deform_mesh.ui) + add_item(scene_edit_item + Plugins/Surface_mesh_deformation/Scene_edit_polyhedron_item.cpp + ${editionUI_FILES}) + target_link_libraries( + scene_edit_item PUBLIC CGAL::Eigen_support scene_surface_mesh_item + scene_k_ring_selection scene_basic_objects) add_item(scene_mcf_item Plugins/PMP/Scene_mcf_item.cpp) target_link_libraries(scene_mcf_item PUBLIC CGAL::Eigen_support) endif() - add_item(scene_implicit_function_item Scene_implicit_function_item.cpp ) + add_item(scene_implicit_function_item Scene_implicit_function_item.cpp) target_link_libraries(scene_implicit_function_item PUBLIC scene_color_ramp) add_item(scene_polygon_soup_item Scene_polygon_soup_item.cpp) target_link_libraries(scene_polygon_soup_item PUBLIC scene_surface_mesh_item) add_item(scene_nef_polyhedron_item Scene_nef_polyhedron_item.cpp) - target_link_libraries(scene_nef_polyhedron_item PUBLIC scene_surface_mesh_item) + target_link_libraries(scene_nef_polyhedron_item + PUBLIC scene_surface_mesh_item) add_item(scene_points_with_normal_item Scene_points_with_normal_item.cpp) - if (TARGET CGAL::Eigen_support) - target_link_libraries(scene_points_with_normal_item PUBLIC CGAL::Eigen_support) + if(TARGET CGAL::Eigen_support) + target_link_libraries(scene_points_with_normal_item + PUBLIC CGAL::Eigen_support) endif() find_package(LASLIB) + set_package_properties( + LASLIB PROPERTIES + DESCRIPTION "A library for some I/O." + PURPOSE "Requiered for reading or writing LAS files.") + include(CGAL_LASLIB_support) - if (TARGET CGAL::LASLIB_support) - target_link_libraries(scene_points_with_normal_item PUBLIC CGAL::LASLIB_support) - if (MSVC) - target_compile_definitions( scene_points_with_normal_item PUBLIC "-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS") + if(TARGET CGAL::LASLIB_support) + target_link_libraries(scene_points_with_normal_item + PUBLIC CGAL::LASLIB_support) + if(MSVC) + target_compile_definitions( + scene_points_with_normal_item + PUBLIC "-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS") endif() endif() if(TBB_FOUND) - target_link_libraries(scene_points_with_normal_item PUBLIC CGAL::TBB_support) + target_link_libraries(scene_points_with_normal_item + PUBLIC CGAL::TBB_support) endif() add_item(scene_polylines_item Scene_polylines_item.cpp) - target_link_libraries(scene_polylines_item PUBLIC scene_basic_objects scene_points_with_normal_item) + target_link_libraries( + scene_polylines_item PUBLIC scene_basic_objects + scene_points_with_normal_item) add_item(scene_lcc_item Scene_lcc_item.cpp) - foreach( lib - demo_framework - scene_basic_objects - scene_color_ramp - scene_polygon_soup_item - scene_nef_polyhedron_item) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${lib} ) + foreach(lib demo_framework scene_basic_objects scene_color_ramp + scene_polygon_soup_item scene_nef_polyhedron_item) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS ${lib}) endforeach() - add_definitions( -DUSE_FORWARD_DECL) - add_library(polyhedron_demo SHARED + add_definitions(-DUSE_FORWARD_DECL) + add_library( + polyhedron_demo SHARED MainWindow.cpp Polyhedron_demo.cpp File_loader_dialog_moc.cpp Use_ssh.cpp - ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} - ${FileLoaderDialogUI_files} ${MainWindowUI_files} ${PreferencesUI_FILES} - ${statisticsUI_FILES} ${SubViewerUI_files}) - target_link_libraries(polyhedron_demo PUBLIC - demo_framework point_dialog Qt5::Gui Qt5::OpenGL Qt5::Widgets Qt5::Script) + ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES} + ${FileLoaderDialogUI_files} + ${MainWindowUI_files} + ${PreferencesUI_FILES} + ${statisticsUI_FILES} + ${SubViewerUI_files}) + target_link_libraries( + polyhedron_demo PUBLIC demo_framework point_dialog Qt5::Gui Qt5::OpenGL + Qt5::Widgets Qt5::Script) if(LIBSSH_FOUND) add_definitions(-DCGAL_USE_SSH) target_link_libraries(polyhedron_demo PUBLIC ${LIBSSH_LIBRARIES}) @@ -358,104 +420,145 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) add_definitions(-DCGAL_USE_WEBSOCKETS) target_link_libraries(polyhedron_demo PUBLIC Qt5::WebSockets) endif() - add_executable ( Polyhedron_3 Polyhedron_3.cpp ) - target_link_libraries( Polyhedron_3 PRIVATE polyhedron_demo ) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polyhedron_3 ) + add_executable(Polyhedron_3 Polyhedron_3.cpp) + target_link_libraries(Polyhedron_3 PRIVATE polyhedron_demo) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Polyhedron_3) - if( POLYHEDRON_QTSCRIPT_DEBUGGER ) + if(POLYHEDRON_QTSCRIPT_DEBUGGER) if(TARGET Qt5::ScriptTools) target_link_libraries(polyhedron_demo PUBLIC Qt5::ScriptTools) else() - message(STATUS "POLYHEDRON_QTSCRIPT_DEBUGGER is set to TRUE but the Qt5 ScriptTools library was not found.") + message( + STATUS + "POLYHEDRON_QTSCRIPT_DEBUGGER is set to TRUE but the Qt5 ScriptTools library was not found." + ) endif() endif() - target_link_libraries( Polyhedron_3 PRIVATE demo_framework ) + target_link_libraries(Polyhedron_3 PRIVATE demo_framework) # Link with CGAL - target_link_libraries( Polyhedron_3 PUBLIC ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) - - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polyhedron_3 ) + target_link_libraries(Polyhedron_3 PUBLIC ${CGAL_LIBRARIES} + ${CGAL_3RD_PARTY_LIBRARIES}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Polyhedron_3) ########### # PLUGINS # ########### + file( + GLOB DEMO_PLUGINS + RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/Plugins/" + "${CMAKE_CURRENT_SOURCE_DIR}/Plugins/*") + foreach(SUB_DIR ${DEMO_PLUGINS}) + add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/Plugins/${SUB_DIR}") + endforeach() - file(GLOB DEMO_PLUGINS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/Plugins/" "${CMAKE_CURRENT_SOURCE_DIR}/Plugins/*") - FOREACH(SUB_DIR ${DEMO_PLUGINS}) - add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/Plugins/${SUB_DIR}") - ENDFOREACH() + add_subdirectory(implicit_functions) - add_subdirectory( implicit_functions ) + # + # EXECUTABLES + # + add_executable(CGAL_Mesh_3 Mesh_3.cpp) + add_dependencies(CGAL_Mesh_3 Mesh_3) + target_link_libraries(CGAL_Mesh_3 PRIVATE polyhedron_demo) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_Mesh_3) -# -# EXECUTABLES -# -add_executable ( CGAL_Mesh_3 Mesh_3.cpp ) -add_dependencies(CGAL_Mesh_3 Mesh_3) -target_link_libraries( CGAL_Mesh_3 PRIVATE polyhedron_demo ) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS CGAL_Mesh_3 ) + add_executable(CGAL_Classification Classification.cpp) + add_dependencies(CGAL_Classification Classification) + target_link_libraries(CGAL_Classification PRIVATE polyhedron_demo) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_Classification) -add_executable ( CGAL_Classification Classification.cpp ) -add_dependencies(CGAL_Classification Classification) -target_link_libraries( CGAL_Classification PRIVATE polyhedron_demo ) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS CGAL_Classification ) + add_executable(CGAL_PMP PMP.cpp) + add_dependencies(CGAL_PMP PMP) + target_link_libraries(CGAL_PMP PRIVATE polyhedron_demo) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS CGAL_PMP) -add_executable ( CGAL_PMP PMP.cpp ) -add_dependencies(CGAL_PMP PMP) -target_link_libraries( CGAL_PMP PRIVATE polyhedron_demo ) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS CGAL_PMP ) - -#WS Server -if(TARGET Qt5::WebSockets) - add_executable (WS_server Server_ws.cpp) - target_link_libraries(WS_server PUBLIC Qt5::WebSockets) - message(STATUS "Qt5WebSockets was found. Using WebSockets is therefore possible.") -endif() -# -# Exporting -# + #WS Server + if(TARGET Qt5::WebSockets) + add_executable(WS_server Server_ws.cpp) + target_link_libraries(WS_server PUBLIC Qt5::WebSockets) + message( + STATUS "Qt5WebSockets was found. Using WebSockets is therefore possible.") + endif() + # + # Exporting + # if(TARGET CGAL_Qt5) - export(TARGETS CGAL CGAL_Qt5 CGAL_ImageIO FILE polyhedron_demo_targets.cmake NAMESPACE Polyhedron_) + export( + TARGETS CGAL CGAL_Qt5 CGAL_ImageIO + FILE polyhedron_demo_targets.cmake + NAMESPACE Polyhedron_) endif() if(TARGET CGAL_Qt5_moc_and_resources) export( TARGETS CGAL_Qt5_moc_and_resources - NAMESPACE Polyhedron_ - APPEND FILE polyhedron_demo_targets.cmake) + NAMESPACE Polyhedron_ APPEND + FILE polyhedron_demo_targets.cmake) endif() export( - TARGETS - demo_framework - scene_surface_mesh_item - scene_points_with_normal_item - scene_color_ramp - scene_implicit_function_item - scene_polylines_item - scene_basic_objects - scene_selection_item - scene_item_decorator - scene_k_ring_selection - NAMESPACE Polyhedron_ - APPEND FILE polyhedron_demo_targets.cmake) + TARGETS demo_framework + scene_surface_mesh_item + scene_points_with_normal_item + scene_color_ramp + scene_implicit_function_item + scene_polylines_item + scene_basic_objects + scene_selection_item + scene_item_decorator + scene_k_ring_selection + NAMESPACE Polyhedron_ APPEND + FILE polyhedron_demo_targets.cmake) - configure_file(CGAL_polyhedron_demoConfig.cmake.in CGAL_polyhedron_demoConfig.cmake) -#TO DO script the activation of all the plugins. + configure_file(CGAL_polyhedron_demoConfig.cmake.in + CGAL_polyhedron_demoConfig.cmake) + #TO DO script the activation of all the plugins. -else (CGAL_Qt5_FOUND AND Qt5_FOUND) +else(CGAL_Qt5_FOUND AND Qt5_FOUND) set(POLYHEDRON_MISSING_DEPS "") if(NOT CGAL_Qt5_FOUND) - set(POLYHEDRON_MISSING_DEPS "the CGAL Qt5 library, ${POLYHEDRON_MISSING_DEPS}") + set(POLYHEDRON_MISSING_DEPS + "the CGAL Qt5 library, ${POLYHEDRON_MISSING_DEPS}") endif() if(NOT Qt5_FOUND) set(POLYHEDRON_MISSING_DEPS "Qt5, ${POLYHEDRON_MISSING_DEPS}") endif() - message(STATUS "NOTICE: This demo requires ${POLYHEDRON_MISSING_DEPS}and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires ${POLYHEDRON_MISSING_DEPS}and will not be compiled." + ) +endif(CGAL_Qt5_FOUND AND Qt5_FOUND) -endif (CGAL_Qt5_FOUND AND Qt5_FOUND) +feature_summary( + WHAT REQUIRED_PACKAGES_NOT_FOUND + INCLUDE_QUIET_PACKAGES + DESCRIPTION + "NOTICE: Missing required packages that prevent the demo from being compiled:" + QUIET_ON_EMPTY + VAR NotFound_REQ_PACKAGES) +if(NOT ${NotFound_REQ_PACKAGES} STREQUAL "") + message(STATUS "${NotFound_REQ_PACKAGES}") +endif() + +feature_summary( + WHAT OPTIONAL_PACKAGES_NOT_FOUND INCLUDE_QUIET_PACKAGES + DESCRIPTION "Missing optional packages:" + QUIET_ON_EMPTY + VAR NotFound_PACKAGES) +if(NOT ${NotFound_PACKAGES} STREQUAL "") + message(STATUS "${NotFound_PACKAGES}") +endif() + +feature_summary( + WHAT DISABLED_FEATURES + DESCRIPTION "Missing Packages Components:" + QUIET_ON_EMPTY + VAR Disabled_Features) +if(NOT ${Disabled_Features} STREQUAL "") + message(STATUS "${Disabled_Features}") +endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/CMakeLists.txt index 1336c086cd7..452504968c9 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/AABB_tree/CMakeLists.txt @@ -1,10 +1,12 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) polyhedron_demo_plugin(do_trees_intersect_plugin Do_trees_intersect_plugin) -target_link_libraries(do_trees_intersect_plugin PUBLIC scene_surface_mesh_item scene_movable_sm_item) +target_link_libraries(do_trees_intersect_plugin PUBLIC scene_surface_mesh_item + scene_movable_sm_item) -polyhedron_demo_plugin(cut_plugin Cut_plugin ) -target_link_libraries(cut_plugin PUBLIC scene_surface_mesh_item scene_basic_objects scene_color_ramp) +polyhedron_demo_plugin(cut_plugin Cut_plugin) +target_link_libraries(cut_plugin PUBLIC scene_surface_mesh_item + scene_basic_objects scene_color_ramp) if(TARGET CGAL::TBB_support) target_link_libraries(cut_plugin PUBLIC CGAL::TBB_support) endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt index d3321fa9ea6..687e3d56d4a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt @@ -1,9 +1,6 @@ -include( polyhedron_demo_macros ) - qt5_wrap_ui( cameraUI_FILES Camera_positions_list.ui ) - polyhedron_demo_plugin(camera_positions_plugin - Camera_positions_plugin - Camera_positions_list - ${cameraUI_FILES}) - - target_link_libraries( camera_positions_plugin PUBLIC demo_framework) +include(polyhedron_demo_macros) +qt5_wrap_ui(cameraUI_FILES Camera_positions_list.ui) +polyhedron_demo_plugin(camera_positions_plugin Camera_positions_plugin + Camera_positions_list ${cameraUI_FILES}) +target_link_libraries(camera_positions_plugin PUBLIC demo_framework) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt index 288c22109ff..c106c536c74 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt @@ -1,61 +1,100 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) if(TARGET CGAL::Eigen_support) set(Classification_dependencies_met TRUE) - find_package( Boost OPTIONAL_COMPONENTS serialization iostreams ) + find_package(Boost OPTIONAL_COMPONENTS serialization iostreams) include(CGAL_Boost_serialization_support) include(CGAL_Boost_iostreams_support) - if (NOT TARGET CGAL::Boost_serialization_support) - message(STATUS "NOTICE: Boost Serialization not found. Classification plugin won't be available.") + if(NOT TARGET CGAL::Boost_serialization_support) + message( + STATUS + "NOTICE: Boost Serialization not found. Classification plugin won't be available." + ) set(Classification_dependencies_met FALSE) endif() - if (NOT TARGET CGAL::Boost_iostreams_support) - message(STATUS "NOTICE: Boost IOStreams not found. Classification plugin won't be available.") + if(NOT TARGET CGAL::Boost_iostreams_support) + message( + STATUS + "NOTICE: Boost IOStreams not found. Classification plugin won't be available." + ) set(Classification_dependencies_met FALSE) endif() find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning + set_package_properties( + OpenCV PROPERTIES + DESCRIPTION "A library for real-time computer vision." + PURPOSE "Enables the random forest predicate for the classification plugin." + ) include(CGAL_OpenCV_support) - if (NOT TARGET CGAL::OpenCV_support) - message(STATUS "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.") + if(NOT TARGET CGAL::OpenCV_support) + message( + STATUS + "NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available." + ) + endif() find_package(TensorFlow QUIET) + set_package_properties( + TensorFlow PROPERTIES + DESCRIPTION "A library for machine learning." + PURPOSE + "Enables the Neural Network predicate for the classification plugin.") + include(CGAL_TensorFlow_support) - if (NOT TARGET CGAL::TensorFlow_support) - message(STATUS "NOTICE: TensorFlow not found, Neural Network predicate for classification won't be available.") + if(NOT TARGET CGAL::TensorFlow_support) + message( + STATUS + "NOTICE: TensorFlow not found, Neural Network predicate for classification won't be available." + ) endif() - if (Classification_dependencies_met) - qt5_wrap_ui( classificationUI_FILES Classification_widget.ui Classification_advanced_widget.ui ) - polyhedron_demo_plugin(classification_plugin Classification_plugin Point_set_item_classification Cluster_classification Surface_mesh_item_classification ${classificationUI_FILES} KEYWORDS Classification) - target_link_libraries(classification_plugin PUBLIC - scene_points_with_normal_item - scene_polylines_item - scene_polygon_soup_item - scene_surface_mesh_item - scene_selection_item - scene_color_ramp - CGAL::Eigen_support - CGAL::Boost_serialization_support - CGAL::Boost_iostreams_support) + if(Classification_dependencies_met) + qt5_wrap_ui(classificationUI_FILES Classification_widget.ui + Classification_advanced_widget.ui) + polyhedron_demo_plugin( + classification_plugin + Classification_plugin + Point_set_item_classification + Cluster_classification + Surface_mesh_item_classification + ${classificationUI_FILES} + KEYWORDS + Classification) + target_link_libraries( + classification_plugin + PUBLIC scene_points_with_normal_item + scene_polylines_item + scene_polygon_soup_item + scene_surface_mesh_item + scene_selection_item + scene_color_ramp + CGAL::Eigen_support + CGAL::Boost_serialization_support + CGAL::Boost_iostreams_support) if(OpenCV_FOUND) target_link_libraries(classification_plugin PUBLIC CGAL::OpenCV_support) endif() if(TensorFlow_FOUND) - target_link_libraries(classification_plugin PUBLIC CGAL::TensorFlow_support) + target_link_libraries(classification_plugin + PUBLIC CGAL::TensorFlow_support) endif() if(TBB_FOUND) target_link_libraries(classification_plugin PUBLIC CGAL::TBB_support) endif() - add_dependencies(classification_plugin point_set_selection_plugin selection_plugin) + add_dependencies(classification_plugin point_set_selection_plugin + selection_plugin) endif() else() - message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Classification plugin will not be available.") + message( + STATUS + "NOTICE: Eigen 3.1 (or greater) was not found. Classification plugin will not be available." + ) endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/CMakeLists.txt index 8c621c0b873..338b6cfb52b 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_decomposition/CMakeLists.txt @@ -1,4 +1,4 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) polyhedron_demo_plugin(nef_plugin Nef_plugin) - target_link_libraries(nef_plugin PUBLIC scene_nef_polyhedron_item) +target_link_libraries(nef_plugin PUBLIC scene_nef_polyhedron_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt index f5c8d0c766d..fa13f46ff54 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Convex_hull/CMakeLists.txt @@ -1,7 +1,10 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) -polyhedron_demo_plugin(convex_hull_plugin Convex_hull_plugin KEYWORDS PointSetProcessing) -target_link_libraries(convex_hull_plugin PUBLIC scene_points_with_normal_item scene_polylines_item scene_selection_item scene_surface_mesh_item) +polyhedron_demo_plugin(convex_hull_plugin Convex_hull_plugin KEYWORDS + PointSetProcessing) +target_link_libraries( + convex_hull_plugin PUBLIC scene_points_with_normal_item scene_polylines_item + scene_selection_item scene_surface_mesh_item) polyhedron_demo_plugin(kernel_plugin Kernel_plugin) target_link_libraries(kernel_plugin PUBLIC scene_surface_mesh_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Display/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Display/CMakeLists.txt index 0f03d24021e..4804cc57ed8 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Display/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Display/CMakeLists.txt @@ -1,6 +1,10 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) if(TARGET CGAL::Eigen_support) - qt5_wrap_ui( display_propertyUI_FILES Display_property.ui ) - polyhedron_demo_plugin(display_property_plugin Display_property_plugin ${display_propertyUI_FILES}) - target_link_libraries(display_property_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_color_ramp CGAL::Eigen_support) + qt5_wrap_ui(display_propertyUI_FILES Display_property.ui) + polyhedron_demo_plugin(display_property_plugin Display_property_plugin + ${display_propertyUI_FILES}) + target_link_libraries( + display_property_plugin + PUBLIC scene_surface_mesh_item scene_points_with_normal_item + scene_color_ramp CGAL::Eigen_support) endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt index 17cabce1790..677f10509f4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt @@ -1,30 +1,44 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) polyhedron_demo_plugin(gocad_plugin GOCAD_io_plugin KEYWORDS IO) target_link_libraries(gocad_plugin PUBLIC scene_surface_mesh_item) -qt5_wrap_ui( funcUI_FILES Function_dialog.ui ) -polyhedron_demo_plugin(io_implicit_function_plugin Implicit_function_io_plugin ${funcUI_FILES} KEYWORDS IO Mesh_3) -target_link_libraries(io_implicit_function_plugin PUBLIC scene_implicit_function_item) +qt5_wrap_ui(funcUI_FILES Function_dialog.ui) +polyhedron_demo_plugin(io_implicit_function_plugin Implicit_function_io_plugin + ${funcUI_FILES} KEYWORDS IO Mesh_3) +target_link_libraries(io_implicit_function_plugin + PUBLIC scene_implicit_function_item) polyhedron_demo_plugin(nef_io_plugin Nef_io_plugin KEYWORDS IO) target_link_libraries(nef_io_plugin PUBLIC scene_nef_polyhedron_item) -polyhedron_demo_plugin(off_plugin OFF_io_plugin KEYWORDS IO Mesh_3 PointSetProcessing Classification PMP) -target_link_libraries(off_plugin PUBLIC scene_polygon_soup_item scene_points_with_normal_item scene_surface_mesh_item) +polyhedron_demo_plugin( + off_plugin + OFF_io_plugin + KEYWORDS + IO + Mesh_3 + PointSetProcessing + Classification + PMP) +target_link_libraries( + off_plugin PUBLIC scene_polygon_soup_item scene_points_with_normal_item + scene_surface_mesh_item) polyhedron_demo_plugin(off_to_nef_plugin OFF_to_nef_io_plugin KEYWORDS IO) target_link_libraries(off_to_nef_plugin PUBLIC scene_nef_polyhedron_item) -polyhedron_demo_plugin(polylines_io_plugin Polylines_io_plugin KEYWORDS IO Mesh_3) +polyhedron_demo_plugin(polylines_io_plugin Polylines_io_plugin KEYWORDS IO + Mesh_3) target_link_libraries(polylines_io_plugin PUBLIC scene_polylines_item) -polyhedron_demo_plugin(wkt_plugin WKT_io_plugin KEYWORDS IO PointSetProcessing Mesh_3) +polyhedron_demo_plugin(wkt_plugin WKT_io_plugin KEYWORDS IO PointSetProcessing + Mesh_3) target_link_libraries(wkt_plugin PUBLIC scene_polylines_item) polyhedron_demo_plugin(stl_plugin STL_io_plugin KEYWORDS IO PMP) -target_link_libraries(stl_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item) - +target_link_libraries(stl_plugin PUBLIC scene_surface_mesh_item + scene_polygon_soup_item) polyhedron_demo_plugin(surf_io_plugin Surf_io_plugin KEYWORDS IO PMP) target_link_libraries(surf_io_plugin PUBLIC scene_surface_mesh_item) @@ -32,66 +46,110 @@ target_link_libraries(surf_io_plugin PUBLIC scene_surface_mesh_item) polyhedron_demo_plugin(lcc_io_plugin lcc_io_plugin KEYWORDS IO) target_link_libraries(lcc_io_plugin PUBLIC scene_lcc_item) +find_package(VTK QUIET COMPONENTS vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML + vtkFiltersCore vtkFiltersSources) +set_package_properties( + VTK PROPERTIES + DESCRIPTION "A library for image processing." + PURPOSE "Can be used for I/O (DICOM, VTU, VTP.") -find_package(VTK QUIET COMPONENTS - vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML vtkFiltersCore vtkFiltersSources) -if (VTK_FOUND) +if(VTK_FOUND) if(VTK_USE_FILE) include(${VTK_USE_FILE}) endif() - if ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) + if("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) if(TARGET VTK::CommonCore) - set(VTK_LIBRARIES VTK::CommonCore VTK::IOCore VTK::IOLegacy VTK::IOXML VTK::FiltersCore VTK::FiltersSources) + set(VTK_LIBRARIES VTK::CommonCore VTK::IOCore VTK::IOLegacy VTK::IOXML + VTK::FiltersCore VTK::FiltersSources) endif() if(VTK_LIBRARIES) polyhedron_demo_plugin(vtk_plugin VTK_io_plugin KEYWORDS IO Mesh_3) - target_link_libraries(vtk_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_c3t3_item scene_points_with_normal_item - ${VTK_LIBRARIES}) + target_link_libraries( + vtk_plugin + PUBLIC scene_surface_mesh_item scene_polylines_item scene_c3t3_item + scene_points_with_normal_item ${VTK_LIBRARIES}) else() - message(STATUS "NOTICE : the vtk IO plugin needs VTK libraries and will not be compiled.") + message( + STATUS + "NOTICE : the vtk IO plugin needs VTK libraries and will not be compiled." + ) endif() else() - message(STATUS "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled (incorrect version found).") + message( + STATUS + "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled (incorrect version found)." + ) endif() else() - message(STATUS "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled.") + message( + STATUS + "NOTICE : the vtk IO plugin needs VTK 6.0 or greater and will not be compiled." + ) endif() -polyhedron_demo_plugin(xyz_plugin XYZ_io_plugin KEYWORDS IO PointSetProcessing Classification) +polyhedron_demo_plugin(xyz_plugin XYZ_io_plugin KEYWORDS IO 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.") + 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 IO 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) + polyhedron_demo_plugin( + ply_plugin + PLY_io_plugin + KEYWORDS + IO + 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 IO PointSetProcessing Classification) - target_link_libraries(las_plugin PUBLIC scene_points_with_normal_item CGAL::LASLIB_support) + if(TARGET CGAL::LASLIB_support) + polyhedron_demo_plugin(las_plugin LAS_io_plugin KEYWORDS IO + 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}) else() - message(STATUS "NOTICE : the LAS IO plugin needs LAS libraries and will not be compiled.") + message( + STATUS + "NOTICE : the LAS IO plugin needs LAS libraries and will not be compiled." + ) endif() endif() -find_path(3MF_INCLUDE_DIR +find_path( + 3MF_INCLUDE_DIR NAMES Model/COM/NMR_DLLInterfaces.h PATH_SUFFIXES lib3mf - DOC "Path to lib3MF headers" - ) -find_library(3MF_LIBRARIES NAMES 3MF DOC "Path to the lib3MF library") + DOC "Path to lib3MF headers") +find_library( + 3MF_LIBRARIES + NAMES 3MF + DOC "Path to the lib3MF library") -if(3MF_LIBRARIES AND 3MF_INCLUDE_DIR AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/NMR_DLLInterfaces.h") +if(3MF_LIBRARIES + AND 3MF_INCLUDE_DIR + AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/NMR_DLLInterfaces.h") include_directories(${3MF_INCLUDE_DIR}) polyhedron_demo_plugin(3mf_io_plugin 3mf_io_plugin KEYWORDS IO PMP) - target_link_libraries(3mf_io_plugin PRIVATE scene_surface_mesh_item scene_points_with_normal_item scene_polylines_item ${3MF_LIBRARIES}) + target_link_libraries( + 3mf_io_plugin PRIVATE scene_surface_mesh_item scene_points_with_normal_item + scene_polylines_item ${3MF_LIBRARIES}) else() - message(STATUS "NOTICE : The 3mf_io_plugin requires the lib3MF library in a version < 2.0, and will not be compiled.") + message( + STATUS + "NOTICE : The 3mf_io_plugin requires the lib3MF library in a version < 2.0, and will not be compiled." + ) endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/CMakeLists.txt index 7c0b0bd6cbe..e4336410f02 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_2/CMakeLists.txt @@ -1,9 +1,8 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) #if the plugin has a UI file -qt5_wrap_ui( mesh_2UI_FILES mesh_2_dialog.ui) +qt5_wrap_ui(mesh_2UI_FILES mesh_2_dialog.ui) polyhedron_demo_plugin(mesh_2_plugin Mesh_2_plugin ${mesh_2UI_FILES}) #if the plugin uses external libraries like scene_items -target_link_libraries(mesh_2_plugin PUBLIC - scene_surface_mesh_item - scene_polylines_item - scene_points_with_normal_item) +target_link_libraries( + mesh_2_plugin PUBLIC scene_surface_mesh_item scene_polylines_item + scene_points_with_normal_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt index 03ada7360f3..6119eedcc7e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt @@ -1,73 +1,123 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) remove_definitions(-DQT_STATICPLUGIN) -qt5_wrap_cpp( VOLUME_MOC_OUTFILES ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_thread.h ) -qt5_wrap_cpp( VOLUME_MOC_OUTFILES ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_interface.h ) -qt5_wrap_ui( meshingUI_FILES Meshing_dialog.ui Smoother_dialog.ui Local_optimizers_dialog.ui ) -polyhedron_demo_plugin(mesh_3_plugin Mesh_3_plugin - Mesh_3_plugin_cgal_code.cpp Meshing_thread.cpp split_polylines.cpp - ${meshingUI_FILES} KEYWORDS Mesh_3) -target_link_libraries(mesh_3_plugin PUBLIC scene_polygon_soup_item scene_polylines_item scene_implicit_function_item scene_image_item - scene_surface_mesh_item scene_c3t3_item ${OPENGL_gl_LIBRARY} ) +qt5_wrap_cpp(VOLUME_MOC_OUTFILES + ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_thread.h) +qt5_wrap_cpp(VOLUME_MOC_OUTFILES + ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_interface.h) +qt5_wrap_ui(meshingUI_FILES Meshing_dialog.ui Smoother_dialog.ui + Local_optimizers_dialog.ui) +polyhedron_demo_plugin( + mesh_3_plugin + Mesh_3_plugin + Mesh_3_plugin_cgal_code.cpp + Meshing_thread.cpp + split_polylines.cpp + ${meshingUI_FILES} + KEYWORDS + Mesh_3) +target_link_libraries( + mesh_3_plugin + PUBLIC scene_polygon_soup_item + scene_polylines_item + scene_implicit_function_item + scene_image_item + scene_surface_mesh_item + scene_c3t3_item + ${OPENGL_gl_LIBRARY}) target_include_directories(mesh_3_plugin PRIVATE include) -find_package(VTK QUIET COMPONENTS - vtkImagingGeneral vtkIOImage NO_MODULE) -if (VTK_FOUND) +find_package(VTK QUIET COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) +if(VTK_FOUND) if(VTK_USE_FILE) include(${VTK_USE_FILE}) endif() - if ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) + if("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) if(TARGET VTK::IOImage) set(VTK_LIBRARIES VTK::IOImage) endif() if(NOT VTK_LIBRARIES) - message(STATUS "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to.") + message( + STATUS + "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to." + ) endif() else() - message(STATUS "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to.") + message( + STATUS + "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to." + ) endif() else() - message(STATUS "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to.") + message( + STATUS + "NOTICE : the DICOM files (.dcm) need VTK libraries to be open and will not be able to." + ) endif() find_package(Boost QUIET OPTIONAL_COMPONENTS filesystem system) if(Boost_FILESYSTEM_FOUND) - qt5_wrap_ui( imgUI_FILES Image_res_dialog.ui raw_image.ui) - polyhedron_demo_plugin(io_image_plugin Io_image_plugin Volume_plane_intersection.cpp Raw_image_dialog.cpp ${imgUI_FILES} ${VOLUME_MOC_OUTFILES} KEYWORDS IO Mesh_3) - target_link_libraries(io_image_plugin PUBLIC scene_image_item ${VTK_LIBRARIES} CGAL::CGAL_ImageIO) + qt5_wrap_ui(imgUI_FILES Image_res_dialog.ui raw_image.ui) + polyhedron_demo_plugin( + io_image_plugin + Io_image_plugin + Volume_plane_intersection.cpp + Raw_image_dialog.cpp + ${imgUI_FILES} + ${VOLUME_MOC_OUTFILES} + KEYWORDS + IO + Mesh_3) + target_link_libraries( + io_image_plugin PUBLIC scene_image_item ${VTK_LIBRARIES} CGAL::CGAL_ImageIO) if(VTK_LIBRARIES) target_compile_definitions(io_image_plugin PRIVATE CGAL_USE_VTK) endif() if(TARGET Boost::filesystem) - target_link_libraries(io_image_plugin PUBLIC Boost::filesystem Boost::system) + target_link_libraries(io_image_plugin PUBLIC Boost::filesystem + Boost::system) else() target_link_libraries(io_image_plugin PUBLIC ${Boost_LIBRARIES}) endif() else() - message( STATUS "NOTICE : the Io_image_plugin needs boost-filesystem to work and will not be compiled") + message( + STATUS + "NOTICE : the Io_image_plugin needs boost-filesystem to work and will not be compiled" + ) endif() -polyhedron_demo_plugin(mesh_3_optimization_plugin Optimization_plugin - Optimization_plugin_cgal_code.cpp Optimizer_thread.cpp - ${meshingUI_FILES} KEYWORDS Mesh_3) -target_link_libraries(mesh_3_optimization_plugin PUBLIC scene_c3t3_item scene_surface_mesh_item scene_image_item scene_implicit_function_item ) +polyhedron_demo_plugin( + mesh_3_optimization_plugin + Optimization_plugin + Optimization_plugin_cgal_code.cpp + Optimizer_thread.cpp + ${meshingUI_FILES} + KEYWORDS + Mesh_3) +target_link_libraries( + mesh_3_optimization_plugin + PUBLIC scene_c3t3_item scene_surface_mesh_item scene_image_item + scene_implicit_function_item) # Use Eigen - find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) - include(CGAL_Eigen_support) +find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - target_link_libraries(mesh_3_optimization_plugin PUBLIC CGAL::Eigen_support) - else() #eigen - message(STATUS "The Mesh_3_optimization_plugin requires Eigen, which was not found, and will use a deprecated class to replace it. Warnings are to be expected.") - endif()#eigen +if(TARGET CGAL::Eigen_support) + target_link_libraries(mesh_3_optimization_plugin PUBLIC CGAL::Eigen_support) +else() #eigen + message( + STATUS + "The Mesh_3_optimization_plugin requires Eigen, which was not found, and will use a deprecated class to replace it. Warnings are to be expected." + ) +endif() #eigen polyhedron_demo_plugin(c3t3_io_plugin C3t3_io_plugin KEYWORDS IO Mesh_3) target_link_libraries(c3t3_io_plugin PUBLIC scene_c3t3_item) -qt5_wrap_ui( ribUI_FILES Rib_dialog.ui) -polyhedron_demo_plugin(c3t3_rib_exporter_plugin C3t3_rib_exporter_plugin ${ribUI_FILES} KEYWORDS Mesh_3) +qt5_wrap_ui(ribUI_FILES Rib_dialog.ui) +polyhedron_demo_plugin(c3t3_rib_exporter_plugin C3t3_rib_exporter_plugin + ${ribUI_FILES} KEYWORDS Mesh_3) target_link_libraries(c3t3_rib_exporter_plugin PUBLIC scene_c3t3_item) if(TBB_FOUND) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt index baa5f345435..c444d538c3f 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Operations_on_polyhedra/CMakeLists.txt @@ -1,18 +1,29 @@ -include( polyhedron_demo_macros ) - qt5_wrap_ui( clip_polyhedronUI_FILES Clip_polyhedron_plugin.ui ) - polyhedron_demo_plugin(clip_polyhedron_plugin Clip_polyhedron_plugin ${clip_polyhedronUI_FILES}) - target_link_libraries(clip_polyhedron_plugin PUBLIC scene_surface_mesh_item scene_basic_objects scene_movable_sm_item) +include(polyhedron_demo_macros) +qt5_wrap_ui(clip_polyhedronUI_FILES Clip_polyhedron_plugin.ui) +polyhedron_demo_plugin(clip_polyhedron_plugin Clip_polyhedron_plugin + ${clip_polyhedronUI_FILES}) +target_link_libraries( + clip_polyhedron_plugin PUBLIC scene_surface_mesh_item scene_basic_objects + scene_movable_sm_item) - polyhedron_demo_plugin(point_set_from_vertices_plugin Point_set_from_vertices_plugin) - target_link_libraries(point_set_from_vertices_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item scene_points_with_normal_item) +polyhedron_demo_plugin(point_set_from_vertices_plugin + Point_set_from_vertices_plugin) +target_link_libraries( + point_set_from_vertices_plugin + PUBLIC scene_surface_mesh_item scene_polygon_soup_item + scene_points_with_normal_item) - polyhedron_demo_plugin(diff_between_meshes_plugin Diff_between_meshes_plugin) - target_link_libraries(diff_between_meshes_plugin PUBLIC scene_surface_mesh_item) +polyhedron_demo_plugin(diff_between_meshes_plugin Diff_between_meshes_plugin) +target_link_libraries(diff_between_meshes_plugin PUBLIC scene_surface_mesh_item) - if( METIS_FOUND ) - qt5_wrap_ui( partitionUI_FILES PartitionDialog.ui ) - polyhedron_demo_plugin(partition_plugin Partition_graph_plugin ${partitionUI_FILES}) - target_link_libraries(partition_plugin PUBLIC scene_surface_mesh_item ${METIS_LIBRARIES} ) +if(METIS_FOUND) + qt5_wrap_ui(partitionUI_FILES PartitionDialog.ui) + polyhedron_demo_plugin(partition_plugin Partition_graph_plugin + ${partitionUI_FILES}) + target_link_libraries(partition_plugin PUBLIC scene_surface_mesh_item + ${METIS_LIBRARIES}) else() - message("NOTICE : the Partition plugin needs METIS libraries and will not be compiled.") + message( + "NOTICE : the Partition plugin needs METIS libraries and will not be compiled." + ) endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt index 5562e6680f8..58f1350a3dc 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PCA/CMakeLists.txt @@ -1,25 +1,39 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) polyhedron_demo_plugin(pca_plugin Pca_plugin KEYWORDS PointSetProcessing) -target_link_libraries(pca_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_basic_objects) +target_link_libraries( + pca_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item + scene_basic_objects) -qt5_wrap_ui( transformUI_FILES Transformation_widget.ui MeshOnGrid_dialog.ui) +qt5_wrap_ui(transformUI_FILES Transformation_widget.ui MeshOnGrid_dialog.ui) -polyhedron_demo_plugin(affine_transform_plugin Affine_transform_plugin ${transformUI_FILES} KEYWORDS PointSetProcessing) -target_link_libraries(affine_transform_plugin PUBLIC scene_surface_mesh_item scene_transform_item scene_points_with_normal_item) +polyhedron_demo_plugin(affine_transform_plugin Affine_transform_plugin + ${transformUI_FILES} KEYWORDS PointSetProcessing) +target_link_libraries( + affine_transform_plugin PUBLIC scene_surface_mesh_item scene_transform_item + scene_points_with_normal_item) polyhedron_demo_plugin(edit_box_plugin Edit_box_plugin) -target_link_libraries(edit_box_plugin PUBLIC scene_edit_box_item scene_surface_mesh_item ) +target_link_libraries(edit_box_plugin PUBLIC scene_edit_box_item + scene_surface_mesh_item) -qt5_wrap_ui( clipUI_FILES Clipping_box_widget.ui ) +qt5_wrap_ui(clipUI_FILES Clipping_box_widget.ui) polyhedron_demo_plugin(clipping_box_plugin Clipping_box_plugin ${clipUI_FILES}) -target_link_libraries(clipping_box_plugin PUBLIC scene_edit_box_item scene_basic_objects) +target_link_libraries(clipping_box_plugin PUBLIC scene_edit_box_item + scene_basic_objects) polyhedron_demo_plugin(create_bbox_mesh_plugin Create_bbox_mesh_plugin) target_link_libraries(create_bbox_mesh_plugin PUBLIC scene_surface_mesh_item) polyhedron_demo_plugin(create_obb_mesh_plugin Create_obb_mesh_plugin) -target_link_libraries(create_obb_mesh_plugin PUBLIC scene_surface_mesh_item scene_selection_item scene_points_with_normal_item) +target_link_libraries( + create_obb_mesh_plugin PUBLIC scene_surface_mesh_item scene_selection_item + scene_points_with_normal_item) -qt5_wrap_ui( volumesUI_FILES Basic_generator_widget.ui) -polyhedron_demo_plugin(basic_generator_plugin Basic_generator_plugin ${volumesUI_FILES} KEYWORDS PolygonMesh PointSetProcessing) -target_link_libraries(basic_generator_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_polylines_item) +qt5_wrap_ui(volumesUI_FILES Basic_generator_widget.ui) +polyhedron_demo_plugin( + basic_generator_plugin Basic_generator_plugin ${volumesUI_FILES} KEYWORDS + PolygonMesh PointSetProcessing) +target_link_libraries( + basic_generator_plugin + PUBLIC scene_surface_mesh_item scene_points_with_normal_item + scene_polylines_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt index 56d43cccef3..b02d11fac29 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt @@ -1,126 +1,196 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) if(TARGET CGAL::Eigen_support) polyhedron_demo_plugin(jet_fitting_plugin Jet_fitting_plugin) - target_link_libraries(jet_fitting_plugin PUBLIC scene_surface_mesh_item scene_polylines_item CGAL::Eigen_support) + target_link_libraries( + jet_fitting_plugin PUBLIC scene_surface_mesh_item scene_polylines_item + CGAL::Eigen_support) else() - message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Jet fitting plugin will not be available.") + message( + STATUS + "NOTICE: Eigen 3.1 (or greater) was not found. Jet fitting plugin will not be available." + ) endif() polyhedron_demo_plugin(extrude_plugin Extrude_plugin KEYWORDS PMP) -target_link_libraries(extrude_plugin PUBLIC scene_surface_mesh_item scene_selection_item) +target_link_libraries(extrude_plugin PUBLIC scene_surface_mesh_item + scene_selection_item) if(TARGET CGAL::Eigen_support) if("${EIGEN3_VERSION}" VERSION_GREATER "3.1.90") - qt5_wrap_ui( hole_fillingUI_FILES Hole_filling_widget.ui) - polyhedron_demo_plugin(hole_filling_plugin Hole_filling_plugin ${hole_fillingUI_FILES} KEYWORDS PMP) - target_link_libraries(hole_filling_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_selection_item CGAL::Eigen_support) + qt5_wrap_ui(hole_fillingUI_FILES Hole_filling_widget.ui) + polyhedron_demo_plugin(hole_filling_plugin Hole_filling_plugin + ${hole_fillingUI_FILES} KEYWORDS PMP) + target_link_libraries( + hole_filling_plugin PUBLIC scene_surface_mesh_item scene_polylines_item + scene_selection_item CGAL::Eigen_support) - qt5_wrap_ui( fairingUI_FILES Fairing_widget.ui) - polyhedron_demo_plugin(fairing_plugin Fairing_plugin ${fairingUI_FILES} KEYWORDS PMP) - target_link_libraries(fairing_plugin PUBLIC scene_selection_item CGAL::Eigen_support) + qt5_wrap_ui(fairingUI_FILES Fairing_widget.ui) + polyhedron_demo_plugin(fairing_plugin Fairing_plugin ${fairingUI_FILES} + KEYWORDS PMP) + target_link_libraries(fairing_plugin PUBLIC scene_selection_item + CGAL::Eigen_support) - polyhedron_demo_plugin(hole_filling_polyline_plugin Hole_filling_polyline_plugin ) - target_link_libraries(hole_filling_polyline_plugin PUBLIC scene_surface_mesh_item scene_polylines_item CGAL::Eigen_support) + polyhedron_demo_plugin(hole_filling_polyline_plugin + Hole_filling_polyline_plugin) + target_link_libraries( + hole_filling_polyline_plugin + PUBLIC scene_surface_mesh_item scene_polylines_item CGAL::Eigen_support) - qt5_wrap_ui( Mean_curvature_flow_skeleton_pluginUI_FILES Mean_curvature_flow_skeleton_plugin.ui) - polyhedron_demo_plugin(mean_curvature_flow_skeleton_plugin Mean_curvature_flow_skeleton_plugin ${Mean_curvature_flow_skeleton_pluginUI_FILES}) - target_link_libraries(mean_curvature_flow_skeleton_plugin - PUBLIC - scene_surface_mesh_item - scene_points_with_normal_item - scene_polylines_item - scene_mcf_item - demo_framework - CGAL::Eigen_support) - # The smoothing plugin can still do some things, even if Ceres is not found - qt5_wrap_ui( smoothingUI_FILES Smoothing_plugin.ui) - polyhedron_demo_plugin(smoothing_plugin Smoothing_plugin ${smoothingUI_FILES}) - target_link_libraries(smoothing_plugin PUBLIC scene_surface_mesh_item scene_selection_item CGAL::Eigen_support) - find_package(Ceres QUIET) - if(TARGET ceres) - target_compile_definitions( smoothing_plugin PRIVATE CGAL_PMP_USE_CERES_SOLVER ) - target_link_libraries(smoothing_plugin PUBLIC ceres) - endif() + qt5_wrap_ui(Mean_curvature_flow_skeleton_pluginUI_FILES + Mean_curvature_flow_skeleton_plugin.ui) + polyhedron_demo_plugin( + mean_curvature_flow_skeleton_plugin Mean_curvature_flow_skeleton_plugin + ${Mean_curvature_flow_skeleton_pluginUI_FILES}) + target_link_libraries( + mean_curvature_flow_skeleton_plugin + PUBLIC scene_surface_mesh_item scene_points_with_normal_item + scene_polylines_item scene_mcf_item demo_framework + CGAL::Eigen_support) + # The smoothing plugin can still do some things, even if Ceres is not found + qt5_wrap_ui(smoothingUI_FILES Smoothing_plugin.ui) + polyhedron_demo_plugin(smoothing_plugin Smoothing_plugin + ${smoothingUI_FILES}) + target_link_libraries( + smoothing_plugin PUBLIC scene_surface_mesh_item scene_selection_item + CGAL::Eigen_support) + find_package(Ceres QUIET) + set_package_properties( + Ceres PROPERTIES + DESCRIPTION "A large scale non-linear optimization library." + PURPOSE "Can be used as a solver in the smoothing plugin.") - target_link_libraries(extrude_plugin PUBLIC CGAL::Eigen_support) + if(TARGET ceres) + target_compile_definitions(smoothing_plugin + PRIVATE CGAL_PMP_USE_CERES_SOLVER) + target_link_libraries(smoothing_plugin PUBLIC ceres) + endif() + + target_link_libraries(extrude_plugin PUBLIC CGAL::Eigen_support) else() - message(STATUS "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available.") + message( + STATUS + "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available." + ) endif() else(EIGEN3_FOUND) - message(STATUS "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available.") + message( + STATUS + "NOTICE: The hole filling and fairing plugins require Eigen 3.2 (or higher) and will not be available." + ) endif() -qt5_wrap_ui( soupUI_FILES Repair_soup.ui ) -polyhedron_demo_plugin(orient_soup_plugin Orient_soup_plugin ${soupUI_FILES} KEYWORDS Classification PMP) -target_link_libraries(orient_soup_plugin PUBLIC scene_polygon_soup_item scene_surface_mesh_item scene_polylines_item scene_points_with_normal_item) - +qt5_wrap_ui(soupUI_FILES Repair_soup.ui) +polyhedron_demo_plugin(orient_soup_plugin Orient_soup_plugin ${soupUI_FILES} + KEYWORDS Classification PMP) +target_link_libraries( + orient_soup_plugin PUBLIC scene_polygon_soup_item scene_surface_mesh_item + scene_polylines_item scene_points_with_normal_item) polyhedron_demo_plugin(inside_out_plugin Inside_out_plugin KEYWORDS PMP) -target_link_libraries(inside_out_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item) +target_link_libraries(inside_out_plugin PUBLIC scene_surface_mesh_item + scene_polygon_soup_item) -polyhedron_demo_plugin(join_and_split_plugin Join_and_split_polyhedra_plugin KEYWORDS PMP) -target_link_libraries(join_and_split_plugin PUBLIC scene_surface_mesh_item scene_selection_item) +polyhedron_demo_plugin(join_and_split_plugin Join_and_split_polyhedra_plugin + KEYWORDS PMP) +target_link_libraries(join_and_split_plugin PUBLIC scene_surface_mesh_item + scene_selection_item) -qt5_wrap_ui( point_inside_polyhedronUI_FILES Point_inside_polyhedron_widget.ui) -polyhedron_demo_plugin(point_inside_polyhedron_plugin Point_inside_polyhedron_plugin ${point_inside_polyhedronUI_FILES}) -target_link_libraries(point_inside_polyhedron_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item) +qt5_wrap_ui(point_inside_polyhedronUI_FILES Point_inside_polyhedron_widget.ui) +polyhedron_demo_plugin( + point_inside_polyhedron_plugin Point_inside_polyhedron_plugin + ${point_inside_polyhedronUI_FILES}) +target_link_libraries( + point_inside_polyhedron_plugin PUBLIC scene_surface_mesh_item + scene_points_with_normal_item) -qt5_wrap_ui( polyhedron_slicerUI_FILES Polyhedron_slicer_widget.ui) -polyhedron_demo_plugin(polyhedron_slicer_plugin Polyhedron_slicer_plugin ${polyhedron_slicerUI_FILES}) -target_link_libraries(polyhedron_slicer_plugin PUBLIC scene_surface_mesh_item scene_basic_objects scene_polylines_item) +qt5_wrap_ui(polyhedron_slicerUI_FILES Polyhedron_slicer_widget.ui) +polyhedron_demo_plugin(polyhedron_slicer_plugin Polyhedron_slicer_plugin + ${polyhedron_slicerUI_FILES}) +target_link_libraries( + polyhedron_slicer_plugin PUBLIC scene_surface_mesh_item scene_basic_objects + scene_polylines_item) -polyhedron_demo_plugin(polyhedron_stitching_plugin Polyhedron_stitching_plugin KEYWORDS PMP) -target_link_libraries(polyhedron_stitching_plugin PUBLIC scene_surface_mesh_item scene_polylines_item) +polyhedron_demo_plugin(polyhedron_stitching_plugin Polyhedron_stitching_plugin + KEYWORDS PMP) +target_link_libraries(polyhedron_stitching_plugin PUBLIC scene_surface_mesh_item + scene_polylines_item) -qt5_wrap_ui( selectionUI_FILES Selection_widget.ui) -polyhedron_demo_plugin(selection_plugin Selection_plugin ${selectionUI_FILES} KEYWORDS PMP IO Classification Mesh_3) -target_link_libraries(selection_plugin PUBLIC scene_selection_item scene_points_with_normal_item scene_polylines_item) +qt5_wrap_ui(selectionUI_FILES Selection_widget.ui) +polyhedron_demo_plugin( + selection_plugin + Selection_plugin + ${selectionUI_FILES} + KEYWORDS + PMP + IO + Classification + Mesh_3) +target_link_libraries( + selection_plugin PUBLIC scene_selection_item scene_points_with_normal_item + scene_polylines_item) #to keep it simple to compile -add_custom_target(self_intersection_plugin ) +add_custom_target(self_intersection_plugin) add_dependencies(self_intersection_plugin selection_plugin) -polyhedron_demo_plugin(triangulate_facets_plugin Triangulate_facets_plugin KEYWORDS PMP) +polyhedron_demo_plugin(triangulate_facets_plugin Triangulate_facets_plugin + KEYWORDS PMP) target_link_libraries(triangulate_facets_plugin PUBLIC scene_surface_mesh_item) polyhedron_demo_plugin(corefinement_plugin Corefinement_plugin KEYWORDS PMP) target_link_libraries(corefinement_plugin PUBLIC scene_surface_mesh_item) -polyhedron_demo_plugin(surface_intersection_plugin Surface_intersection_plugin KEYWORDS PMP) -target_link_libraries(surface_intersection_plugin PUBLIC scene_surface_mesh_item scene_polylines_item scene_points_with_normal_item) +polyhedron_demo_plugin(surface_intersection_plugin Surface_intersection_plugin + KEYWORDS PMP) +target_link_libraries( + surface_intersection_plugin + PUBLIC scene_surface_mesh_item scene_polylines_item + scene_points_with_normal_item) -qt5_wrap_ui( repairUI_FILES RemoveNeedlesDialog.ui) -polyhedron_demo_plugin(repair_polyhedron_plugin Repair_polyhedron_plugin ${repairUI_FILES} KEYWORDS PMP) +qt5_wrap_ui(repairUI_FILES RemoveNeedlesDialog.ui) +polyhedron_demo_plugin(repair_polyhedron_plugin Repair_polyhedron_plugin + ${repairUI_FILES} KEYWORDS PMP) target_link_libraries(repair_polyhedron_plugin PUBLIC scene_surface_mesh_item) -qt5_wrap_ui( isotropicRemeshingUI_FILES Isotropic_remeshing_dialog.ui) -polyhedron_demo_plugin(isotropic_remeshing_plugin Isotropic_remeshing_plugin ${isotropicRemeshingUI_FILES} KEYWORDS PMP) -target_link_libraries(isotropic_remeshing_plugin PUBLIC scene_surface_mesh_item scene_selection_item) +qt5_wrap_ui(isotropicRemeshingUI_FILES Isotropic_remeshing_dialog.ui) +polyhedron_demo_plugin(isotropic_remeshing_plugin Isotropic_remeshing_plugin + ${isotropicRemeshingUI_FILES} KEYWORDS PMP) +target_link_libraries(isotropic_remeshing_plugin PUBLIC scene_surface_mesh_item + scene_selection_item) if(TARGET CGAL::TBB_support) target_link_libraries(isotropic_remeshing_plugin PUBLIC CGAL::TBB_support) endif() polyhedron_demo_plugin(distance_plugin Distance_plugin KEYWORDS PMP) -target_link_libraries(distance_plugin PUBLIC scene_surface_mesh_item scene_color_ramp) +target_link_libraries(distance_plugin PUBLIC scene_surface_mesh_item + scene_color_ramp) if(TARGET CGAL::TBB_support) target_link_libraries(distance_plugin PUBLIC CGAL::TBB_support) endif() -polyhedron_demo_plugin(detect_sharp_edges_plugin Detect_sharp_edges_plugin KEYWORDS IO Mesh_3 PMP) +polyhedron_demo_plugin(detect_sharp_edges_plugin Detect_sharp_edges_plugin + KEYWORDS IO Mesh_3 PMP) target_link_libraries(detect_sharp_edges_plugin PUBLIC scene_surface_mesh_item) -qt5_wrap_ui( randomPerturbationUI_FILES Random_perturbation_dialog.ui) -polyhedron_demo_plugin(random_perturbation_plugin Random_perturbation_plugin ${randomPerturbationUI_FILES} KEYWORDS PMP) -target_link_libraries(random_perturbation_plugin PUBLIC scene_surface_mesh_item scene_selection_item) +qt5_wrap_ui(randomPerturbationUI_FILES Random_perturbation_dialog.ui) +polyhedron_demo_plugin(random_perturbation_plugin Random_perturbation_plugin + ${randomPerturbationUI_FILES} KEYWORDS PMP) +target_link_libraries(random_perturbation_plugin PUBLIC scene_surface_mesh_item + scene_selection_item) -polyhedron_demo_plugin(degenerated_faces_plugin Degenerated_faces_plugin KEYWORDS PMP) -target_link_libraries(degenerated_faces_plugin PUBLIC scene_surface_mesh_item scene_selection_item) +polyhedron_demo_plugin(degenerated_faces_plugin Degenerated_faces_plugin + KEYWORDS PMP) +target_link_libraries(degenerated_faces_plugin PUBLIC scene_surface_mesh_item + scene_selection_item) -qt5_wrap_ui( engravUI_FILES Engrave_dock_widget.ui ) -polyhedron_demo_plugin(engrave_text_plugin Engrave_text_plugin ${engravUI_FILES}) -target_link_libraries(engrave_text_plugin PUBLIC scene_surface_mesh_item scene_selection_item scene_polylines_item) +qt5_wrap_ui(engravUI_FILES Engrave_dock_widget.ui) +polyhedron_demo_plugin(engrave_text_plugin Engrave_text_plugin + ${engravUI_FILES}) +target_link_libraries( + engrave_text_plugin PUBLIC scene_surface_mesh_item scene_selection_item + scene_polylines_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt index a1ec1dec229..ad05661274e 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt @@ -1,134 +1,252 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) if(TARGET CGAL::Eigen_support) find_package(SCIP QUIET) + + set_package_properties( + SCIP PROPERTIES + DESCRIPTION "A solver." + PURPOSE + "Can be used as a solver in the surface_reconstruction_plugin plugin.") + include(CGAL_SCIP_support) if(NOT TARGET CGAL::SCIP_support) find_package(GLPK QUIET) + + set_package_properties( + GLPK PROPERTIES + DESCRIPTION "An alternative for SCIP." + PURPOSE + "Can be used as a solver in the surface_reconstruction_plugin plugin.") + include(CGAL_GLPK_support) endif() if(NOT TARGET CGAL::SCIP_support AND NOT TARGET CGAL::GLPK_support) - message(STATUS "NOTICE: SCIP and GLPK were not found. Polygonal surface reconstruction will not be available.") + message( + STATUS + "NOTICE: SCIP and GLPK were not found. Polygonal surface reconstruction will not be available." + ) endif() - qt5_wrap_ui( surface_reconstructionUI_FILES Surface_reconstruction_plugin.ui) - polyhedron_demo_plugin(surface_reconstruction_plugin Surface_reconstruction_plugin Surface_reconstruction_poisson_impl Surface_reconstruction_advancing_front_impl Surface_reconstruction_scale_space_impl Surface_reconstruction_polygonal_impl ${surface_reconstructionUI_FILES} KEYWORDS PointSetProcessing) - target_link_libraries(surface_reconstruction_plugin PUBLIC scene_polygon_soup_item scene_surface_mesh_item scene_points_with_normal_item CGAL::Eigen_support) + qt5_wrap_ui(surface_reconstructionUI_FILES Surface_reconstruction_plugin.ui) + polyhedron_demo_plugin( + surface_reconstruction_plugin + Surface_reconstruction_plugin + Surface_reconstruction_poisson_impl + Surface_reconstruction_advancing_front_impl + Surface_reconstruction_scale_space_impl + Surface_reconstruction_polygonal_impl + ${surface_reconstructionUI_FILES} + KEYWORDS + PointSetProcessing) + target_link_libraries( + surface_reconstruction_plugin + PUBLIC scene_polygon_soup_item scene_surface_mesh_item + scene_points_with_normal_item CGAL::Eigen_support) - if (TARGET CGAL::SCIP_support) - target_link_libraries(surface_reconstruction_plugin PUBLIC CGAL::SCIP_support) + if(TARGET CGAL::SCIP_support) + target_link_libraries(surface_reconstruction_plugin + PUBLIC CGAL::SCIP_support) elseif(TARGET CGAL::GLPK_support) - target_link_libraries(surface_reconstruction_plugin PUBLIC CGAL::GLPK_support) + target_link_libraries(surface_reconstruction_plugin + PUBLIC CGAL::GLPK_support) endif() - qt5_wrap_ui( point_set_normal_estimationUI_FILES Point_set_normal_estimation_plugin.ui) - polyhedron_demo_plugin(point_set_normal_estimation_plugin Point_set_normal_estimation_plugin ${point_set_normal_estimationUI_FILES} KEYWORDS PointSetProcessing Classification) - target_link_libraries(point_set_normal_estimation_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler CGAL::Eigen_support) + qt5_wrap_ui(point_set_normal_estimationUI_FILES + Point_set_normal_estimation_plugin.ui) + polyhedron_demo_plugin( + point_set_normal_estimation_plugin Point_set_normal_estimation_plugin + ${point_set_normal_estimationUI_FILES} KEYWORDS PointSetProcessing + Classification) + target_link_libraries( + point_set_normal_estimation_plugin + PUBLIC scene_points_with_normal_item scene_callback_signaler + CGAL::Eigen_support) - qt5_wrap_ui( features_detection_pluginUI_FILES Features_detection_plugin.ui) - polyhedron_demo_plugin(features_detection_plugin Features_detection_plugin ${features_detection_pluginUI_FILES} KEYWORDS PointSetProcessing) - target_link_libraries(features_detection_plugin PUBLIC scene_points_with_normal_item CGAL::Eigen_support) + qt5_wrap_ui(features_detection_pluginUI_FILES Features_detection_plugin.ui) + polyhedron_demo_plugin( + features_detection_plugin Features_detection_plugin + ${features_detection_pluginUI_FILES} KEYWORDS PointSetProcessing) + target_link_libraries( + features_detection_plugin PUBLIC scene_points_with_normal_item + CGAL::Eigen_support) - polyhedron_demo_plugin(point_set_smoothing_plugin Point_set_smoothing_plugin KEYWORDS PointSetProcessing) - target_link_libraries(point_set_smoothing_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler CGAL::Eigen_support) + polyhedron_demo_plugin(point_set_smoothing_plugin Point_set_smoothing_plugin + KEYWORDS PointSetProcessing) + target_link_libraries( + point_set_smoothing_plugin + PUBLIC scene_points_with_normal_item scene_callback_signaler + CGAL::Eigen_support) - polyhedron_demo_plugin(point_set_average_spacing_plugin Point_set_average_spacing_plugin KEYWORDS PointSetProcessing Classification) - target_link_libraries(point_set_average_spacing_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler CGAL::Eigen_support) + polyhedron_demo_plugin( + point_set_average_spacing_plugin Point_set_average_spacing_plugin KEYWORDS + PointSetProcessing Classification) + target_link_libraries( + point_set_average_spacing_plugin + PUBLIC scene_points_with_normal_item scene_callback_signaler + CGAL::Eigen_support) - qt5_wrap_ui(point_set_shape_detectionUI_FILES Point_set_shape_detection_plugin.ui) - polyhedron_demo_plugin(point_set_shape_detection_plugin Point_set_shape_detection_plugin ${point_set_shape_detectionUI_FILES} KEYWORDS PointSetProcessing Classification) - target_link_libraries(point_set_shape_detection_plugin PUBLIC scene_surface_mesh_item scene_points_with_normal_item scene_polygon_soup_item scene_callback_signaler CGAL::Eigen_support) + qt5_wrap_ui(point_set_shape_detectionUI_FILES + Point_set_shape_detection_plugin.ui) + polyhedron_demo_plugin( + point_set_shape_detection_plugin Point_set_shape_detection_plugin + ${point_set_shape_detectionUI_FILES} KEYWORDS PointSetProcessing + Classification) + target_link_libraries( + point_set_shape_detection_plugin + PUBLIC scene_surface_mesh_item scene_points_with_normal_item + scene_polygon_soup_item scene_callback_signaler CGAL::Eigen_support) find_package(OpenGR QUIET) include(CGAL_OpenGR_support) find_package(libpointmatcher QUIET) include(CGAL_pointmatcher_support) - if (TARGET CGAL::OpenGR_support OR CGAL::pointmatcher_support) + if(TARGET CGAL::OpenGR_support OR CGAL::pointmatcher_support) qt5_wrap_ui(register_point_setsUI_FILES Register_point_sets_plugin.ui) - polyhedron_demo_plugin(register_point_sets_plugin Register_point_sets_plugin ${register_point_setsUI_FILES} KEYWORDS PointSetProcessing) - target_link_libraries(register_point_sets_plugin PUBLIC scene_points_with_normal_item) + polyhedron_demo_plugin( + register_point_sets_plugin Register_point_sets_plugin + ${register_point_setsUI_FILES} KEYWORDS PointSetProcessing) + target_link_libraries(register_point_sets_plugin + PUBLIC scene_points_with_normal_item) target_link_libraries(register_point_sets_plugin PUBLIC CGAL::Eigen_support) - if (TARGET CGAL::OpenGR_support) - target_link_libraries(register_point_sets_plugin PUBLIC CGAL::OpenGR_support) + if(TARGET CGAL::OpenGR_support) + target_link_libraries(register_point_sets_plugin + PUBLIC CGAL::OpenGR_support) endif() - if (TARGET CGAL::pointmatcher_support) - target_link_libraries(register_point_sets_plugin PUBLIC CGAL::pointmatcher_support) + if(TARGET CGAL::pointmatcher_support) + target_link_libraries(register_point_sets_plugin + PUBLIC CGAL::pointmatcher_support) endif() else() - message(STATUS "NOTICE: OpenGR and libpointmatcher were not found. Registration plugin will not be available.") + message( + STATUS + "NOTICE: OpenGR and libpointmatcher were not found. Registration plugin will not be available." + ) endif() else(EIGEN3_FOUND) - message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Surface reconstruction plugin will not be available.") - message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Normal estimation plugins will not be available.") - message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Smoothing plugin will not be available.") - message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Average spacing plugin will not be available.") - message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. Feature detection plugin will not be available.") + message( + STATUS + "NOTICE: Eigen 3.1 (or greater) was not found. Surface reconstruction plugin will not be available." + ) + message( + STATUS + "NOTICE: Eigen 3.1 (or greater) was not found. Normal estimation plugins will not be available." + ) + message( + STATUS + "NOTICE: Eigen 3.1 (or greater) was not found. Smoothing plugin will not be available." + ) + message( + STATUS + "NOTICE: Eigen 3.1 (or greater) was not found. Average spacing plugin will not be available." + ) + message( + STATUS + "NOTICE: Eigen 3.1 (or greater) was not found. Feature detection plugin will not be available." + ) endif() - qt5_wrap_ui(point_set_bilateral_smoothingUI_FILES Point_set_bilateral_smoothing_plugin.ui) - polyhedron_demo_plugin(point_set_bilateral_smoothing_plugin Point_set_bilateral_smoothing_plugin ${point_set_bilateral_smoothingUI_FILES} KEYWORDS PointSetProcessing) - target_link_libraries(point_set_bilateral_smoothing_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler) +qt5_wrap_ui(point_set_bilateral_smoothingUI_FILES + Point_set_bilateral_smoothing_plugin.ui) +polyhedron_demo_plugin( + point_set_bilateral_smoothing_plugin Point_set_bilateral_smoothing_plugin + ${point_set_bilateral_smoothingUI_FILES} KEYWORDS PointSetProcessing) +target_link_libraries( + point_set_bilateral_smoothing_plugin PUBLIC scene_points_with_normal_item + scene_callback_signaler) - qt5_wrap_ui( ps_outliers_removal_UI_FILES Point_set_outliers_removal_plugin.ui) - polyhedron_demo_plugin(point_set_outliers_removal_plugin Point_set_outliers_removal_plugin ${ps_outliers_removal_UI_FILES} KEYWORDS PointSetProcessing) - target_link_libraries(point_set_outliers_removal_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler) +qt5_wrap_ui(ps_outliers_removal_UI_FILES Point_set_outliers_removal_plugin.ui) +polyhedron_demo_plugin( + point_set_outliers_removal_plugin Point_set_outliers_removal_plugin + ${ps_outliers_removal_UI_FILES} KEYWORDS PointSetProcessing) +target_link_libraries( + point_set_outliers_removal_plugin PUBLIC scene_points_with_normal_item + scene_callback_signaler) - qt5_wrap_ui( point_set_selectionUI_FILES Point_set_selection_widget.ui) - polyhedron_demo_plugin(point_set_selection_plugin Point_set_selection_plugin ${point_set_selectionUI_FILES} KEYWORDS PointSetProcessing Classification) - target_link_libraries(point_set_selection_plugin PUBLIC scene_points_with_normal_item scene_polylines_item scene_edit_box_item) +qt5_wrap_ui(point_set_selectionUI_FILES Point_set_selection_widget.ui) +polyhedron_demo_plugin( + point_set_selection_plugin Point_set_selection_plugin + ${point_set_selectionUI_FILES} KEYWORDS PointSetProcessing Classification) +target_link_libraries( + point_set_selection_plugin PUBLIC scene_points_with_normal_item + scene_polylines_item scene_edit_box_item) - qt5_wrap_ui(point_set_simplificationUI_FILES Point_set_simplification_plugin.ui) - polyhedron_demo_plugin(point_set_simplification_plugin Point_set_simplification_plugin ${point_set_simplificationUI_FILES} KEYWORDS PointSetProcessing) - target_link_libraries(point_set_simplification_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler) +qt5_wrap_ui(point_set_simplificationUI_FILES Point_set_simplification_plugin.ui) +polyhedron_demo_plugin( + point_set_simplification_plugin Point_set_simplification_plugin + ${point_set_simplificationUI_FILES} KEYWORDS PointSetProcessing) +target_link_libraries( + point_set_simplification_plugin PUBLIC scene_points_with_normal_item + scene_callback_signaler) - qt5_wrap_ui(point_set_upsamplingUI_FILES Point_set_upsampling_plugin.ui) - polyhedron_demo_plugin(point_set_upsampling_plugin Point_set_upsampling_plugin ${point_set_upsamplingUI_FILES} KEYWORDS PointSetProcessing) - target_link_libraries(point_set_upsampling_plugin PUBLIC scene_points_with_normal_item) +qt5_wrap_ui(point_set_upsamplingUI_FILES Point_set_upsampling_plugin.ui) +polyhedron_demo_plugin( + point_set_upsampling_plugin Point_set_upsampling_plugin + ${point_set_upsamplingUI_FILES} KEYWORDS PointSetProcessing) +target_link_libraries(point_set_upsampling_plugin + PUBLIC scene_points_with_normal_item) - qt5_wrap_ui(point_set_wlopFILES Point_set_wlop_plugin.ui) - polyhedron_demo_plugin(point_set_wlop_plugin Point_set_wlop_plugin ${point_set_wlopFILES} KEYWORDS PointSetProcessing) - target_link_libraries(point_set_wlop_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler) +qt5_wrap_ui(point_set_wlopFILES Point_set_wlop_plugin.ui) +polyhedron_demo_plugin(point_set_wlop_plugin Point_set_wlop_plugin + ${point_set_wlopFILES} KEYWORDS PointSetProcessing) +target_link_libraries(point_set_wlop_plugin PUBLIC scene_points_with_normal_item + scene_callback_signaler) - polyhedron_demo_plugin(point_set_clustering_plugin Point_set_clustering_plugin KEYWORDS PointSetProcessing) - target_link_libraries(point_set_clustering_plugin PUBLIC scene_points_with_normal_item scene_callback_signaler) +polyhedron_demo_plugin(point_set_clustering_plugin Point_set_clustering_plugin + KEYWORDS PointSetProcessing) +target_link_libraries( + point_set_clustering_plugin PUBLIC scene_points_with_normal_item + scene_callback_signaler) - polyhedron_demo_plugin(merge_point_sets_plugin Merge_point_sets_plugin KEYWORDS PointSetProcessing Classification) - target_link_libraries(merge_point_sets_plugin PUBLIC scene_points_with_normal_item) +polyhedron_demo_plugin(merge_point_sets_plugin Merge_point_sets_plugin KEYWORDS + PointSetProcessing Classification) +target_link_libraries(merge_point_sets_plugin + PUBLIC scene_points_with_normal_item) - polyhedron_demo_plugin(point_set_interference_plugin Point_set_interference_plugin KEYWORDS PointSetProcessing) - target_link_libraries(point_set_interference_plugin PUBLIC scene_points_with_normal_item) +polyhedron_demo_plugin( + point_set_interference_plugin Point_set_interference_plugin KEYWORDS + PointSetProcessing) +target_link_libraries(point_set_interference_plugin + PUBLIC scene_points_with_normal_item) - qt5_wrap_ui( alpha_shapeUI_FILES Alpha_shape_widget.ui ) - polyhedron_demo_plugin(alpha_shape_plugin Alpha_shape_plugin ${alpha_shapeUI_FILES} KEYWORDS PointSetProcessing) - target_link_libraries(alpha_shape_plugin PUBLIC scene_points_with_normal_item scene_c3t3_item) +qt5_wrap_ui(alpha_shapeUI_FILES Alpha_shape_widget.ui) +polyhedron_demo_plugin(alpha_shape_plugin Alpha_shape_plugin + ${alpha_shapeUI_FILES} KEYWORDS PointSetProcessing) +target_link_libraries(alpha_shape_plugin PUBLIC scene_points_with_normal_item + scene_c3t3_item) - qt5_wrap_ui( distanceUI_FILES Point_set_to_mesh_distance_widget.ui ) - polyhedron_demo_plugin(point_set_to_mesh_distance_plugin Point_set_to_mesh_distance_plugin ${distanceUI_FILES} KEYWORDS PointSetProcessing) - target_link_libraries(point_set_to_mesh_distance_plugin PUBLIC scene_points_with_normal_item scene_surface_mesh_item scene_color_ramp) +qt5_wrap_ui(distanceUI_FILES Point_set_to_mesh_distance_widget.ui) +polyhedron_demo_plugin( + point_set_to_mesh_distance_plugin Point_set_to_mesh_distance_plugin + ${distanceUI_FILES} KEYWORDS PointSetProcessing) +target_link_libraries( + point_set_to_mesh_distance_plugin + PUBLIC scene_points_with_normal_item scene_surface_mesh_item scene_color_ramp) - if(TARGET CGAL::TBB_support) - foreach(plugin - surface_reconstruction_plugin - point_set_normal_estimation_plugin - features_detection_plugin - point_set_smoothing_plugin - point_set_average_spacing_plugin - point_set_shape_detection_plugin - point_set_bilateral_smoothing_plugin - point_set_outliers_removal_plugin - point_set_selection_plugin - point_set_simplification_plugin - point_set_upsampling_plugin - point_set_wlop_plugin - merge_point_sets_plugin - point_set_interference_plugin - alpha_shape_plugin - point_set_to_mesh_distance_plugin) - if(TARGET ${plugin}) - target_link_libraries(${plugin} PUBLIC CGAL::TBB_support) - endif() - endforeach() - endif() +if(TARGET CGAL::TBB_support) + foreach( + plugin + surface_reconstruction_plugin + point_set_normal_estimation_plugin + features_detection_plugin + point_set_smoothing_plugin + point_set_average_spacing_plugin + point_set_shape_detection_plugin + point_set_bilateral_smoothing_plugin + point_set_outliers_removal_plugin + point_set_selection_plugin + point_set_simplification_plugin + point_set_upsampling_plugin + point_set_wlop_plugin + merge_point_sets_plugin + point_set_interference_plugin + alpha_shape_plugin + point_set_to_mesh_distance_plugin) + if(TARGET ${plugin}) + target_link_libraries(${plugin} PUBLIC CGAL::TBB_support) + endif() + endforeach() +endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/CMakeLists.txt index 2c780cd68b3..ff1ff484cde 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Subdivision_methods/CMakeLists.txt @@ -1,5 +1,4 @@ -include( polyhedron_demo_macros ) - +include(polyhedron_demo_macros) polyhedron_demo_plugin(subdivision_methods_plugin Subdivision_methods_plugin) target_link_libraries(subdivision_methods_plugin PUBLIC scene_surface_mesh_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt index 45c1eccb50e..d256ff724d2 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt @@ -1,36 +1,49 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() if(TARGET CGAL::Eigen_support) - find_package(CGAL COMPONENTS Core) + find_package(CGAL REQUIRED COMPONENTS Core) include(${CGAL_USE_FILE}) qt5_wrap_ui(parameterizationUI_FILES Parameterization_widget.ui OTE_dialog.ui) - polyhedron_demo_plugin(parameterization_plugin Parameterization_plugin ${parameterizationUI_FILES}) - target_link_libraries(parameterization_plugin PUBLIC scene_surface_mesh_item scene_textured_item scene_selection_item CGAL::Eigen_support) + polyhedron_demo_plugin(parameterization_plugin Parameterization_plugin + ${parameterizationUI_FILES}) + target_link_libraries( + parameterization_plugin PUBLIC scene_surface_mesh_item scene_textured_item + scene_selection_item CGAL::Eigen_support) else() - message(STATUS "NOTICE: Eigen 3.1 (or greater) was not found. The Parameterization plugin will not be available.") + message( + STATUS + "NOTICE: Eigen 3.1 (or greater) was not found. The Parameterization plugin will not be available." + ) endif() -qt5_wrap_ui( segmentationUI_FILES Mesh_segmentation_widget.ui) -polyhedron_demo_plugin(mesh_segmentation_plugin Mesh_segmentation_plugin ${segmentationUI_FILES}) +qt5_wrap_ui(segmentationUI_FILES Mesh_segmentation_widget.ui) +polyhedron_demo_plugin(mesh_segmentation_plugin Mesh_segmentation_plugin + ${segmentationUI_FILES}) target_link_libraries(mesh_segmentation_plugin PUBLIC scene_surface_mesh_item) -qt5_wrap_ui( mesh_plane_detectionUI_FILES Mesh_plane_detection_dialog.ui) -polyhedron_demo_plugin(mesh_plane_detection_plugin Mesh_plane_detection_plugin ${mesh_plane_detectionUI_FILES}) -target_link_libraries(mesh_plane_detection_plugin PUBLIC scene_surface_mesh_item) +qt5_wrap_ui(mesh_plane_detectionUI_FILES Mesh_plane_detection_dialog.ui) +polyhedron_demo_plugin(mesh_plane_detection_plugin Mesh_plane_detection_plugin + ${mesh_plane_detectionUI_FILES}) +target_link_libraries(mesh_plane_detection_plugin + PUBLIC scene_surface_mesh_item) -qt5_wrap_ui( mesh_simplificationUI_FILES Mesh_simplification_dialog.ui) -polyhedron_demo_plugin(mesh_simplification_plugin Mesh_simplification_plugin ${mesh_simplificationUI_FILES}) -target_link_libraries(mesh_simplification_plugin PUBLIC scene_surface_mesh_item scene_selection_item) +qt5_wrap_ui(mesh_simplificationUI_FILES Mesh_simplification_dialog.ui) +polyhedron_demo_plugin(mesh_simplification_plugin Mesh_simplification_plugin + ${mesh_simplificationUI_FILES}) +target_link_libraries(mesh_simplification_plugin PUBLIC scene_surface_mesh_item + scene_selection_item) -qt5_wrap_ui( remeshingUI_FILES Remeshing_dialog.ui) -polyhedron_demo_plugin(offset_meshing_plugin Offset_meshing_plugin ${remeshingUI_FILES}) -target_link_libraries(offset_meshing_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item) +qt5_wrap_ui(remeshingUI_FILES Remeshing_dialog.ui) +polyhedron_demo_plugin(offset_meshing_plugin Offset_meshing_plugin + ${remeshingUI_FILES}) +target_link_libraries(offset_meshing_plugin PUBLIC scene_surface_mesh_item + scene_polygon_soup_item) if(TARGET CGAL::Eigen_support) target_link_libraries(offset_meshing_plugin PUBLIC CGAL::Eigen_support) endif() @@ -38,17 +51,17 @@ if(TARGET CGAL::TBB_support) target_link_libraries(offset_meshing_plugin PUBLIC CGAL::TBB_support) endif() -qt5_wrap_ui( shortestPathUI_FILES Shortest_path_widget.ui ) -polyhedron_demo_plugin(shortest_path_plugin Shortest_path_plugin ${shortestPathUI_FILES}) -target_link_libraries(shortest_path_plugin PUBLIC scene_surface_mesh_item scene_shortest_path_item scene_basic_objects) +qt5_wrap_ui(shortestPathUI_FILES Shortest_path_widget.ui) +polyhedron_demo_plugin(shortest_path_plugin Shortest_path_plugin + ${shortestPathUI_FILES}) +target_link_libraries( + shortest_path_plugin PUBLIC scene_surface_mesh_item scene_shortest_path_item + scene_basic_objects) qt5_wrap_ui(basicUI_FILES Surface_mesh_approximation_dockwidget.ui) -polyhedron_demo_plugin(surface_mesh_approximation_plugin - Surface_mesh_approximation_plugin - ${basicUI_FILES} - VSA_wrapper) -target_link_libraries(surface_mesh_approximation_plugin - PUBLIC - scene_surface_mesh_item - scene_polygon_soup_item - scene_polylines_item) +polyhedron_demo_plugin( + surface_mesh_approximation_plugin Surface_mesh_approximation_plugin + ${basicUI_FILES} VSA_wrapper) +target_link_libraries( + surface_mesh_approximation_plugin + PUBLIC scene_surface_mesh_item scene_polygon_soup_item scene_polylines_item) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt index 6311d46279e..b32cf6f7d7a 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt @@ -1,8 +1,12 @@ -include( polyhedron_demo_macros ) -if ( EIGEN3_FOUND AND "${EIGEN3_VERSION}" VERSION_GREATER "3.1.90" ) +include(polyhedron_demo_macros) +if(EIGEN3_FOUND AND "${EIGEN3_VERSION}" VERSION_GREATER "3.1.90") polyhedron_demo_plugin(edit_plugin Edit_polyhedron_plugin Deform_mesh.ui) - target_link_libraries(edit_plugin PUBLIC scene_surface_mesh_item scene_edit_item scene_selection_item) + target_link_libraries(edit_plugin PUBLIC scene_surface_mesh_item + scene_edit_item scene_selection_item) else() - message(STATUS "NOTICE: The polyhedron edit plugin require Eigen 3.2 (or higher) and will not be available.") + message( + STATUS + "NOTICE: The polyhedron edit plugin require Eigen 3.2 (or higher) and will not be available." + ) endif() diff --git a/Polyhedron/demo/Polyhedron/Plugins/Tetrahedral_remeshing/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Tetrahedral_remeshing/CMakeLists.txt index 6b018456711..a7547b6e19c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Tetrahedral_remeshing/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Tetrahedral_remeshing/CMakeLists.txt @@ -1,12 +1,15 @@ -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) remove_definitions(-DQT_STATICPLUGIN) -qt5_wrap_cpp( VOLUME_MOC_OUTFILES ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_thread.h ) -qt5_wrap_cpp( VOLUME_MOC_OUTFILES ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_interface.h ) +qt5_wrap_cpp(VOLUME_MOC_OUTFILES + ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_thread.h) +qt5_wrap_cpp(VOLUME_MOC_OUTFILES + ${CMAKE_CURRENT_SOURCE_DIR}/Volume_plane_interface.h) -qt5_wrap_ui( tetRemeshingUI_FILES Tetrahedral_remeshing_dialog.ui) -polyhedron_demo_plugin(tetrahedral_remeshing_plugin Tetrahedral_remeshing_plugin ${tetRemeshingUI_FILES} - KEYWORDS Tetrahedral_remeshing) -target_link_libraries(tetrahedral_remeshing_plugin - PUBLIC scene_c3t3_item ${OPENGL_gl_LIBRARY}) +qt5_wrap_ui(tetRemeshingUI_FILES Tetrahedral_remeshing_dialog.ui) +polyhedron_demo_plugin( + tetrahedral_remeshing_plugin Tetrahedral_remeshing_plugin + ${tetRemeshingUI_FILES} KEYWORDS Tetrahedral_remeshing) +target_link_libraries(tetrahedral_remeshing_plugin PUBLIC scene_c3t3_item + ${OPENGL_gl_LIBRARY}) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt index 439d4055a61..6cde165b88d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Three_examples ) +project(Three_examples) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -10,27 +10,27 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) #Find CGAL -find_package(CGAL COMPONENTS Qt5 ImageIO) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 ImageIO) # Find Qt5 itself -find_package(Qt5 - QUIET - COMPONENTS OpenGL Script Svg Xml - OPTIONAL_COMPONENTS ScriptTools WebSockets) +find_package( + Qt5 QUIET + COMPONENTS OpenGL Script Svg Xml + OPTIONAL_COMPONENTS ScriptTools WebSockets) if(RUNNING_CGAL_AUTO_TEST) - if(Qt5_FOUND AND CGAL_FOUND) + if(Qt5_FOUND) include(${CGAL_USE_FILE}) endif() polyhedron_demo_plugin(example_plugin Example_plugin) - qt5_wrap_ui( basicUI_FILES Basic_dialog.ui ) + qt5_wrap_ui(basicUI_FILES Basic_dialog.ui) polyhedron_demo_plugin(basic_plugin Basic_plugin ${basicUI_FILES}) - qt5_wrap_ui( dockUI_FILES Basic_dock_widget.ui ) + qt5_wrap_ui(dockUI_FILES Basic_dock_widget.ui) polyhedron_demo_plugin(dock_widget_plugin Dock_widget_plugin ${dockUI_FILES}) polyhedron_demo_plugin(basic_item_plugin Basic_item_plugin) -# links the library containing the scene_plane_item with the plugin + # links the library containing the scene_plane_item with the plugin target_link_libraries(basic_item_plugin PUBLIC scene_basic_objects) endif() diff --git a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt index 2cd61db191a..4d84a65f7e1 100644 --- a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1...3.15) -include( polyhedron_demo_macros ) +include(polyhedron_demo_macros) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -17,18 +17,17 @@ endif() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") # Include directory of demo includes -include_directories( BEFORE ${Mesh_3_implicit_functions_BINARY_DIR} ../include ) +include_directories(BEFORE ${Mesh_3_implicit_functions_BINARY_DIR} ../include) # Find CGAL and CGAL Qt5 -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) # Find Qt5 itself -set( QT_USE_QTXML TRUE ) -set( QT_USE_QTMAIN TRUE ) -set( QT_USE_QTSCRIPT TRUE ) -set( QT_USE_QTOPENGL TRUE ) -find_package(Qt5 QUIET COMPONENTS Script OpenGL ScriptTools ) - +set(QT_USE_QTXML TRUE) +set(QT_USE_QTMAIN TRUE) +set(QT_USE_QTSCRIPT TRUE) +set(QT_USE_QTOPENGL TRUE) +find_package(Qt5 QUIET COMPONENTS Script OpenGL ScriptTools) if(CGAL_Qt5_FOUND AND Qt5_FOUND) # put plugins (which are shared libraries) at the same location as @@ -41,11 +40,14 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) include(AddFileDependencies) remove_definitions(-DQT_STATICPLUGIN) - polyhedron_demo_plugin(p_sphere_function_plugin Sphere_implicit_function KEYWORDS Mesh_3) - polyhedron_demo_plugin(p_tanglecube_function_plugin Tanglecube_implicit_function KEYWORDS Mesh_3) - polyhedron_demo_plugin(p_klein_function_plugin Klein_implicit_function KEYWORDS Mesh_3) + polyhedron_demo_plugin(p_sphere_function_plugin Sphere_implicit_function + KEYWORDS Mesh_3) + polyhedron_demo_plugin(p_tanglecube_function_plugin + Tanglecube_implicit_function KEYWORDS Mesh_3) + polyhedron_demo_plugin(p_klein_function_plugin Klein_implicit_function + KEYWORDS Mesh_3) -else (CGAL_Qt5_FOUND AND Qt5_FOUND) +else(CGAL_Qt5_FOUND AND Qt5_FOUND) set(MESH_3_MISSING_DEPS "") @@ -57,6 +59,9 @@ else (CGAL_Qt5_FOUND AND Qt5_FOUND) set(MESH_3_MISSING_DEPS "Qt5, ${MESH_3_MISSING_DEPS}") endif() - message(STATUS "NOTICE: This demo requires ${MESH_3_MISSING_DEPS}and will not be compiled.") + message( + STATUS + "NOTICE: This demo requires ${MESH_3_MISSING_DEPS}and will not be compiled." + ) -endif (CGAL_Qt5_FOUND AND Qt5_FOUND) +endif(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Polyhedron/examples/Polyhedron/CMakeLists.txt b/Polyhedron/examples/Polyhedron/CMakeLists.txt index 1fcc9b5c5dd..1a198cd7c69 100644 --- a/Polyhedron/examples/Polyhedron/CMakeLists.txt +++ b/Polyhedron/examples/Polyhedron/CMakeLists.txt @@ -1,10 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polyhedron_Examples ) - +project(Polyhedron_Examples) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -15,27 +13,21 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - if(CGAL_Qt5_FOUND ) - target_link_libraries(draw_polyhedron PUBLIC CGAL::CGAL_Qt5) - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +if(CGAL_Qt5_FOUND) + target_link_libraries(draw_polyhedron PUBLIC CGAL::CGAL_Qt5) endif() - diff --git a/Polyhedron/test/Polyhedron/CMakeLists.txt b/Polyhedron/test/Polyhedron/CMakeLists.txt index 2099abbe8e2..56cf79325a7 100644 --- a/Polyhedron/test/Polyhedron/CMakeLists.txt +++ b/Polyhedron/test/Polyhedron/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polyhedron_Tests ) +project(Polyhedron_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Polyhedron_IO/demo/Polyhedron_IO/CMakeLists.txt b/Polyhedron_IO/demo/Polyhedron_IO/CMakeLists.txt index 0a15031b813..e24a43f7d06 100644 --- a/Polyhedron_IO/demo/Polyhedron_IO/CMakeLists.txt +++ b/Polyhedron_IO/demo/Polyhedron_IO/CMakeLists.txt @@ -1,9 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polyhedron_IO_Demo ) +project(Polyhedron_IO_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,16 +11,7 @@ endif() set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "geomview_demo.cpp" ) - create_single_source_cgal_program( "viewpoint2off.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +find_package(CGAL REQUIRED) +create_single_source_cgal_program("geomview_demo.cpp") +create_single_source_cgal_program("viewpoint2off.cpp") diff --git a/Polyhedron_IO/examples/Polyhedron_IO/CMakeLists.txt b/Polyhedron_IO/examples/Polyhedron_IO/CMakeLists.txt index 142798b8630..26eb29c4d98 100644 --- a/Polyhedron_IO/examples/Polyhedron_IO/CMakeLists.txt +++ b/Polyhedron_IO/examples/Polyhedron_IO/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polyhedron_IO_Examples ) +project(Polyhedron_IO_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Polyhedron_IO/test/Polyhedron_IO/CMakeLists.txt b/Polyhedron_IO/test/Polyhedron_IO/CMakeLists.txt index 077eb666af5..6873f9ee904 100644 --- a/Polyhedron_IO/test/Polyhedron_IO/CMakeLists.txt +++ b/Polyhedron_IO/test/Polyhedron_IO/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polyhedron_IO_Tests ) +project(Polyhedron_IO_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt index 8d05659de66..65c33cb6436 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Polyline_simplification_2_Demo) +project(Polyline_simplification_2_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -13,38 +13,42 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) set(CMAKE_INCLUDE_CURRENT_DIR ON) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Widgets Svg) -include_directories (BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_AUTOMOC ON) -add_definitions(-DQT_NO_KEYWORDS) + add_definitions(-DQT_NO_KEYWORDS) + # UI files (Qt Designer files) + qt5_wrap_ui(CDT_UI_FILES Polyline_simplification_2.ui) -# UI files (Qt Designer files) -qt5_wrap_ui( CDT_UI_FILES Polyline_simplification_2.ui ) + # qrc files (resources files, that contain icons, at least) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.qrc) -# qrc files (resources files, that contain icons, at least) -qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.qrc ) + # The executable itself. + add_executable( + Polyline_simplification_2 + ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp ${CDT_UI_FILES} + ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -# The executable itself. -add_executable ( Polyline_simplification_2 ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + target_link_libraries(Polyline_simplification_2 + PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui) -target_link_libraries( Polyline_simplification_2 PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Polyline_simplification_2) -add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polyline_simplification_2 ) - -include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) -cgal_add_compilation_test(Polyline_simplification_2) + include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) + cgal_add_compilation_test(Polyline_simplification_2) else() - message(STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") + message( + STATUS "NOTICE: This demo requires CGAL and Qt5, and will not be compiled.") endif() diff --git a/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt index dc8a9e26139..c2c8893ae2e 100644 --- a/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/examples/Polyline_simplification_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polyline_simplification_2_Examples ) +project(Polyline_simplification_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt index 108065c6037..aa1da2e3362 100644 --- a/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/test/Polyline_simplification_2/CMakeLists.txt @@ -2,28 +2,18 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Polyline_simplification_2_Tests ) - - - - +project(Polyline_simplification_2_Tests) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost ) +find_package(Boost) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -36,8 +26,6 @@ endif() # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "simplify_polygon_test.cpp" ) - -create_single_source_cgal_program( "simplify_polyline_with_duplicate_points.cpp" ) - +create_single_source_cgal_program("simplify_polygon_test.cpp") +create_single_source_cgal_program("simplify_polyline_with_duplicate_points.cpp") diff --git a/Polynomial/examples/Polynomial/CMakeLists.txt b/Polynomial/examples/Polynomial/CMakeLists.txt index 1a67901a2e7..59e392720ad 100644 --- a/Polynomial/examples/Polynomial/CMakeLists.txt +++ b/Polynomial/examples/Polynomial/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polynomial_Examples ) +project(Polynomial_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Polynomial/test/Polynomial/CMakeLists.txt b/Polynomial/test/Polynomial/CMakeLists.txt index be516385934..28443d1507b 100644 --- a/Polynomial/test/Polynomial/CMakeLists.txt +++ b/Polynomial/test/Polynomial/CMakeLists.txt @@ -1,27 +1,19 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polynomial_Tests ) +project(Polynomial_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt b/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt index a2cd77d2d6a..9611ef36abf 100644 --- a/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt +++ b/Polytope_distance_d/examples/Polytope_distance_d/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polytope_distance_d_Examples ) +project(Polytope_distance_d_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt b/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt index e4b739727b2..44dda0702a0 100644 --- a/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt +++ b/Polytope_distance_d/test/Polytope_distance_d/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Polytope_distance_d_Tests ) +project(Polytope_distance_d_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt index fa25ad50bf6..d042796fba0 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt @@ -1,7 +1,7 @@ # This is the CMake script for compiling the PCA demo. cmake_minimum_required(VERSION 3.1...3.15) -project( Principal_component_analysis_Demo ) +project(Principal_component_analysis_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,50 +12,56 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() - -include_directories( ./ ) +include_directories(./) # Find CGAL and CGAL Qt5 -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "NOTICE: This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS + "NOTICE: This project requires the Eigen library, and will not be compiled." + ) return() endif() # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL) -if(CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) set(CMAKE_INCLUDE_CURRENT_DIR ON) - qt5_wrap_ui( UI_FILES MainWindow.ui ) + qt5_wrap_ui(UI_FILES MainWindow.ui) include(AddFileDependencies) - qt5_generate_moc( "MainWindow.h" "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" ) - add_file_dependencies( MainWindow_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.h" ) + qt5_generate_moc("MainWindow.h" + "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp") + add_file_dependencies(MainWindow_moc.cpp + "${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.h") - qt5_generate_moc( "Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" ) - add_file_dependencies( Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h" ) + qt5_generate_moc("Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp") + add_file_dependencies(Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h") - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES PCA_demo.qrc ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES PCA_demo.qrc) - add_file_dependencies( PCA_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" - "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" ) - add_executable ( PCA_demo PCA_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_file_dependencies( + PCA_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp") + add_executable(PCA_demo PCA_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES}) - target_link_libraries( PCA_demo PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 CGAL::Eigen_support Qt5::Gui) + target_link_libraries(PCA_demo PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 + CGAL::Eigen_support Qt5::Gui) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS PCA_demo ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS PCA_demo) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(PCA_demo) -else (CGAL_Qt5_FOUND AND Qt5_FOUND ) +else(CGAL_Qt5_FOUND AND Qt5_FOUND) set(PCA_MISSING_DEPS "") @@ -67,7 +73,9 @@ else (CGAL_Qt5_FOUND AND Qt5_FOUND ) set(PCA_MISSING_DEPS "Qt5, ${PCA_MISSING_DEPS}") endif() + message( + STATUS + "NOTICE: This demo requires ${PCA_MISSING_DEPS} and will not be compiled." + ) - message(STATUS "NOTICE: This demo requires ${PCA_MISSING_DEPS} and will not be compiled.") - -endif (CGAL_Qt5_FOUND AND Qt5_FOUND ) +endif(CGAL_Qt5_FOUND AND Qt5_FOUND) diff --git a/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt index c5955afe2b4..187bada3b77 100644 --- a/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/examples/Principal_component_analysis/CMakeLists.txt @@ -1,31 +1,24 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Principal_component_analysis_Examples ) +project(Principal_component_analysis_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +# Use Eigen +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) -if ( CGAL_FOUND ) - - # Use Eigen - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - if (TARGET CGAL::Eigen_support) - get_filename_component(target ${cppfile} NAME_WE) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endif() - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") + if(TARGET CGAL::Eigen_support) + get_filename_component(target ${cppfile} NAME_WE) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + endif() +endforeach() diff --git a/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt index 236ac02b1be..e8d85bd9a6e 100644 --- a/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/test/Principal_component_analysis/CMakeLists.txt @@ -1,31 +1,24 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Principal_component_analysis_Tests ) +project(Principal_component_analysis_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +# Use Eigen +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) -if ( CGAL_FOUND ) - - # Use Eigen - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - if (TARGET CGAL::Eigen_support) - get_filename_component(target ${cppfile} NAME_WE) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endif() - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") + if(TARGET CGAL::Eigen_support) + get_filename_component(target ${cppfile} NAME_WE) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + endif() +endforeach() diff --git a/Profiling_tools/examples/Profiling_tools/CMakeLists.txt b/Profiling_tools/examples/Profiling_tools/CMakeLists.txt index bddbf9fbb80..43bfb9cad16 100644 --- a/Profiling_tools/examples/Profiling_tools/CMakeLists.txt +++ b/Profiling_tools/examples/Profiling_tools/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Profiling_tools_Examples ) +project(Profiling_tools_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Profiling_tools/test/Profiling_tools/CMakeLists.txt b/Profiling_tools/test/Profiling_tools/CMakeLists.txt index 01bc5c13dd4..28320cf9390 100644 --- a/Profiling_tools/test/Profiling_tools/CMakeLists.txt +++ b/Profiling_tools/test/Profiling_tools/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Profiling_tools_Tests ) +project(Profiling_tools_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Property_map/examples/Property_map/CMakeLists.txt b/Property_map/examples/Property_map/CMakeLists.txt index 5d251def5cf..be6fba245bf 100644 --- a/Property_map/examples/Property_map/CMakeLists.txt +++ b/Property_map/examples/Property_map/CMakeLists.txt @@ -1,24 +1,16 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Property_map_Examples ) - - +project(Property_map_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -26,15 +18,14 @@ endif() # include for local directory - # Creating entries for all C++ files with "main" routine # ########################################################## -create_single_source_cgal_program( "dynamic_properties.cpp" ) +create_single_source_cgal_program("dynamic_properties.cpp") find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) include(CGAL_Eigen_support) -if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "custom_property_map.cpp" ) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("custom_property_map.cpp") target_link_libraries(custom_property_map PUBLIC CGAL::Eigen_support) endif() diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt index 5038a50bbb2..117a5b62ca6 100644 --- a/Property_map/test/Property_map/CMakeLists.txt +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -1,35 +1,26 @@ - cmake_minimum_required(VERSION 3.1...3.15) -project( Property_map_Tests ) - - +project(Property_map_Tests) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() -find_package( OpenMesh QUIET ) +find_package(OpenMesh QUIET) -if ( OpenMesh_FOUND ) - include( UseOpenMesh ) - add_definitions( -DCGAL_USE_OPENMESH ) +if(OpenMesh_FOUND) + include(UseOpenMesh) + add_definitions(-DCGAL_USE_OPENMESH) else() message(STATUS "Examples that use OpenMesh will not be compiled.") endif() @@ -41,15 +32,14 @@ endif() # Creating entries for all C++ files with "main" routine # ########################################################## -create_single_source_cgal_program( "test_property_map.cpp" ) +create_single_source_cgal_program("test_property_map.cpp") -create_single_source_cgal_program( "dynamic_property_map.cpp" ) +create_single_source_cgal_program("dynamic_property_map.cpp") -create_single_source_cgal_program( "dynamic_properties_test.cpp" ) +create_single_source_cgal_program("dynamic_properties_test.cpp") -create_single_source_cgal_program( "kernel_converter_properties_test.cpp" ) +create_single_source_cgal_program("kernel_converter_properties_test.cpp") if(OpenMesh_FOUND) - target_link_libraries( dynamic_properties_test PRIVATE ${OPENMESH_LIBRARIES} ) + target_link_libraries(dynamic_properties_test PRIVATE ${OPENMESH_LIBRARIES}) endif() - diff --git a/QP_solver/examples/QP_solver/CMakeLists.txt b/QP_solver/examples/QP_solver/CMakeLists.txt index b7d2f715716..e5810a9abdc 100644 --- a/QP_solver/examples/QP_solver/CMakeLists.txt +++ b/QP_solver/examples/QP_solver/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( QP_solver_Examples ) +project(QP_solver_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/QP_solver/test/QP_solver/CMakeLists.txt b/QP_solver/test/QP_solver/CMakeLists.txt index 68325af2cbf..2257a6e234d 100644 --- a/QP_solver/test/QP_solver/CMakeLists.txt +++ b/QP_solver/test/QP_solver/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( QP_solver_Tests ) +project(QP_solver_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Random_numbers/test/Random_numbers/CMakeLists.txt b/Random_numbers/test/Random_numbers/CMakeLists.txt index cb663271989..1d0c3c36dee 100644 --- a/Random_numbers/test/Random_numbers/CMakeLists.txt +++ b/Random_numbers/test/Random_numbers/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Random_numbers_Tests ) +project(Random_numbers_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Ridges_3/examples/Ridges_3/CMakeLists.txt b/Ridges_3/examples/Ridges_3/CMakeLists.txt index 3fe086671df..8eb75f8339a 100644 --- a/Ridges_3/examples/Ridges_3/CMakeLists.txt +++ b/Ridges_3/examples/Ridges_3/CMakeLists.txt @@ -1,48 +1,42 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Ridges_3_Examples ) +project(Ridges_3_Examples) +find_package(CGAL REQUIRED) +# use either Eigen +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) -find_package(CGAL QUIET ) - -if ( CGAL_FOUND ) - - # use either Eigen - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - - # Link with Boost.ProgramOptions (optional) - find_package(Boost QUIET COMPONENTS program_options) - if(TARGET Boost::program_options) - set(Boost_PROGRAM_OPTIONS_LIBRARY Boost::program_options) - endif() - if(Boost_PROGRAM_OPTIONS_FOUND) - if( CGAL_AUTO_LINK_ENABLED ) - message( STATUS "Boost.ProgramOptions library: found" ) - else() - message( STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}" ) - endif() - add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" ) - list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) - endif() - - create_single_source_cgal_program( Compute_Ridges_Umbilics.cpp) - target_link_libraries(Compute_Ridges_Umbilics PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( Ridges_Umbilics_SM.cpp) - target_link_libraries(Ridges_Umbilics_SM PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( Ridges_Umbilics_LCC.cpp) - target_link_libraries(Ridges_Umbilics_LCC PUBLIC CGAL::Eigen_support) - - else() - - message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") - + # Link with Boost.ProgramOptions (optional) + find_package(Boost QUIET COMPONENTS program_options) + if(TARGET Boost::program_options) + set(Boost_PROGRAM_OPTIONS_LIBRARY Boost::program_options) endif() + if(Boost_PROGRAM_OPTIONS_FOUND) + if(CGAL_AUTO_LINK_ENABLED) + message(STATUS "Boost.ProgramOptions library: found") + else() + message( + STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}") + endif() + add_definitions("-DCGAL_USE_BOOST_PROGRAM_OPTIONS") + list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) + endif() + + create_single_source_cgal_program(Compute_Ridges_Umbilics.cpp) + target_link_libraries(Compute_Ridges_Umbilics PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program(Ridges_Umbilics_SM.cpp) + target_link_libraries(Ridges_Umbilics_SM PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program(Ridges_Umbilics_LCC.cpp) + target_link_libraries(Ridges_Umbilics_LCC PUBLIC CGAL::Eigen_support) else() - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") + message( + STATUS + "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/Ridges_3/test/Ridges_3/CMakeLists.txt b/Ridges_3/test/Ridges_3/CMakeLists.txt index 95025861c1c..2db2c27d54a 100644 --- a/Ridges_3/test/Ridges_3/CMakeLists.txt +++ b/Ridges_3/test/Ridges_3/CMakeLists.txt @@ -1,30 +1,22 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Ridges_3_Tests ) +project(Ridges_3_Tests) +find_package(CGAL REQUIRED) - -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # use either Eigen - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "ridge_test.cpp" ) - target_link_libraries(ridge_test PUBLIC CGAL::Eigen_support) - else() - - message(STATUS "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled.") - - endif() - +# use either Eigen +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("ridge_test.cpp") + target_link_libraries(ridge_test PUBLIC CGAL::Eigen_support) else() - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") + message( + STATUS + "NOTICE: This program requires Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt b/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt index de657c74d8f..47329bc06ab 100644 --- a/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt +++ b/STL_Extension/benchmark/compact_container_benchmark/CMakeLists.txt @@ -1,16 +1,11 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Compact_container_benchmark ) +project(Compact_container_benchmark) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - find_package( TBB ) - include(CGAL_TBB_support) - create_single_source_cgal_program( "cc_benchmark.cpp" ) - if(TARGET CGAL::TBB_support) - target_link_libraries(cc_benchmark PUBLIC CGAL::TBB_support) - endif() -else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") +find_package(TBB) +include(CGAL_TBB_support) +create_single_source_cgal_program("cc_benchmark.cpp") +if(TARGET CGAL::TBB_support) + target_link_libraries(cc_benchmark PUBLIC CGAL::TBB_support) endif() diff --git a/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt b/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt index 96d70e88b5b..8703695e9a4 100644 --- a/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt +++ b/STL_Extension/benchmark/copy_n_benchmark/CMakeLists.txt @@ -1,25 +1,13 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( copy_n_benchmark_example ) +project(copy_n_benchmark_example) +find_package(CGAL REQUIRED COMPONENTS Core) +include(${CGAL_USE_FILE}) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - create_single_source_cgal_program( "copy_n_benchmark.cpp" ) - - create_single_source_cgal_program( "copy_n_use_case_benchmark.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +create_single_source_cgal_program("copy_n_benchmark.cpp") +create_single_source_cgal_program("copy_n_use_case_benchmark.cpp") diff --git a/STL_Extension/examples/STL_Extension/CMakeLists.txt b/STL_Extension/examples/STL_Extension/CMakeLists.txt index 72743e5f616..e1d04a14856 100644 --- a/STL_Extension/examples/STL_Extension/CMakeLists.txt +++ b/STL_Extension/examples/STL_Extension/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( STL_Extension_Examples ) +project(STL_Extension_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/STL_Extension/test/STL_Extension/CMakeLists.txt b/STL_Extension/test/STL_Extension/CMakeLists.txt index 4a427003e02..0220f5ef272 100644 --- a/STL_Extension/test/STL_Extension/CMakeLists.txt +++ b/STL_Extension/test/STL_Extension/CMakeLists.txt @@ -1,54 +1,45 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( STL_Extension_Tests ) +project(STL_Extension_Tests) +find_package(CGAL REQUIRED) +find_package(TBB QUIET) +include(CGAL_TBB_support) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - find_package( TBB QUIET ) - include(CGAL_TBB_support) - - create_single_source_cgal_program( "test_Boolean_tag.cpp" ) - create_single_source_cgal_program( "test_Cache.cpp" ) - create_single_source_cgal_program( "test_Compact_container.cpp" ) - create_single_source_cgal_program( "test_Compact_container_is_used.cpp" ) - create_single_source_cgal_program( "test_complexity_tags.cpp" ) - create_single_source_cgal_program( "test_composition.cpp" ) - create_single_source_cgal_program( "test_Concatenate_iterator.cpp" ) - create_single_source_cgal_program( "test_Concurrent_compact_container.cpp" ) - if(TARGET CGAL::TBB_support) - target_link_libraries(test_Concurrent_compact_container PUBLIC CGAL::TBB_support) - endif() - create_single_source_cgal_program( "test_dispatch_output.cpp" ) - create_single_source_cgal_program( "test_Flattening_iterator.cpp" ) - create_single_source_cgal_program( "test_Handle_with_policy.cpp" ) - create_single_source_cgal_program( "test_In_place_list.cpp" ) - create_single_source_cgal_program( "test_is_iterator.cpp" ) - create_single_source_cgal_program( "test_is_streamable.cpp" ) - create_single_source_cgal_program( "test_lexcompare_outputrange.cpp" ) - create_single_source_cgal_program( "test_Modifiable_priority_queue.cpp" ) - create_single_source_cgal_program( "test_multiset.cpp" ) - create_single_source_cgal_program( "test_N_tuple.cpp" ) - create_single_source_cgal_program( "test_namespaces.cpp" ) - create_single_source_cgal_program( "test_Nested_iterator.cpp" ) - create_single_source_cgal_program( "test_Object.cpp" ) - create_single_source_cgal_program( "test_stl_extension.cpp" ) - create_single_source_cgal_program( "test_type_traits.cpp" ) - create_single_source_cgal_program( "test_Uncertain.cpp" ) - create_single_source_cgal_program( "test_vector.cpp" ) - create_single_source_cgal_program( "test_join_iterators.cpp" ) - create_single_source_cgal_program( "test_for_each.cpp" ) - if(TARGET CGAL::TBB_support) - target_link_libraries(test_for_each PUBLIC CGAL::TBB_support) - endif() -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - +create_single_source_cgal_program("test_Boolean_tag.cpp") +create_single_source_cgal_program("test_Cache.cpp") +create_single_source_cgal_program("test_Compact_container.cpp") +create_single_source_cgal_program("test_Compact_container_is_used.cpp") +create_single_source_cgal_program("test_complexity_tags.cpp") +create_single_source_cgal_program("test_composition.cpp") +create_single_source_cgal_program("test_Concatenate_iterator.cpp") +create_single_source_cgal_program("test_Concurrent_compact_container.cpp") +if(TARGET CGAL::TBB_support) + target_link_libraries(test_Concurrent_compact_container + PUBLIC CGAL::TBB_support) +endif() +create_single_source_cgal_program("test_dispatch_output.cpp") +create_single_source_cgal_program("test_Flattening_iterator.cpp") +create_single_source_cgal_program("test_Handle_with_policy.cpp") +create_single_source_cgal_program("test_In_place_list.cpp") +create_single_source_cgal_program("test_is_iterator.cpp") +create_single_source_cgal_program("test_is_streamable.cpp") +create_single_source_cgal_program("test_lexcompare_outputrange.cpp") +create_single_source_cgal_program("test_Modifiable_priority_queue.cpp") +create_single_source_cgal_program("test_multiset.cpp") +create_single_source_cgal_program("test_N_tuple.cpp") +create_single_source_cgal_program("test_namespaces.cpp") +create_single_source_cgal_program("test_Nested_iterator.cpp") +create_single_source_cgal_program("test_Object.cpp") +create_single_source_cgal_program("test_stl_extension.cpp") +create_single_source_cgal_program("test_type_traits.cpp") +create_single_source_cgal_program("test_Uncertain.cpp") +create_single_source_cgal_program("test_vector.cpp") +create_single_source_cgal_program("test_join_iterators.cpp") +create_single_source_cgal_program("test_for_each.cpp") +if(TARGET CGAL::TBB_support) + target_link_libraries(test_for_each PUBLIC CGAL::TBB_support) endif() diff --git a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt index b6b1e1a3ba1..79737d882ed 100644 --- a/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt +++ b/Scale_space_reconstruction_3/examples/Scale_space_reconstruction_3/CMakeLists.txt @@ -1,46 +1,41 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Scale_space_reconstruction_3_Examples ) +project(Scale_space_reconstruction_3_Examples) +find_package(CGAL REQUIRED) -find_package( CGAL QUIET) +# Activate concurrency? +option(ACTIVATE_CONCURRENCY "Enable concurrency" ON) -if ( CGAL_FOUND ) - - # Activate concurrency? - option(ACTIVATE_CONCURRENCY - "Enable concurrency" - ON) - - if( ACTIVATE_CONCURRENCY ) - find_package( TBB ) - include(CGAL_TBB_support) - if( NOT TARGET CGAL::TBB_support ) - message( STATUS "NOTICE: Intel TBB NOT found! The example is faster if TBB is linked." ) - endif() +if(ACTIVATE_CONCURRENCY) + find_package(TBB) + include(CGAL_TBB_support) + if(NOT TARGET CGAL::TBB_support) + message( + STATUS + "NOTICE: Intel TBB NOT found! The example is faster if TBB is linked.") endif() +endif() - find_package( Eigen3 3.1.0 ) - include(CGAL_Eigen_support) - if( TARGET CGAL::Eigen_support ) - create_single_source_cgal_program( "scale_space.cpp" ) - target_link_libraries(scale_space PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "scale_space_incremental.cpp" ) - target_link_libraries(scale_space_incremental PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "scale_space_manifold.cpp" ) - target_link_libraries(scale_space_manifold PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "scale_space_advancing_front.cpp" ) - target_link_libraries(scale_space_advancing_front PUBLIC CGAL::Eigen_support) - if(ACTIVATE_CONCURRENCY AND TARGET CGAL::TBB_support) - target_link_libraries(scale_space PUBLIC CGAL::TBB_support) - target_link_libraries(scale_space_incremental PUBLIC CGAL::TBB_support) - target_link_libraries(scale_space_manifold PUBLIC CGAL::TBB_support) - target_link_libraries(scale_space_advancing_front PUBLIC CGAL::TBB_support) - endif() - else() - message( STATUS "NOTICE: The example needs Eigen 3.1 (or greater) and will not be compiled." ) +find_package(Eigen3 3.1.0) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("scale_space.cpp") + target_link_libraries(scale_space PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("scale_space_incremental.cpp") + target_link_libraries(scale_space_incremental PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("scale_space_manifold.cpp") + target_link_libraries(scale_space_manifold PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("scale_space_advancing_front.cpp") + target_link_libraries(scale_space_advancing_front PUBLIC CGAL::Eigen_support) + if(ACTIVATE_CONCURRENCY AND TARGET CGAL::TBB_support) + target_link_libraries(scale_space PUBLIC CGAL::TBB_support) + target_link_libraries(scale_space_incremental PUBLIC CGAL::TBB_support) + target_link_libraries(scale_space_manifold PUBLIC CGAL::TBB_support) + target_link_libraries(scale_space_advancing_front PUBLIC CGAL::TBB_support) endif() else() - - message( STATUS "This program requires the CGAL library, and will not be compiled." ) - + message( + STATUS + "NOTICE: The example needs Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt b/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt index 5d830710b13..b3efbb6d5b5 100644 --- a/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt +++ b/SearchStructures/examples/RangeSegmentTrees/CMakeLists.txt @@ -1,20 +1,13 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( RangeSegmentTrees_Examples ) +project(RangeSegmentTrees_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt b/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt index 642392728ff..2d2219df8d4 100644 --- a/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt +++ b/SearchStructures/test/RangeSegmentTrees/CMakeLists.txt @@ -1,20 +1,9 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( RangeSegmentTrees_Tests ) +project(RangeSegmentTrees_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "test_segment_tree_set_2.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +create_single_source_cgal_program("test_segment_tree_set_2.cpp") diff --git a/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt index 112b7ff815e..436de95ed2e 100644 --- a/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/CMakeLists.txt @@ -1,26 +1,14 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Segment_Delaunay_graph_2_example ) +project(Segment_Delaunay_graph_2_example) +find_package(CGAL REQUIRED COMPONENTS Core) +include(${CGAL_USE_FILE}) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - create_single_source_cgal_program( "benchmark.cpp" ) - create_single_source_cgal_program( "benchmark_nox.cpp" ) - create_single_source_cgal_program( "double.cpp" ) - create_single_source_cgal_program( "sdg-bench-traits.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +create_single_source_cgal_program("benchmark.cpp") +create_single_source_cgal_program("benchmark_nox.cpp") +create_single_source_cgal_program("double.cpp") +create_single_source_cgal_program("sdg-bench-traits.cpp") diff --git a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt index 6f5ee21818e..ded2d87df20 100644 --- a/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/examples/Segment_Delaunay_graph_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Segment_Delaunay_graph_2_Examples ) +project(Segment_Delaunay_graph_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt index bea0ecf7aa5..150a058d48a 100644 --- a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/CMakeLists.txt @@ -1,27 +1,19 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Segment_Delaunay_graph_2_Tests ) +project(Segment_Delaunay_graph_2_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 60bea9ef71c..d322ddc2290 100644 --- a/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_Linf_2/benchmark/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -1,24 +1,13 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Segment_Delaunay_graph_2_example ) +project(Segment_Delaunay_graph_2_example) +find_package(CGAL REQUIRED COMPONENTS Core) +include(${CGAL_USE_FILE}) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - create_single_source_cgal_program( "sdg-creation-time.cpp" ) - create_single_source_cgal_program( "benchmark-gen.cpp" ) - create_single_source_cgal_program( "incirc.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +create_single_source_cgal_program("sdg-creation-time.cpp") +create_single_source_cgal_program("benchmark-gen.cpp") +create_single_source_cgal_program("incirc.cpp") diff --git a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index b7d194e436e..ba74019efd5 100644 --- a/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_Linf_2/examples/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -1,29 +1,17 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Segment_Delaunay_graph_Linf_2_Examples ) +project(Segment_Delaunay_graph_Linf_2_Examples) +find_package(CGAL REQUIRED) - -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "sdg-count-sites-linf.cpp" ) - create_single_source_cgal_program( "sdg-fast-sp-linf.cpp" ) - create_single_source_cgal_program( "sdg-fast-sp-polygon-linf.cpp" ) - create_single_source_cgal_program( "sdg-filtered-traits-linf.cpp" ) - create_single_source_cgal_program( "sdg-info-set-linf.cpp" ) - create_single_source_cgal_program( "sdg-red-blue-info-linf.cpp" ) - create_single_source_cgal_program( "sdg-voronoi-edges-linf.cpp" ) - create_single_source_cgal_program( "sdg-voronoi-edges-exact-linf.cpp" ) - create_single_source_cgal_program( "print-sdg-linf.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +create_single_source_cgal_program("sdg-count-sites-linf.cpp") +create_single_source_cgal_program("sdg-fast-sp-linf.cpp") +create_single_source_cgal_program("sdg-fast-sp-polygon-linf.cpp") +create_single_source_cgal_program("sdg-filtered-traits-linf.cpp") +create_single_source_cgal_program("sdg-info-set-linf.cpp") +create_single_source_cgal_program("sdg-red-blue-info-linf.cpp") +create_single_source_cgal_program("sdg-voronoi-edges-linf.cpp") +create_single_source_cgal_program("sdg-voronoi-edges-exact-linf.cpp") +create_single_source_cgal_program("print-sdg-linf.cpp") diff --git a/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index 23472fb0ad1..5d767b839f1 100644 --- a/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/Segment_Delaunay_graph_Linf_2/test/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -1,27 +1,19 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Segment_Delaunay_graph_Linf_2_Tests ) +project(Segment_Delaunay_graph_Linf_2_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt b/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt index dd91ba64e0f..dc42d213320 100644 --- a/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt +++ b/Set_movable_separability_2/examples/Set_movable_separability_2/CMakeLists.txt @@ -2,12 +2,14 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Set_movable_separability_2_Examples ) - +project(Set_movable_separability_2_Examples) list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11) -if (has_cpp11 LESS 0) - message(STATUS "NOTICE: These examples requires a C++11 compiler and will not be compiled.") +if(has_cpp11 LESS 0) + message( + STATUS + "NOTICE: These examples requires a C++11 compiler and will not be compiled." + ) return() endif() @@ -15,13 +17,10 @@ endif() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -find_package(CGAL QUIET COMPONENTS ) +find_package(CGAL REQUIRED) -if (CGAL_FOUND) - create_single_source_cgal_program( "top_edges_single_mold_trans_cast.cpp" ) - create_single_source_cgal_program( "is_pullout_direction_single_mold_trans_cast.cpp" ) - create_single_source_cgal_program( "pullout_directions_single_mold_trans_cast.cpp" ) - -else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") -endif() +create_single_source_cgal_program("top_edges_single_mold_trans_cast.cpp") +create_single_source_cgal_program( + "is_pullout_direction_single_mold_trans_cast.cpp") +create_single_source_cgal_program( + "pullout_directions_single_mold_trans_cast.cpp") diff --git a/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt b/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt index 37fb88505b2..bdfe6863ec3 100644 --- a/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt +++ b/Set_movable_separability_2/test/Set_movable_separability_2/CMakeLists.txt @@ -2,19 +2,21 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Set_movable_separability_2_Tests ) +project(Set_movable_separability_2_Tests) - -if (RUNNING_CGAL_AUTO_TEST) +if(RUNNING_CGAL_AUTO_TEST) # Just to avoid a warning from CMake when that variable is set on the command line... endif() -if (CGAL_DIR) +if(CGAL_DIR) # Just to avoid a warning from CMake when that variable is set on the command line... endif() list(FIND CMAKE_CXX_COMPILE_FEATURES cxx_generalized_initializers has_cpp11) -if (has_cpp11 LESS 0) - message(STATUS "NOTICE: These examples requires a C++11 compiler and will not be compiled.") +if(has_cpp11 LESS 0) + message( + STATUS + "NOTICE: These examples requires a C++11 compiler and will not be compiled." + ) return() endif() @@ -22,12 +24,8 @@ endif() set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED TRUE) -find_package(CGAL QUIET COMPONENTS ) +find_package(CGAL REQUIRED) -if (CGAL_FOUND) - create_single_source_cgal_program( "test_top_edges_single_mold_trans_cast.cpp" ) - create_single_source_cgal_program( "test_is_pullout_directions_single_mold_trans_cast.cpp" ) - -else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") -endif() +create_single_source_cgal_program("test_top_edges_single_mold_trans_cast.cpp") +create_single_source_cgal_program( + "test_is_pullout_directions_single_mold_trans_cast.cpp") diff --git a/Shape_detection/benchmark/Shape_detection/CMakeLists.txt b/Shape_detection/benchmark/Shape_detection/CMakeLists.txt index 0e8d4b74cf0..7c91cfd57ac 100644 --- a/Shape_detection/benchmark/Shape_detection/CMakeLists.txt +++ b/Shape_detection/benchmark/Shape_detection/CMakeLists.txt @@ -6,25 +6,21 @@ project(Shape_detection_Benchmarks) set(CMAKE_CXX_STANDARD 11) -find_package(CGAL QUIET COMPONENTS Core) -if(CGAL_FOUND) +find_package(CGAL REQUIRED COMPONENTS Core) - include(${CGAL_USE_FILE}) - include(CGAL_CreateSingleSourceCGALProgram) +include(${CGAL_USE_FILE}) +include(CGAL_CreateSingleSourceCGALProgram) - # Use Eigen. - find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) - include(CGAL_Eigen_support) - if(TARGET CGAL::Eigen_support) - create_single_source_cgal_program( - "benchmark_region_growing_on_point_set_2.cpp") - target_link_libraries(benchmark_region_growing_on_point_set_2 PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( - "benchmark_region_growing_on_point_set_3.cpp") - target_link_libraries(benchmark_region_growing_on_point_set_3 PUBLIC CGAL::Eigen_support) - endif() - -else() - message(WARNING - "This program requires the CGAL library, and will not be compiled.") +# Use Eigen. +find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program( + "benchmark_region_growing_on_point_set_2.cpp") + target_link_libraries(benchmark_region_growing_on_point_set_2 + PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program( + "benchmark_region_growing_on_point_set_3.cpp") + target_link_libraries(benchmark_region_growing_on_point_set_3 + PUBLIC CGAL::Eigen_support) endif() diff --git a/Shape_detection/examples/Shape_detection/CMakeLists.txt b/Shape_detection/examples/Shape_detection/CMakeLists.txt index b012e3a0256..c59d88b829e 100644 --- a/Shape_detection/examples/Shape_detection/CMakeLists.txt +++ b/Shape_detection/examples/Shape_detection/CMakeLists.txt @@ -6,57 +6,42 @@ project(Shape_detection_Examples) set(CMAKE_CXX_STANDARD 11) -find_package(CGAL QUIET COMPONENTS Core) -if(CGAL_FOUND) +find_package(CGAL REQUIRED COMPONENTS Core) - include(${CGAL_USE_FILE}) - include(CGAL_CreateSingleSourceCGALProgram) - - # Use Eigen. - find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) - include(CGAL_Eigen_support) - if(TARGET CGAL::Eigen_support) - create_single_source_cgal_program( - "efficient_RANSAC_basic.cpp") - create_single_source_cgal_program( - "efficient_RANSAC_with_callback.cpp") - create_single_source_cgal_program( - "efficient_RANSAC_and_plane_regularization.cpp") - - create_single_source_cgal_program( - "region_growing_on_point_set_2.cpp") - create_single_source_cgal_program( - "region_growing_on_point_set_3.cpp") - create_single_source_cgal_program( - "region_growing_on_polygon_mesh.cpp") - create_single_source_cgal_program( - "region_growing_with_custom_classes.cpp") - - create_single_source_cgal_program( - "shape_detection_basic_deprecated.cpp") - - foreach(target - efficient_RANSAC_basic - efficient_RANSAC_with_callback - efficient_RANSAC_and_plane_regularization - region_growing_on_point_set_2 - region_growing_on_point_set_3 - region_growing_on_polygon_mesh - region_growing_with_custom_classes - shape_detection_basic_deprecated) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endforeach() - - endif() +include(${CGAL_USE_FILE}) +include(CGAL_CreateSingleSourceCGALProgram) +# Use Eigen. +find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("efficient_RANSAC_basic.cpp") + create_single_source_cgal_program("efficient_RANSAC_with_callback.cpp") create_single_source_cgal_program( - "efficient_RANSAC_with_custom_shape.cpp") - create_single_source_cgal_program( - "efficient_RANSAC_with_parameters.cpp") - create_single_source_cgal_program( - "efficient_RANSAC_with_point_access.cpp") + "efficient_RANSAC_and_plane_regularization.cpp") + + create_single_source_cgal_program("region_growing_on_point_set_2.cpp") + create_single_source_cgal_program("region_growing_on_point_set_3.cpp") + create_single_source_cgal_program("region_growing_on_polygon_mesh.cpp") + create_single_source_cgal_program("region_growing_with_custom_classes.cpp") + + create_single_source_cgal_program("shape_detection_basic_deprecated.cpp") + + foreach( + target + efficient_RANSAC_basic + efficient_RANSAC_with_callback + efficient_RANSAC_and_plane_regularization + region_growing_on_point_set_2 + region_growing_on_point_set_3 + region_growing_on_polygon_mesh + region_growing_with_custom_classes + shape_detection_basic_deprecated) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + endforeach() -else() - message(WARNING - "This program requires the CGAL library, and will not be compiled.") endif() + +create_single_source_cgal_program("efficient_RANSAC_with_custom_shape.cpp") +create_single_source_cgal_program("efficient_RANSAC_with_parameters.cpp") +create_single_source_cgal_program("efficient_RANSAC_with_point_access.cpp") diff --git a/Shape_detection/test/Shape_detection/CMakeLists.txt b/Shape_detection/test/Shape_detection/CMakeLists.txt index b804d1014f2..9e6719e15ce 100644 --- a/Shape_detection/test/Shape_detection/CMakeLists.txt +++ b/Shape_detection/test/Shape_detection/CMakeLists.txt @@ -6,80 +6,64 @@ project(Shape_detection_Tests) set(CMAKE_CXX_STANDARD 11) -find_package(CGAL QUIET COMPONENTS Core) -if(CGAL_FOUND) +find_package(CGAL REQUIRED COMPONENTS Core) - include(${CGAL_USE_FILE}) - include(CGAL_CreateSingleSourceCGALProgram) +include(${CGAL_USE_FILE}) +include(CGAL_CreateSingleSourceCGALProgram) - # Use Eigen. - find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) - include(CGAL_Eigen_support) - if(EIGEN3_FOUND) - create_single_source_cgal_program( - "test_region_growing_basic.cpp") - create_single_source_cgal_program( - "test_region_growing_on_cube.cpp") - create_single_source_cgal_program( - "test_region_growing_on_point_set_2.cpp") - create_single_source_cgal_program( - "test_region_growing_on_point_set_3.cpp") - create_single_source_cgal_program( - "test_region_growing_on_polygon_mesh.cpp") - create_single_source_cgal_program( - "test_region_growing_on_point_set_2_with_sorting.cpp") - create_single_source_cgal_program( - "test_region_growing_on_point_set_3_with_sorting.cpp") - create_single_source_cgal_program( - "test_region_growing_on_polygon_mesh_with_sorting.cpp") - create_single_source_cgal_program( - "test_region_growing_on_degenerated_mesh.cpp") - foreach(target - test_region_growing_basic - test_region_growing_on_cube - test_region_growing_on_point_set_2 - test_region_growing_on_point_set_3 - test_region_growing_on_polygon_mesh - test_region_growing_on_point_set_2_with_sorting - test_region_growing_on_point_set_3_with_sorting - test_region_growing_on_polygon_mesh_with_sorting - test_region_growing_on_degenerated_mesh) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endforeach() +# Use Eigen. +find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) +include(CGAL_Eigen_support) +if(EIGEN3_FOUND) + create_single_source_cgal_program("test_region_growing_basic.cpp") + create_single_source_cgal_program("test_region_growing_on_cube.cpp") + create_single_source_cgal_program("test_region_growing_on_point_set_2.cpp") + create_single_source_cgal_program("test_region_growing_on_point_set_3.cpp") + create_single_source_cgal_program("test_region_growing_on_polygon_mesh.cpp") + create_single_source_cgal_program( + "test_region_growing_on_point_set_2_with_sorting.cpp") + create_single_source_cgal_program( + "test_region_growing_on_point_set_3_with_sorting.cpp") + create_single_source_cgal_program( + "test_region_growing_on_polygon_mesh_with_sorting.cpp") + create_single_source_cgal_program( + "test_region_growing_on_degenerated_mesh.cpp") + foreach( + target + test_region_growing_basic + test_region_growing_on_cube + test_region_growing_on_point_set_2 + test_region_growing_on_point_set_3 + test_region_growing_on_polygon_mesh + test_region_growing_on_point_set_2_with_sorting + test_region_growing_on_point_set_3_with_sorting + test_region_growing_on_polygon_mesh_with_sorting + test_region_growing_on_degenerated_mesh) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + endforeach() - endif() - - create_single_source_cgal_program( - "test_efficient_RANSAC_cone_connected_component.cpp") - create_single_source_cgal_program( - "test_efficient_RANSAC_cone_parameters.cpp") - - create_single_source_cgal_program( - "test_efficient_RANSAC_cylinder_connected_component.cpp") - create_single_source_cgal_program( - "test_efficient_RANSAC_cylinder_parameters.cpp") - - create_single_source_cgal_program( - "test_efficient_RANSAC_plane_connected_component.cpp") - create_single_source_cgal_program( - "test_efficient_RANSAC_plane_parameters.cpp") - - create_single_source_cgal_program( - "test_efficient_RANSAC_sphere_connected_component.cpp") - create_single_source_cgal_program( - "test_efficient_RANSAC_sphere_parameters.cpp") - - create_single_source_cgal_program( - "test_efficient_RANSAC_torus_connected_component.cpp") - create_single_source_cgal_program( - "test_efficient_RANSAC_torus_parameters.cpp") - - create_single_source_cgal_program( - "test_efficient_RANSAC_scene.cpp") - create_single_source_cgal_program( - "test_efficient_RANSAC_regularization.cpp") - -else() - message(WARNING - "This program requires the CGAL library, and will not be compiled.") endif() + +create_single_source_cgal_program( + "test_efficient_RANSAC_cone_connected_component.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_cone_parameters.cpp") + +create_single_source_cgal_program( + "test_efficient_RANSAC_cylinder_connected_component.cpp") +create_single_source_cgal_program( + "test_efficient_RANSAC_cylinder_parameters.cpp") + +create_single_source_cgal_program( + "test_efficient_RANSAC_plane_connected_component.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_plane_parameters.cpp") + +create_single_source_cgal_program( + "test_efficient_RANSAC_sphere_connected_component.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_sphere_parameters.cpp") + +create_single_source_cgal_program( + "test_efficient_RANSAC_torus_connected_component.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_torus_parameters.cpp") + +create_single_source_cgal_program("test_efficient_RANSAC_scene.cpp") +create_single_source_cgal_program("test_efficient_RANSAC_regularization.cpp") diff --git a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt index c597404dc00..390e0e6fade 100644 --- a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt +++ b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt @@ -2,40 +2,31 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Skin_surface_3_Examples ) - - +project(Skin_surface_3_Examples) find_package(CGAL) +include_directories(BEFORE include) +if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/NGHK_skin_surface_simple.cpp") + # The two following .cpp files are in dont_submit, and thus not in the + # internal releases. + create_single_source_cgal_program("NGHK_skin_surface_simple.cpp") + create_single_source_cgal_program("NGHK_skin_surface_subdiv.cpp") +endif() +create_single_source_cgal_program("skin_surface_simple.cpp") +create_single_source_cgal_program("skin_surface_subdiv.cpp") +create_single_source_cgal_program("skin_surface_subdiv_with_normals.cpp") +create_single_source_cgal_program("union_of_balls_simple.cpp") +create_single_source_cgal_program("union_of_balls_subdiv.cpp") - -if (CGAL_FOUND) - include_directories (BEFORE include) - - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/NGHK_skin_surface_simple.cpp") - # The two following .cpp files are in dont_submit, and thus not in the - # internal releases. - create_single_source_cgal_program( "NGHK_skin_surface_simple.cpp" ) - create_single_source_cgal_program( "NGHK_skin_surface_subdiv.cpp" ) - endif() - create_single_source_cgal_program( "skin_surface_simple.cpp" ) - create_single_source_cgal_program( "skin_surface_subdiv.cpp" ) - create_single_source_cgal_program( "skin_surface_subdiv_with_normals.cpp" ) - create_single_source_cgal_program( "union_of_balls_simple.cpp" ) - create_single_source_cgal_program( "union_of_balls_subdiv.cpp" ) - - find_package(ESBTL) - if(ESBTL_FOUND) - include_directories( ${ESBTL_INCLUDE_DIR} ) - create_single_source_cgal_program( "skin_surface_pdb_reader.cpp" ) - else(ESBTL_FOUND) - message(STATUS "NOTICE: skin_surface_pdb_reader.cpp requires ESBTL library, and will not be compiled.") - endif(ESBTL_FOUND) - -else(CGAL_FOUND) - - message(STATUS "NOTICE: This directory requires CGAL library, and will not be compiled.") - -endif(CGAL_FOUND) +find_package(ESBTL) +if(ESBTL_FOUND) + include_directories(${ESBTL_INCLUDE_DIR}) + create_single_source_cgal_program("skin_surface_pdb_reader.cpp") +else(ESBTL_FOUND) + message( + STATUS + "NOTICE: skin_surface_pdb_reader.cpp requires ESBTL library, and will not be compiled." + ) +endif(ESBTL_FOUND) diff --git a/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt b/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt index 15f3eae4dc7..2ee0d7d04d9 100644 --- a/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt +++ b/Skin_surface_3/test/Skin_surface_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Skin_surface_3_Tests ) +project(Skin_surface_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt b/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt index ab559b5745f..3a62d219fe4 100644 --- a/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt +++ b/Snap_rounding_2/examples/Snap_rounding_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Snap_rounding_2_Examples ) +project(Snap_rounding_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt b/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt index 10862525bc9..ad598cbeb6b 100644 --- a/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt +++ b/Snap_rounding_2/test/Snap_rounding_2/CMakeLists.txt @@ -1,44 +1,41 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Snap_rounding_2_Tests ) +project(Snap_rounding_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +create_single_source_cgal_program(test_snap_rounding_2.cpp NO_TESTING) -if ( CGAL_FOUND ) - - create_single_source_cgal_program( test_snap_rounding_2.cpp NO_TESTING) - - function(add_Snap_rounding_tests name) - set(data_dir "data") - file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${data_dir} "${CMAKE_CURRENT_SOURCE_DIR}/${data_dir}/data*") - foreach(file ${files}) - string(MAKE_C_IDENTIFIER "${name} ${data_dir}/${file}" test_name) - cgal_add_test(${name} TEST_NAME ${test_name} ARGUMENTS ${data_dir}/${file} ${data_dir}/output_${file}) - add_test(NAME "${test_name}_compare_results" - COMMAND ${CMAKE_COMMAND} -E compare_files ${data_dir}/output_${file} ${data_dir}/gold_${file}) - cgal_setup_test_properties("${test_name}_compare_results") - set_property(TEST "${test_name}_compare_results" - APPEND PROPERTY DEPENDS "${test_name}") - if(POLICY CMP0066) # CMake 3.7 or later - set_property(TEST "${test_name}" - PROPERTY FIXTURES_SETUP "${test_name}_compare_results") - set_property(TEST "${test_name}_compare_results" - APPEND PROPERTY FIXTURES_REQUIRED "${test_name}_compare_results") - endif() - endforeach() - endfunction(add_Snap_rounding_tests) - - if(BUILD_TESTING) - cgal_add_compilation_test( test_snap_rounding_2 ) - add_Snap_rounding_tests( test_snap_rounding_2 ) - endif() -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +function(add_Snap_rounding_tests name) + set(data_dir "data") + file( + GLOB files + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/${data_dir} + "${CMAKE_CURRENT_SOURCE_DIR}/${data_dir}/data*") + foreach(file ${files}) + string(MAKE_C_IDENTIFIER "${name} ${data_dir}/${file}" test_name) + cgal_add_test(${name} TEST_NAME ${test_name} ARGUMENTS ${data_dir}/${file} + ${data_dir}/output_${file}) + add_test(NAME "${test_name}_compare_results" + COMMAND ${CMAKE_COMMAND} -E compare_files + ${data_dir}/output_${file} ${data_dir}/gold_${file}) + cgal_setup_test_properties("${test_name}_compare_results") + set_property( + TEST "${test_name}_compare_results" + APPEND + PROPERTY DEPENDS "${test_name}") + if(POLICY CMP0066) # CMake 3.7 or later + set_property(TEST "${test_name}" PROPERTY FIXTURES_SETUP + "${test_name}_compare_results") + set_property(TEST "${test_name}_compare_results" APPEND + PROPERTY FIXTURES_REQUIRED "${test_name}_compare_results") + endif() + endforeach() +endfunction(add_Snap_rounding_tests) +if(BUILD_TESTING) + cgal_add_compilation_test(test_snap_rounding_2) + add_snap_rounding_tests(test_snap_rounding_2) endif() - diff --git a/Solver_interface/examples/Solver_interface/CMakeLists.txt b/Solver_interface/examples/Solver_interface/CMakeLists.txt index d6f2c10833a..7cbbdab9622 100644 --- a/Solver_interface/examples/Solver_interface/CMakeLists.txt +++ b/Solver_interface/examples/Solver_interface/CMakeLists.txt @@ -1,59 +1,52 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Solver_interface_Examples ) +project(Solver_interface_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +# Use Eigen +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) -if ( CGAL_FOUND ) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("singular_value_decomposition.cpp") + target_link_libraries(singular_value_decomposition PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("sparse_solvers.cpp") + target_link_libraries(sparse_solvers PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("diagonalize_matrix.cpp") + target_link_libraries(diagonalize_matrix PUBLIC CGAL::Eigen_support) +endif() - # Use Eigen - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) +create_single_source_cgal_program("mixed_integer_program.cpp") - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "singular_value_decomposition.cpp" ) - target_link_libraries(singular_value_decomposition PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "sparse_solvers.cpp" ) - target_link_libraries(sparse_solvers PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "diagonalize_matrix.cpp" ) - target_link_libraries(diagonalize_matrix PUBLIC CGAL::Eigen_support) - endif() +find_package(SCIP QUIET) +include(CGAL_SCIP_support) - create_single_source_cgal_program( "mixed_integer_program.cpp" ) +if(TARGET CGAL::SCIP_support) - find_package( SCIP QUIET) - include(CGAL_SCIP_support) - - if (TARGET CGAL::SCIP_support) - - target_link_libraries(mixed_integer_program PUBLIC CGAL::SCIP_support) - message("SCIP found and used") - - else() - - find_package( GLPK QUIET) - include(CGAL_GLPK_support) - - if (TARGET CGAL::GLPK_support) - - target_link_libraries(mixed_integer_program PUBLIC CGAL::GLPK_support) - message("GLPK found and used") - - else() - - message(STATUS "NOTICE : This project requires either SCIP or GLPK, and will not be compiled. " - "Please provide either 'SCIP_DIR' or 'GLPK_INCLUDE_DIR' and 'GLPK_LIBRARIES'") - - endif() - - endif() + target_link_libraries(mixed_integer_program PUBLIC CGAL::SCIP_support) + message("SCIP found and used") else() - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") + find_package(GLPK QUIET) + include(CGAL_GLPK_support) + + if(TARGET CGAL::GLPK_support) + + target_link_libraries(mixed_integer_program PUBLIC CGAL::GLPK_support) + message("GLPK found and used") + + else() + + message( + STATUS + "NOTICE : This project requires either SCIP or GLPK, and will not be compiled. " + "Please provide either 'SCIP_DIR' or 'GLPK_INCLUDE_DIR' and 'GLPK_LIBRARIES'" + ) + + endif() endif() diff --git a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt index e2bb99bb3f6..996bc8b7be6 100644 --- a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt @@ -1,56 +1,48 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Spatial_searching_ ) +project(Spatial_searching_) - -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) +find_package(CGAL REQUIRED COMPONENTS Core) include(${CGAL_USE_FILE}) find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) include(CGAL_Eigen_support) - include_directories (BEFORE "include") +include_directories(BEFORE "include") - create_single_source_cgal_program( "Compare_ANN_STANN_CGAL.cpp" ) - create_single_source_cgal_program( "nanoflan.cpp" ) - create_single_source_cgal_program( "binary.cpp" ) - create_single_source_cgal_program( "nearest_neighbor_searching_50.cpp" ) - create_single_source_cgal_program( "nearest_neighbor_searching_inplace_50.cpp" ) - create_single_source_cgal_program( "Nearest_neighbor_searching.cpp" ) - create_single_source_cgal_program( "Nearest_neighbor_searching_2D.cpp" ) - create_single_source_cgal_program( "Nearest_neighbor_searching_2D_user_defined.cpp" ) - create_single_source_cgal_program( "Split_data.cpp" ) - create_single_source_cgal_program( "nn3cgal.cpp" ) - create_single_source_cgal_program( "nn4cgal.cpp" ) - create_single_source_cgal_program( "nn3nanoflan.cpp" ) - create_single_source_cgal_program( "sizeof.cpp" ) - create_single_source_cgal_program( "deque.cpp" ) - foreach(target - Compare_ANN_STANN_CGAL - nanoflan - binary - nearest_neighbor_searching_50 - nearest_neighbor_searching_inplace_50 - Nearest_neighbor_searching - Nearest_neighbor_searching_2D - Nearest_neighbor_searching_2D_user_defined - Split_data - nn3cgal - nn4cgal - nn3nanoflan - sizeof - deque) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +create_single_source_cgal_program("Compare_ANN_STANN_CGAL.cpp") +create_single_source_cgal_program("nanoflan.cpp") +create_single_source_cgal_program("binary.cpp") +create_single_source_cgal_program("nearest_neighbor_searching_50.cpp") +create_single_source_cgal_program("nearest_neighbor_searching_inplace_50.cpp") +create_single_source_cgal_program("Nearest_neighbor_searching.cpp") +create_single_source_cgal_program("Nearest_neighbor_searching_2D.cpp") +create_single_source_cgal_program( + "Nearest_neighbor_searching_2D_user_defined.cpp") +create_single_source_cgal_program("Split_data.cpp") +create_single_source_cgal_program("nn3cgal.cpp") +create_single_source_cgal_program("nn4cgal.cpp") +create_single_source_cgal_program("nn3nanoflan.cpp") +create_single_source_cgal_program("sizeof.cpp") +create_single_source_cgal_program("deque.cpp") +foreach( + target + Compare_ANN_STANN_CGAL + nanoflan + binary + nearest_neighbor_searching_50 + nearest_neighbor_searching_inplace_50 + Nearest_neighbor_searching + Nearest_neighbor_searching_2D + Nearest_neighbor_searching_2D_user_defined + Split_data + nn3cgal + nn4cgal + nn3nanoflan + sizeof + deque) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) +endforeach() diff --git a/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt b/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt index 814e4bfb6c8..0d478ba64da 100644 --- a/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt +++ b/Spatial_searching/benchmark/Spatial_searching/tools/CMakeLists.txt @@ -1,23 +1,12 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( tools_ ) +project(tools_) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - include_directories (BEFORE "../include") - - create_single_source_cgal_program( "points_in_bbox.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +include_directories(BEFORE "../include") +create_single_source_cgal_program("points_in_bbox.cpp") diff --git a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt index 6ea87500e55..cf8a147a739 100644 --- a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt @@ -2,30 +2,19 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Spatial_searching_Examples ) - - - +project(Spatial_searching_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) include(CGAL_Eigen_support) -if (MSVC) - # Turn off VC++ warning - SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244") +if(MSVC) + # Turn off VC++ warning + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244") endif() - # include for local directory # include for local package @@ -33,57 +22,58 @@ endif() # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "circular_query.cpp" ) +create_single_source_cgal_program("circular_query.cpp") -create_single_source_cgal_program( "distance_browsing.cpp" ) +create_single_source_cgal_program("distance_browsing.cpp") -create_single_source_cgal_program( "iso_rectangle_2_query.cpp" ) +create_single_source_cgal_program("iso_rectangle_2_query.cpp") -create_single_source_cgal_program( "nearest_neighbor_searching.cpp" ) +create_single_source_cgal_program("nearest_neighbor_searching.cpp") -create_single_source_cgal_program( "searching_with_circular_query.cpp" ) +create_single_source_cgal_program("searching_with_circular_query.cpp") -create_single_source_cgal_program( "searching_with_point_with_info.cpp" ) +create_single_source_cgal_program("searching_with_point_with_info.cpp") -create_single_source_cgal_program( "searching_with_point_with_info_inplace.cpp" ) +create_single_source_cgal_program("searching_with_point_with_info_inplace.cpp") -create_single_source_cgal_program( "searching_with_point_with_info_pmap.cpp" ) +create_single_source_cgal_program("searching_with_point_with_info_pmap.cpp") -create_single_source_cgal_program( "searching_surface_mesh_vertices.cpp" ) +create_single_source_cgal_program("searching_surface_mesh_vertices.cpp") -create_single_source_cgal_program( "searching_polyhedron_vertices.cpp" ) +create_single_source_cgal_program("searching_polyhedron_vertices.cpp") -create_single_source_cgal_program( "searching_polyhedron_vertices_with_fuzzy_sphere.cpp") +create_single_source_cgal_program( + "searching_polyhedron_vertices_with_fuzzy_sphere.cpp") -create_single_source_cgal_program( "user_defined_point_and_distance.cpp" ) +create_single_source_cgal_program("user_defined_point_and_distance.cpp") -create_single_source_cgal_program( "using_fair_splitting_rule.cpp" ) +create_single_source_cgal_program("using_fair_splitting_rule.cpp") -create_single_source_cgal_program( "weighted_Minkowski_distance.cpp" ) +create_single_source_cgal_program("weighted_Minkowski_distance.cpp") +if(TARGET CGAL::Eigen_support) - -if (TARGET CGAL::Eigen_support) - - create_single_source_cgal_program( "fuzzy_range_query.cpp" ) + create_single_source_cgal_program("fuzzy_range_query.cpp") target_link_libraries(fuzzy_range_query PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "general_neighbor_searching.cpp" ) + create_single_source_cgal_program("general_neighbor_searching.cpp") target_link_libraries(general_neighbor_searching PUBLIC CGAL::Eigen_support) else() message(STATUS "fuzzy_range_query.cpp and general_neighbor_searching.cpp") - message(STATUS "will not be compiled as they use CGAL::Epick_d which requires the Eigen library.") + message( + STATUS + "will not be compiled as they use CGAL::Epick_d which requires the Eigen library." + ) endif() -find_package( TBB QUIET ) +find_package(TBB QUIET) include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) - create_single_source_cgal_program( "parallel_kdtree.cpp" ) + create_single_source_cgal_program("parallel_kdtree.cpp") target_link_libraries(parallel_kdtree PUBLIC CGAL::TBB_support) else() message(STATUS "parallel_kdtree.cpp requires TBB and will not be compiled") endif() - diff --git a/Spatial_searching/test/Spatial_searching/CMakeLists.txt b/Spatial_searching/test/Spatial_searching/CMakeLists.txt index 3eeb6294938..d9bba62c4ed 100644 --- a/Spatial_searching/test/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/test/Spatial_searching/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Spatial_searching_Tests ) +project(Spatial_searching_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt index 50b2292ca71..91b2cae59c6 100644 --- a/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/benchmark/Spatial_sorting/CMakeLists.txt @@ -1,22 +1,10 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Spatial_sorting_ ) +project(Spatial_sorting_) +find_package(CGAL REQUIRED COMPONENTS Core) - -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - create_single_source_cgal_program( "simple.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +include(${CGAL_USE_FILE}) +create_single_source_cgal_program("simple.cpp") diff --git a/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt index 25197170b29..4de4d1a3fe0 100644 --- a/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/examples/Spatial_sorting/CMakeLists.txt @@ -1,27 +1,21 @@ # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Spatial_sorting_Examples ) +project(Spatial_sorting_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - find_package( TBB QUIET ) - include(CGAL_TBB_support) - if( TARGET CGAL::TBB_support ) - target_link_libraries( parallel_spatial_sort_3 PUBLIC CGAL::TBB_support) - endif() -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +find_package(TBB QUIET) +include(CGAL_TBB_support) +if(TARGET CGAL::TBB_support) + target_link_libraries(parallel_spatial_sort_3 PUBLIC CGAL::TBB_support) endif() diff --git a/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt b/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt index 437508bf629..fd1385d6859 100644 --- a/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt +++ b/Spatial_sorting/test/Spatial_sorting/CMakeLists.txt @@ -1,25 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Spatial_sorting_Tests ) +project(Spatial_sorting_Tests) -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "test_hilbert.cpp" ) - create_single_source_cgal_program( "test_multiscale.cpp" ) - - find_package (TBB QUIET) - include(CGAL_TBB_support) - if( TARGET CGAL::TBB_support ) - target_link_libraries( test_hilbert PUBLIC CGAL::TBB_support ) - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +create_single_source_cgal_program("test_hilbert.cpp") +create_single_source_cgal_program("test_multiscale.cpp") +find_package(TBB QUIET) +include(CGAL_TBB_support) +if(TARGET CGAL::TBB_support) + target_link_libraries(test_hilbert PUBLIC CGAL::TBB_support) endif() diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt index f4190bfeb0c..62687a1dd35 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Straight_skeleton_2_Examples ) +project(Straight_skeleton_2_Examples) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt index f113eafe7f6..624390d7dd7 100644 --- a/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt +++ b/Straight_skeleton_2/test/Straight_skeleton_2/CMakeLists.txt @@ -1,27 +1,19 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Straight_skeleton_2_Tests ) +project(Straight_skeleton_2_Tests) +find_package(CGAL REQUIRED COMPONENTS Core) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include(${CGAL_USE_FILE}) +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt b/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt index bc331a3af0f..53ca9122d98 100644 --- a/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt +++ b/Stream_lines_2/examples/Stream_lines_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Stream_lines_2_Examples ) +project(Stream_lines_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt b/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt index a825fa6c166..2a9bd34be30 100644 --- a/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt +++ b/Stream_lines_2/test/Stream_lines_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Stream_lines_2_Tests ) +project(Stream_lines_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Stream_support/benchmark/Stream_support/CMakeLists.txt b/Stream_support/benchmark/Stream_support/CMakeLists.txt index a22012c9ef5..142a6aa0215 100644 --- a/Stream_support/benchmark/Stream_support/CMakeLists.txt +++ b/Stream_support/benchmark/Stream_support/CMakeLists.txt @@ -2,27 +2,18 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Stream_support ) - - - +project(Stream_support) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -35,7 +26,5 @@ endif() # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "read_doubles.cpp" ) -create_single_source_cgal_program( "read_points.cpp" ) - - +create_single_source_cgal_program("read_doubles.cpp") +create_single_source_cgal_program("read_points.cpp") diff --git a/Stream_support/examples/Stream_support/CMakeLists.txt b/Stream_support/examples/Stream_support/CMakeLists.txt index fc3144b544e..caddcb6f65f 100644 --- a/Stream_support/examples/Stream_support/CMakeLists.txt +++ b/Stream_support/examples/Stream_support/CMakeLists.txt @@ -2,35 +2,26 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Stream_support_Examples) - - +project(Stream_support_Examples) # CGAL and its components -find_package( CGAL QUIET) -if ( CGAL_FOUND ) - include( ${CGAL_USE_FILE} ) +find_package(CGAL REQUIRED) +include(${CGAL_USE_FILE}) - find_package( Boost QUIET ) +find_package(Boost QUIET) - if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") - return() - - endif() - - create_single_source_cgal_program( "Point_WKT.cpp" ) - create_single_source_cgal_program( "Polygon_WKT.cpp" ) - create_single_source_cgal_program( "Linestring_WKT.cpp" ) - create_single_source_cgal_program( "read_WKT.cpp" ) - - create_single_source_cgal_program( "read_xml.cpp" ) - -else () - message(STATUS "This project requires the CGAL library, and will not be compiled.") return() endif() +create_single_source_cgal_program("Point_WKT.cpp") +create_single_source_cgal_program("Polygon_WKT.cpp") +create_single_source_cgal_program("Linestring_WKT.cpp") +create_single_source_cgal_program("read_WKT.cpp") + +create_single_source_cgal_program("read_xml.cpp") diff --git a/Stream_support/test/Stream_support/CMakeLists.txt b/Stream_support/test/Stream_support/CMakeLists.txt index 2a5cd413054..d263c410250 100644 --- a/Stream_support/test/Stream_support/CMakeLists.txt +++ b/Stream_support/test/Stream_support/CMakeLists.txt @@ -1,39 +1,39 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Stream_support_Tests ) +project(Stream_support_Tests) +find_package(CGAL REQUIRED) +find_path( + 3MF_INCLUDE_DIR + NAMES Model/COM/NMR_DLLInterfaces.h + DOC "Path to lib3MF headers") +find_library( + 3MF_LIBRARIES + NAMES 3MF + DOC "Path to the lib3MF library") -find_package(CGAL QUIET) -if ( CGAL_FOUND ) - find_path(3MF_INCLUDE_DIR - NAMES Model/COM/NMR_DLLInterfaces.h - DOC "Path to lib3MF headers" - ) - find_library(3MF_LIBRARIES NAMES 3MF DOC "Path to the lib3MF library") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - if ( "${cppfile}" STREQUAL "test_3mf_to_sm.cpp" ) - if(3MF_LIBRARIES AND 3MF_INCLUDE_DIR AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/NMR_DLLInterfaces.h") - include_directories(${3MF_INCLUDE_DIR}) - create_single_source_cgal_program( "${cppfile}" ) - target_link_libraries(test_3mf_to_sm PRIVATE ${3MF_LIBRARIES}) - else() - message(STATUS "NOTICE : This program requires the lib3MF library, and will not be compiled.") - endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + if("${cppfile}" STREQUAL "test_3mf_to_sm.cpp") + if(3MF_LIBRARIES + AND 3MF_INCLUDE_DIR + AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/NMR_DLLInterfaces.h") + include_directories(${3MF_INCLUDE_DIR}) + create_single_source_cgal_program("${cppfile}") + target_link_libraries(test_3mf_to_sm PRIVATE ${3MF_LIBRARIES}) else() - create_single_source_cgal_program( "${cppfile}" ) + message( + STATUS + "NOTICE : This program requires the lib3MF library, and will not be compiled." + ) endif() - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - - + else() + create_single_source_cgal_program("${cppfile}") + endif() +endforeach() diff --git a/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt b/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt index db7e39e6b64..37bed2ba18e 100644 --- a/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt +++ b/Subdivision_method_3/examples/Subdivision_method_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Subdivision_method_3_Examples ) +project(Subdivision_method_3_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt b/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt index 7adc05c5db3..e602228a7d8 100644 --- a/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt +++ b/Subdivision_method_3/test/Subdivision_method_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Subdivision_method_3_Tests ) +project(Subdivision_method_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Surface_mesh/benchmark/CMakeLists.txt b/Surface_mesh/benchmark/CMakeLists.txt index 09791bbb8a8..220eddde135 100644 --- a/Surface_mesh/benchmark/CMakeLists.txt +++ b/Surface_mesh/benchmark/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.1...3.15) project(Surface_mesh_performance) - find_package(CGAL REQUIRED) include_directories(BEFORE "../include") @@ -13,26 +12,26 @@ include_directories(BEFORE "../include") add_definitions("-std=c++1y") # Polyhedron -add_executable(polyhedron_performance performance_2.h polyhedron_performance.h polyhedron_performance.cpp) +add_executable(polyhedron_performance performance_2.h polyhedron_performance.h + polyhedron_performance.cpp) target_link_libraries(polyhedron_performance ${CGAL_LIBRARIES}) # LCC_2 -add_executable(lcc_performance_2 performance_2.h lcc_performance_2.h lcc_performance_2.cpp) +add_executable(lcc_performance_2 performance_2.h lcc_performance_2.h + lcc_performance_2.cpp) target_link_libraries(lcc_performance_2 ${CGAL_LIBRARIES}) # Surface_mesh -add_executable(surface_mesh_performance performance_2.h surface_mesh_performance.h surface_mesh_performance.cpp) +add_executable( + surface_mesh_performance performance_2.h surface_mesh_performance.h + surface_mesh_performance.cpp) # Performance_2 -add_executable(performance_2 - performance_2.cpp - performance_2.h - polyhedron_performance.h - surface_mesh_performance.h - lcc_performance_2.h -) +add_executable( + performance_2 performance_2.cpp performance_2.h polyhedron_performance.h + surface_mesh_performance.h lcc_performance_2.h) target_link_libraries(performance_2 ${CGAL_LIBRARIES}) -create_single_source_cgal_program( "sm_sms.cpp" ) -create_single_source_cgal_program( "poly_sms.cpp" ) +create_single_source_cgal_program("sm_sms.cpp") +create_single_source_cgal_program("poly_sms.cpp") diff --git a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt index a4c67a19a02..cbad83f22db 100644 --- a/Surface_mesh/examples/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/examples/Surface_mesh/CMakeLists.txt @@ -1,9 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_Examples ) +project(Surface_mesh_Examples) if(POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -15,7 +14,7 @@ if(POLICY CMP0053) endif() if(POLICY CMP0071) - cmake_policy(SET CMP0071 NEW) + cmake_policy(SET CMP0071 NEW) endif() #CGAL_Qt5 is needed for the drawing. @@ -26,35 +25,28 @@ if(CGAL_Qt5_FOUND) add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() -if ( CGAL_FOUND ) +create_single_source_cgal_program("sm_derivation.cpp") +create_single_source_cgal_program("sm_join.cpp") +create_single_source_cgal_program("sm_aabbtree.cpp") +create_single_source_cgal_program("sm_bgl.cpp") +create_single_source_cgal_program("sm_circulators.cpp") +create_single_source_cgal_program("sm_do_intersect.cpp") +create_single_source_cgal_program("sm_iterators.cpp") +create_single_source_cgal_program("sm_kruskal.cpp") +create_single_source_cgal_program("sm_memory.cpp") +create_single_source_cgal_program("sm_properties.cpp") - create_single_source_cgal_program( "sm_derivation.cpp" ) - create_single_source_cgal_program( "sm_join.cpp" ) - create_single_source_cgal_program( "sm_aabbtree.cpp" ) - create_single_source_cgal_program( "sm_bgl.cpp" ) - create_single_source_cgal_program( "sm_circulators.cpp" ) - create_single_source_cgal_program( "sm_do_intersect.cpp" ) - create_single_source_cgal_program( "sm_iterators.cpp" ) - create_single_source_cgal_program( "sm_kruskal.cpp" ) - create_single_source_cgal_program( "sm_memory.cpp" ) - create_single_source_cgal_program( "sm_properties.cpp" ) +#create the executable of the application - #create the executable of the application +create_single_source_cgal_program("draw_surface_mesh.cpp") +create_single_source_cgal_program("sm_draw_small_faces.cpp") +create_single_source_cgal_program("check_orientation.cpp") +if(CGAL_Qt5_FOUND) - create_single_source_cgal_program("draw_surface_mesh.cpp") - create_single_source_cgal_program("sm_draw_small_faces.cpp") - create_single_source_cgal_program("check_orientation.cpp") - if(CGAL_Qt5_FOUND ) - - #link it with the required CGAL libraries - - target_link_libraries(draw_surface_mesh PUBLIC CGAL::CGAL_Qt5) - target_link_libraries(sm_draw_small_faces PUBLIC CGAL::CGAL_Qt5) - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") + #link it with the required CGAL libraries + target_link_libraries(draw_surface_mesh PUBLIC CGAL::CGAL_Qt5) + target_link_libraries(sm_draw_small_faces PUBLIC CGAL::CGAL_Qt5) endif() + #end of the file diff --git a/Surface_mesh/test/Surface_mesh/CMakeLists.txt b/Surface_mesh/test/Surface_mesh/CMakeLists.txt index 5d500fa36e7..81a2d0ae980 100644 --- a/Surface_mesh/test/Surface_mesh/CMakeLists.txt +++ b/Surface_mesh/test/Surface_mesh/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_Tests ) +project(Surface_mesh_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt index 728c672fded..5380870396c 100644 --- a/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/benchmark/Surface_mesh_approximation/CMakeLists.txt @@ -2,30 +2,21 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_approximation_Benchmarks ) - - +project(Surface_mesh_approximation_Benchmarks) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # include helper file -include( ${CGAL_USE_FILE} ) - +include(${CGAL_USE_FILE}) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -34,16 +25,13 @@ endif() # include for local directory # include for local package -include_directories( BEFORE ../../include ) - +include_directories(BEFORE ../../include) # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) - -create_single_source_cgal_program( "vsa_autoinit_timing_benchmark.cpp" ) - -create_single_source_cgal_program( "vsa_timing_benchmark.cpp" ) +include(CGAL_CreateSingleSourceCGALProgram) +create_single_source_cgal_program("vsa_autoinit_timing_benchmark.cpp") +create_single_source_cgal_program("vsa_timing_benchmark.cpp") diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt index c73ab50c135..88e88dc6690 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt @@ -2,57 +2,51 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_approximation_Examples ) - +project(Surface_mesh_approximation_Examples) # CGAL and its components -find_package( CGAL QUIET) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # include helper file -include( ${CGAL_USE_FILE} ) - +include(${CGAL_USE_FILE}) # Boost -find_package( Boost ) -if ( NOT Boost_FOUND ) - message(STATUS "This project requires the Boost library, and will not be compiled.") +find_package(Boost) +if(NOT Boost_FOUND) + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() # Use Eigen (for PCA) find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") return() endif() # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) +include(CGAL_CreateSingleSourceCGALProgram) -create_single_source_cgal_program( "vsa_approximation_2_example.cpp" ) +create_single_source_cgal_program("vsa_approximation_2_example.cpp") target_link_libraries(vsa_approximation_2_example PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_approximation_example.cpp" ) +create_single_source_cgal_program("vsa_approximation_example.cpp") target_link_libraries(vsa_approximation_example PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_class_interface_example.cpp" ) +create_single_source_cgal_program("vsa_class_interface_example.cpp") target_link_libraries(vsa_class_interface_example PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_isotropic_metric_example.cpp" ) +create_single_source_cgal_program("vsa_isotropic_metric_example.cpp") target_link_libraries(vsa_isotropic_metric_example PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_segmentation_example.cpp" ) +create_single_source_cgal_program("vsa_segmentation_example.cpp") target_link_libraries(vsa_segmentation_example PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_simple_approximation_example.cpp" ) -target_link_libraries(vsa_simple_approximation_example PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program("vsa_simple_approximation_example.cpp") +target_link_libraries(vsa_simple_approximation_example + PUBLIC CGAL::Eigen_support) diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt index 9548e5ac986..b9ef38f9f9e 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt @@ -2,68 +2,59 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_approximation_Tests ) - - +project(Surface_mesh_approximation_Tests) # CGAL and its components -find_package( CGAL QUIET) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # include helper file -include( ${CGAL_USE_FILE} ) - +include(${CGAL_USE_FILE}) # Boost -find_package( Boost ) -if ( NOT Boost_FOUND ) - message(STATUS "This project requires the Boost library, and will not be compiled.") +find_package(Boost) +if(NOT Boost_FOUND) + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() # Use Eigen (for PCA) find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") return() endif() - # Creating entries for all C++ files with "main" routine # ########################################################## -include( CGAL_CreateSingleSourceCGALProgram ) +include(CGAL_CreateSingleSourceCGALProgram) -create_single_source_cgal_program( "vsa_class_interface_test.cpp" ) +create_single_source_cgal_program("vsa_class_interface_test.cpp") target_link_libraries(vsa_class_interface_test PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_correctness_test.cpp" ) +create_single_source_cgal_program("vsa_correctness_test.cpp") target_link_libraries(vsa_correctness_test PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_error_decrease_test.cpp" ) +create_single_source_cgal_program("vsa_error_decrease_test.cpp") target_link_libraries(vsa_error_decrease_test PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_kernel_test.cpp" ) +create_single_source_cgal_program("vsa_kernel_test.cpp") target_link_libraries(vsa_kernel_test PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_approximation_test.cpp" ) +create_single_source_cgal_program("vsa_approximation_test.cpp") target_link_libraries(vsa_approximation_test PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_segmentation_test.cpp" ) +create_single_source_cgal_program("vsa_segmentation_test.cpp") target_link_libraries(vsa_segmentation_test PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_meshing_manifold_test.cpp" ) +create_single_source_cgal_program("vsa_meshing_manifold_test.cpp") target_link_libraries(vsa_meshing_manifold_test PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_metric_test.cpp" ) +create_single_source_cgal_program("vsa_metric_test.cpp") target_link_libraries(vsa_metric_test PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "vsa_teleportation_test.cpp" ) +create_single_source_cgal_program("vsa_teleportation_test.cpp") target_link_libraries(vsa_teleportation_test PUBLIC CGAL::Eigen_support) diff --git a/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt b/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt index bce18be7df6..d23e2937686 100644 --- a/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt +++ b/Surface_mesh_deformation/benchmark/Surface_mesh_deformation/optimal_rotation/CMakeLists.txt @@ -1,22 +1,18 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( benchmark_for_closest_rotation ) +project(benchmark_for_closest_rotation) +find_package(CGAL REQUIRED COMPONENTS Core) +include(${CGAL_USE_FILE}) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "benchmark_for_concept_models.cpp" ) - target_link_libraries(benchmark_for_concept_models PUBLIC CGAL::Eigen_support) - else() - message(STATUS "This program requires the Eigen library, version 3.1 or later and will not be compiled.") - endif() +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("benchmark_for_concept_models.cpp") + target_link_libraries(benchmark_for_concept_models PUBLIC CGAL::Eigen_support) else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") + message( + STATUS + "This program requires the Eigen library, version 3.1 or later and will not be compiled." + ) endif() diff --git a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt index daabda6ac44..2d0823d9166 100644 --- a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt @@ -1,9 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_deformation_Demo ) +project(Surface_mesh_deformation_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,20 +11,17 @@ endif() set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE) -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) - - find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "deform_mesh_for_botsch08_format.cpp" ) - target_link_libraries(deform_mesh_for_botsch08_format PUBLIC CGAL::Eigen_support) - else() - message(STATUS "NOTICE: This program requires the Eigen library, version 3.2 or later and will not be compiled.") - endif() +find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("deform_mesh_for_botsch08_format.cpp") + target_link_libraries(deform_mesh_for_botsch08_format + PUBLIC CGAL::Eigen_support) else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: This program requires the Eigen library, version 3.2 or later and 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 f60163d11be..c02d2766bfc 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt @@ -1,54 +1,54 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_deformation_Examples ) +project(Surface_mesh_deformation_Examples) +find_package(CGAL REQUIRED) +find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("all_roi_assign_example.cpp") + create_single_source_cgal_program( + "all_roi_assign_example_custom_polyhedron.cpp") + create_single_source_cgal_program("all_roi_assign_example_Surface_mesh.cpp") + create_single_source_cgal_program("custom_weight_for_edges_example.cpp") + create_single_source_cgal_program( + "deform_polyhedron_with_custom_pmap_example.cpp") + create_single_source_cgal_program("k_ring_roi_translate_rotate_example.cpp") + create_single_source_cgal_program( + "k_ring_roi_translate_rotate_Surface_mesh.cpp") + create_single_source_cgal_program( + "deform_mesh_for_botsch08_format_sre_arap.cpp") -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "all_roi_assign_example.cpp" ) - create_single_source_cgal_program( "all_roi_assign_example_custom_polyhedron.cpp" ) - create_single_source_cgal_program( "all_roi_assign_example_Surface_mesh.cpp" ) - create_single_source_cgal_program( "custom_weight_for_edges_example.cpp" ) - create_single_source_cgal_program( "deform_polyhedron_with_custom_pmap_example.cpp" ) - create_single_source_cgal_program( "k_ring_roi_translate_rotate_example.cpp" ) - create_single_source_cgal_program( "k_ring_roi_translate_rotate_Surface_mesh.cpp" ) - create_single_source_cgal_program( "deform_mesh_for_botsch08_format_sre_arap.cpp" ) - - foreach(target - all_roi_assign_example - all_roi_assign_example_custom_polyhedron - all_roi_assign_example_Surface_mesh - custom_weight_for_edges_example - deform_polyhedron_with_custom_pmap_example - k_ring_roi_translate_rotate_example - k_ring_roi_translate_rotate_Surface_mesh - deform_mesh_for_botsch08_format_sre_arap) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endforeach() - - find_package( OpenMesh QUIET ) - if ( OpenMesh_FOUND ) - include( UseOpenMesh ) - 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::Eigen_support) - else() - message(STATUS "Example that use OpenMesh will not be compiled.") - endif() + foreach( + target + all_roi_assign_example + all_roi_assign_example_custom_polyhedron + all_roi_assign_example_Surface_mesh + custom_weight_for_edges_example + deform_polyhedron_with_custom_pmap_example + k_ring_roi_translate_rotate_example + k_ring_roi_translate_rotate_Surface_mesh + deform_mesh_for_botsch08_format_sre_arap) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + endforeach() + find_package(OpenMesh QUIET) + if(OpenMesh_FOUND) + include(UseOpenMesh) + 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::Eigen_support) else() - message(STATUS "NOTICE: These examples require the Eigen library, version 3.2 or later and will not be compiled.") + message(STATUS "Example that use OpenMesh will not be compiled.") endif() + else() - - message(STATUS "NOTICE: These exmaples require the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: These examples require the Eigen library, version 3.2 or later and 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 624cef733bb..236714e6444 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt @@ -1,39 +1,33 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_deformation_Tests ) +project(Surface_mesh_deformation_Tests) +find_package(CGAL REQUIRED) +find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("Cactus_deformation_session.cpp") + target_link_libraries(Cactus_deformation_session PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("Cactus_performance_test.cpp") + target_link_libraries(Cactus_performance_test PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("Symmetry_test.cpp") + target_link_libraries(Symmetry_test PUBLIC CGAL::Eigen_support) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "Cactus_deformation_session.cpp" ) - target_link_libraries(Cactus_deformation_session PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "Cactus_performance_test.cpp" ) - target_link_libraries(Cactus_performance_test PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "Symmetry_test.cpp" ) - target_link_libraries(Symmetry_test PUBLIC CGAL::Eigen_support) - - find_package( OpenMesh QUIET ) - if ( OpenMesh_FOUND ) - include( UseOpenMesh ) - create_single_source_cgal_program( "Cactus_deformation_session_OpenMesh.cpp" ) - target_link_libraries( Cactus_deformation_session_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} CGAL::Eigen_support) - else() - message(STATUS "Example that use OpenMesh will not be compiled.") - endif() + find_package(OpenMesh QUIET) + if(OpenMesh_FOUND) + include(UseOpenMesh) + create_single_source_cgal_program("Cactus_deformation_session_OpenMesh.cpp") + target_link_libraries(Cactus_deformation_session_OpenMesh + PRIVATE ${OPENMESH_LIBRARIES} CGAL::Eigen_support) else() - message(STATUS "NOTICE: These tests require the Eigen library, version 3.2 or later and will not be compiled.") + message(STATUS "Example that use OpenMesh will not be compiled.") endif() else() - - message(STATUS "NOTICE: These tests require the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: These tests require the Eigen library, version 3.2 or later and will not be compiled." + ) endif() diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt index eab97c84ecb..eacf37276cd 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/CMakeLists.txt @@ -1,79 +1,78 @@ # This is the CMake script for compiling this folder. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_parameterization_Examples ) - - +project(Surface_mesh_parameterization_Examples) # Find CGAL -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + # Executables that require Eigen 3.1 - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - # Executables that require Eigen 3.1 - -# ------------------------------------------------------------------ -# Detect SuiteSparse libraries: -# If not found automatically, set SuiteSparse_DIR in CMake to the -# directory where SuiteSparse was built. -# ------------------------------------------------------------------ - - set(SuiteSparse_USE_LAPACK_BLAS ON) - find_package(SuiteSparse QUIET NO_MODULE) # 1st: Try to locate the *config.cmake file. - if(NOT SuiteSparse_FOUND) - set(SuiteSparse_VERBOSE ON) - find_package(SuiteSparse QUIET) # 2nd: Use FindSuiteSparse.cmake module - if(SuiteSparse_FOUND) - include_directories(${SuiteSparse_INCLUDE_DIRS}) - endif(SuiteSparse_FOUND) - else(NOT SuiteSparse_FOUND) - include(${USE_SuiteSparse}) - endif(NOT SuiteSparse_FOUND) + # ------------------------------------------------------------------ + # Detect SuiteSparse libraries: + # If not found automatically, set SuiteSparse_DIR in CMake to the + # directory where SuiteSparse was built. + # ------------------------------------------------------------------ + set(SuiteSparse_USE_LAPACK_BLAS ON) + find_package(SuiteSparse QUIET NO_MODULE + )# 1st: Try to locate the *config.cmake file. + if(NOT SuiteSparse_FOUND) + set(SuiteSparse_VERBOSE ON) + find_package(SuiteSparse QUIET) # 2nd: Use FindSuiteSparse.cmake module if(SuiteSparse_FOUND) - if (SuiteSparse_UMFPACK_FOUND) - message(STATUS "SuiteSparse_LIBS: ${SuiteSparse_LIBRARIES}") - message(STATUS "Orbifold Tutte Embeddings will use UmfPackLU") - add_definitions(-DEIGEN_DONT_ALIGN_STATICALLY) - add_definitions(-DCGAL_SMP_USE_SPARSESUITE_SOLVERS) - else() - message(STATUS "NOTICE: The example `orbifold.cpp` will be compiled without the Sparsesuite library and UmfPack. Try setting SuiteSparse_UMF_INCLUDE_DIR and at least one of SuiteSparse_UMFPACK_LIBRARY_RELEASE and SuiteSparse_UMFPACK_LIBRARY_DEBUG to you UMFPACK installation.") - endif() - else(SuiteSparse_FOUND) - message(STATUS "NOTICE: The example `orbifold.cpp` will be compiled without the Sparsesuite library.") + include_directories(${SuiteSparse_INCLUDE_DIRS}) endif(SuiteSparse_FOUND) + else(NOT SuiteSparse_FOUND) + include(${USE_SuiteSparse}) + endif(NOT SuiteSparse_FOUND) -# ------------------------------------------------------------------ -# End of SuiteSparse detection -# ------------------------------------------------------------------ - - create_single_source_cgal_program( "discrete_authalic.cpp" ) - target_link_libraries(discrete_authalic PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "lscm.cpp" ) - target_link_libraries(lscm PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "orbifold.cpp" ) - target_link_libraries(orbifold PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "seam_Polyhedron_3.cpp" ) - target_link_libraries(seam_Polyhedron_3 PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "simple_parameterization.cpp" ) - target_link_libraries(simple_parameterization PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "square_border_parameterizer.cpp" ) - target_link_libraries(square_border_parameterizer PUBLIC CGAL::Eigen_support) - - if(SuiteSparse_FOUND) - target_link_libraries(orbifold PRIVATE ${SuiteSparse_LIBRARIES}) + if(SuiteSparse_FOUND) + if(SuiteSparse_UMFPACK_FOUND) + message(STATUS "SuiteSparse_LIBS: ${SuiteSparse_LIBRARIES}") + message(STATUS "Orbifold Tutte Embeddings will use UmfPackLU") + add_definitions(-DEIGEN_DONT_ALIGN_STATICALLY) + add_definitions(-DCGAL_SMP_USE_SPARSESUITE_SOLVERS) + else() + message( + STATUS + "NOTICE: The example `orbifold.cpp` will be compiled without the Sparsesuite library and UmfPack. Try setting SuiteSparse_UMF_INCLUDE_DIR and at least one of SuiteSparse_UMFPACK_LIBRARY_RELEASE and SuiteSparse_UMFPACK_LIBRARY_DEBUG to you UMFPACK installation." + ) endif() + else(SuiteSparse_FOUND) + message( + STATUS + "NOTICE: The example `orbifold.cpp` will be compiled without the Sparsesuite library." + ) + endif(SuiteSparse_FOUND) - else() - message(STATUS "NOTICE: The examples require Eigen 3.1 (or greater) and will not be compiled.") + # ------------------------------------------------------------------ + # End of SuiteSparse detection + # ------------------------------------------------------------------ + + create_single_source_cgal_program("discrete_authalic.cpp") + target_link_libraries(discrete_authalic PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("lscm.cpp") + target_link_libraries(lscm PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("orbifold.cpp") + target_link_libraries(orbifold PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("seam_Polyhedron_3.cpp") + target_link_libraries(seam_Polyhedron_3 PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("simple_parameterization.cpp") + target_link_libraries(simple_parameterization PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("square_border_parameterizer.cpp") + target_link_libraries(square_border_parameterizer PUBLIC CGAL::Eigen_support) + + if(SuiteSparse_FOUND) + target_link_libraries(orbifold PRIVATE ${SuiteSparse_LIBRARIES}) endif() else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: The examples require Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt index 7141d3fef9a..98de8be4f5b 100644 --- a/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt +++ b/Surface_mesh_parameterization/test/Surface_mesh_parameterization/CMakeLists.txt @@ -1,28 +1,20 @@ # This is the CMake script for compiling this folder. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_parameterization_Tests ) - - +project(Surface_mesh_parameterization_Tests) # Find CGAL -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) - include(CGAL_Eigen_support) - if(TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "extensive_parameterization_test.cpp" ) - target_link_libraries(extensive_parameterization_test PUBLIC CGAL::Eigen_support) - else() - message(STATUS "NOTICE: The tests require Eigen 3.1 (or greater) and will not be compiled.") - endif() +find_package(CGAL REQUIRED) +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("extensive_parameterization_test.cpp") + target_link_libraries(extensive_parameterization_test + PUBLIC CGAL::Eigen_support) else() - - message(STATUS "NOTICE: This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: The tests require Eigen 3.1 (or greater) and 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 63947780e09..1d73fb20fef 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt @@ -2,63 +2,53 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_segmentation_Examples ) - - - - +project(Surface_mesh_segmentation_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost ) +find_package(Boost) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() -find_package( OpenMesh QUIET ) +find_package(OpenMesh QUIET) -if ( OpenMesh_FOUND ) -include( UseOpenMesh ) +if(OpenMesh_FOUND) + include(UseOpenMesh) else() message(STATUS "Examples that use OpenMesh will not be compiled.") endif() - # include for local package - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "sdf_values_example.cpp" ) +create_single_source_cgal_program("sdf_values_example.cpp") -create_single_source_cgal_program( "segmentation_from_sdf_values_example.cpp" ) +create_single_source_cgal_program("segmentation_from_sdf_values_example.cpp") -create_single_source_cgal_program( "segmentation_via_sdf_values_example.cpp" ) +create_single_source_cgal_program("segmentation_via_sdf_values_example.cpp") -create_single_source_cgal_program( "segmentation_with_facet_ids_example.cpp" ) +create_single_source_cgal_program("segmentation_with_facet_ids_example.cpp") -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("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") +create_single_source_cgal_program("extract_segmentation_into_mesh_example.cpp") if(OpenMesh_FOUND) - create_single_source_cgal_program( "segmentation_from_sdf_values_OpenMesh_example.cpp" ) - target_link_libraries( segmentation_from_sdf_values_OpenMesh_example PRIVATE ${OPENMESH_LIBRARIES} ) + create_single_source_cgal_program( + "segmentation_from_sdf_values_OpenMesh_example.cpp") + target_link_libraries(segmentation_from_sdf_values_OpenMesh_example + PRIVATE ${OPENMESH_LIBRARIES}) endif() - diff --git a/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt index 21d66b5d522..d83b6834315 100644 --- a/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/test/Surface_mesh_segmentation/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_segmentation_Tests ) +project(Surface_mesh_segmentation_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() 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 57b6d968ca5..d592c75483b 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 @@ -1,35 +1,23 @@ - # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_shortest_path_Examples ) +project(Surface_mesh_shortest_path_Examples) +find_package(CGAL REQUIRED) +create_single_source_cgal_program("shortest_path_sequence.cpp") +create_single_source_cgal_program("shortest_paths_multiple_sources.cpp") +create_single_source_cgal_program("shortest_paths_no_id.cpp") +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(CGAL QUIET) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "shortest_path_sequence.cpp" ) - create_single_source_cgal_program( "shortest_paths_multiple_sources.cpp" ) - create_single_source_cgal_program( "shortest_paths_no_id.cpp" ) - 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 ) - if ( OpenMesh_FOUND ) - include( UseOpenMesh ) - create_single_source_cgal_program( "shortest_paths_OpenMesh.cpp" ) - target_link_libraries( shortest_paths_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} ) - else() - message(STATUS "Examples that use OpenMesh will not be compiled.") - endif() +find_package(OpenMesh QUIET) +if(OpenMesh_FOUND) + include(UseOpenMesh) + create_single_source_cgal_program("shortest_paths_OpenMesh.cpp") + target_link_libraries(shortest_paths_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message(STATUS "Examples that use OpenMesh will not be compiled.") endif() - diff --git a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt index 46029b6f917..fb93da6bdfe 100644 --- a/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt +++ b/Surface_mesh_shortest_path/test/Surface_mesh_shortest_path/CMakeLists.txt @@ -1,6 +1,5 @@ - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_shortest_path_Tests ) +project(Surface_mesh_shortest_path_Tests) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) @@ -8,15 +7,15 @@ include(${CGAL_USE_FILE}) find_package(LEDA QUIET) -include_directories (BEFORE "include") +include_directories(BEFORE "include") -create_single_source_cgal_program( "Surface_mesh_shortest_path_test_1.cpp" ) -create_single_source_cgal_program( "Surface_mesh_shortest_path_test_2.cpp" ) -create_single_source_cgal_program( "Surface_mesh_shortest_path_test_3.cpp" ) -create_single_source_cgal_program( "Surface_mesh_shortest_path_test_4.cpp" ) - create_single_source_cgal_program( "Surface_mesh_shortest_path_test_5.cpp" ) - create_single_source_cgal_program( "Surface_mesh_shortest_path_test_6.cpp" ) -create_single_source_cgal_program( "Surface_mesh_shortest_path_traits_test.cpp" ) +create_single_source_cgal_program("Surface_mesh_shortest_path_test_1.cpp") +create_single_source_cgal_program("Surface_mesh_shortest_path_test_2.cpp") +create_single_source_cgal_program("Surface_mesh_shortest_path_test_3.cpp") +create_single_source_cgal_program("Surface_mesh_shortest_path_test_4.cpp") +create_single_source_cgal_program("Surface_mesh_shortest_path_test_5.cpp") +create_single_source_cgal_program("Surface_mesh_shortest_path_test_6.cpp") +create_single_source_cgal_program("Surface_mesh_shortest_path_traits_test.cpp") # Link with Boost.ProgramOptions (optional) find_package(Boost QUIET COMPONENTS program_options) @@ -24,18 +23,25 @@ if(Boost_PROGRAM_OPTIONS_FOUND) if(TARGET Boost::program_options) set(Boost_PROGRAM_OPTIONS_LIBRARY Boost::program_options) endif() - if( CGAL_AUTO_LINK_ENABLED ) - message( STATUS "Boost.ProgramOptions library: found" ) + if(CGAL_AUTO_LINK_ENABLED) + message(STATUS "Boost.ProgramOptions library: found") else() - message( STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}" ) + message( + STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}") endif() - add_definitions( "-DCGAL_USE_BOOST_PROGRAM_OPTIONS" ) + add_definitions("-DCGAL_USE_BOOST_PROGRAM_OPTIONS") list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_PROGRAM_OPTIONS_LIBRARY}) if(CGAL_Core_FOUND OR LEDA_FOUND) - create_single_source_cgal_program( "TestMesh.cpp" ) + create_single_source_cgal_program("TestMesh.cpp") else() - message(STATUS "NOTICE: Example TestMesh.cpp requires the CGAL_Core library (or LEDA) and will not be compiled.") + message( + STATUS + "NOTICE: Example TestMesh.cpp requires the CGAL_Core library (or LEDA) and will not be compiled." + ) endif() else() - message(STATUS "NOTICE: Example TestMesh.cpp requires boost program_option and will not be compiled.") + message( + STATUS + "NOTICE: Example TestMesh.cpp requires boost program_option and 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 bfd216d1e80..dd5cf970e40 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt @@ -2,28 +2,25 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_simplification_Examples ) +project(Surface_mesh_simplification_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) -if ( NOT CGAL_FOUND ) - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() -endif() +find_package(CGAL REQUIRED) -include( ${CGAL_USE_FILE} ) +include(${CGAL_USE_FILE}) # Boost and its components -find_package( Boost ) -if ( NOT Boost_FOUND ) - message(STATUS "This project requires the Boost library, and will not be compiled.") +find_package(Boost) +if(NOT Boost_FOUND) + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() -find_package( OpenMesh QUIET ) +find_package(OpenMesh QUIET) -if ( OpenMesh_FOUND ) -include( UseOpenMesh ) +if(OpenMesh_FOUND) + include(UseOpenMesh) else() message(STATUS "Examples that use OpenMesh will not be compiled.") endif() @@ -31,27 +28,33 @@ endif() # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "edge_collapse_constrain_sharp_edges.cpp" ) -create_single_source_cgal_program( "edge_collapse_constrained_border_polyhedron.cpp" ) -create_single_source_cgal_program( "edge_collapse_enriched_polyhedron.cpp" ) -create_single_source_cgal_program( "edge_collapse_polyhedron.cpp" ) -create_single_source_cgal_program( "edge_collapse_surface_mesh.cpp" ) -create_single_source_cgal_program( "edge_collapse_linear_cell_complex.cpp" ) -create_single_source_cgal_program( "edge_collapse_constrained_border_surface_mesh.cpp" ) -create_single_source_cgal_program( "edge_collapse_all_short_edges.cpp" ) -create_single_source_cgal_program( "edge_collapse_bounded_normal_change.cpp" ) -create_single_source_cgal_program( "edge_collapse_visitor_surface_mesh.cpp" ) +create_single_source_cgal_program("edge_collapse_constrain_sharp_edges.cpp") +create_single_source_cgal_program( + "edge_collapse_constrained_border_polyhedron.cpp") +create_single_source_cgal_program("edge_collapse_enriched_polyhedron.cpp") +create_single_source_cgal_program("edge_collapse_polyhedron.cpp") +create_single_source_cgal_program("edge_collapse_surface_mesh.cpp") +create_single_source_cgal_program("edge_collapse_linear_cell_complex.cpp") +create_single_source_cgal_program( + "edge_collapse_constrained_border_surface_mesh.cpp") +create_single_source_cgal_program("edge_collapse_all_short_edges.cpp") +create_single_source_cgal_program("edge_collapse_bounded_normal_change.cpp") +create_single_source_cgal_program("edge_collapse_visitor_surface_mesh.cpp") find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen_support) -if( TARGET CGAL::Eigen_support ) - create_single_source_cgal_program( "edge_collapse_garland_heckbert.cpp" ) - target_link_libraries(edge_collapse_garland_heckbert PUBLIC CGAL::Eigen_support) -else () - message(STATUS "Garland-Heckbert polices require the Eigen library, which has not been found; related examples will not be compiled.") +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("edge_collapse_garland_heckbert.cpp") + target_link_libraries(edge_collapse_garland_heckbert + PUBLIC CGAL::Eigen_support) +else() + message( + STATUS + "Garland-Heckbert polices require the Eigen library, which has not been found; related examples will not be compiled." + ) endif() if(OpenMesh_FOUND) - create_single_source_cgal_program( "edge_collapse_OpenMesh.cpp" ) - target_link_libraries( edge_collapse_OpenMesh PRIVATE ${OPENMESH_LIBRARIES} ) + create_single_source_cgal_program("edge_collapse_OpenMesh.cpp") + target_link_libraries(edge_collapse_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) endif() diff --git a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt index acef4a4fe0c..55fd8e8750b 100644 --- a/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/test/Surface_mesh_simplification/CMakeLists.txt @@ -1,19 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_simplification_Tests ) +project(Surface_mesh_simplification_Tests) -find_package(CGAL QUIET) - -if ( NOT CGAL_FOUND ) - message(STATUS "This program requires the CGAL library, and will not be compiled.") - return() -endif() +find_package(CGAL REQUIRED) # create a target per cppfile -file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) + create_single_source_cgal_program("${cppfile}") endforeach() diff --git a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt index b5522d61809..e2f9ca828d5 100644 --- a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt @@ -2,30 +2,22 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Mean_curvature_skeleton ) +project(Mean_curvature_skeleton) #SET(CMAKE_BUILD_TYPE "Debug") #SET(GCC_COVERAGE_COMPILE_FLAGS "-fprofile-arcs -ftest-coverage") #SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS}" ) - - # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -41,11 +33,10 @@ if(NOT TARGET CGAL::Eigen_support) message(STATUS "NOTICE: Eigen 3.2 (or greater) is not found.") endif() - # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "solver_benchmark.cpp" ) +create_single_source_cgal_program("solver_benchmark.cpp") target_link_libraries(solver_benchmark PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "mcf_scale_invariance.cpp" ) +create_single_source_cgal_program("mcf_scale_invariance.cpp") target_link_libraries(mcf_scale_invariance PUBLIC CGAL::Eigen_support) diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt index e5ee181c4d3..5e93efaf7b4 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt @@ -1,43 +1,36 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_skeletonization_Examples ) +project(Surface_mesh_skeletonization_Examples) +find_package(CGAL REQUIRED) +find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +include(CGAL_Eigen_support) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) - include(CGAL_Eigen_support) - - if(TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "simple_mcfskel_example.cpp" ) - create_single_source_cgal_program( "simple_mcfskel_sm_example.cpp" ) - create_single_source_cgal_program( "simple_mcfskel_LCC_example.cpp" ) - create_single_source_cgal_program( "MCF_Skeleton_example.cpp" ) - create_single_source_cgal_program( "MCF_Skeleton_sm_example.cpp" ) - create_single_source_cgal_program( "MCF_Skeleton_LCC_example.cpp" ) - create_single_source_cgal_program( "segmentation_example.cpp" ) - foreach(target - simple_mcfskel_example - simple_mcfskel_sm_example - simple_mcfskel_LCC_example - MCF_Skeleton_example - MCF_Skeleton_sm_example - MCF_Skeleton_LCC_example - segmentation_example) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endforeach() - else() - message(STATUS "These programs require the Eigen library (3.2 or greater), and will not be compiled.") - endif() - +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("simple_mcfskel_example.cpp") + create_single_source_cgal_program("simple_mcfskel_sm_example.cpp") + create_single_source_cgal_program("simple_mcfskel_LCC_example.cpp") + create_single_source_cgal_program("MCF_Skeleton_example.cpp") + create_single_source_cgal_program("MCF_Skeleton_sm_example.cpp") + create_single_source_cgal_program("MCF_Skeleton_LCC_example.cpp") + create_single_source_cgal_program("segmentation_example.cpp") + foreach( + target + simple_mcfskel_example + simple_mcfskel_sm_example + simple_mcfskel_LCC_example + MCF_Skeleton_example + MCF_Skeleton_sm_example + MCF_Skeleton_LCC_example + segmentation_example) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + endforeach() else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "These programs require the Eigen library (3.2 or greater), and will not be compiled." + ) endif() diff --git a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt index 29adc5293fe..b6abbe92f38 100644 --- a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt @@ -1,29 +1,22 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesh_skeletonization_Tests ) +project(Surface_mesh_skeletonization_Tests) +find_package(CGAL REQUIRED) +find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +include(CGAL_Eigen_support) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) - include(CGAL_Eigen_support) - - if(TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "MCF_Skeleton_test.cpp" ) - target_link_libraries(MCF_Skeleton_test PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "skeleton_connectivity_test.cpp" ) - target_link_libraries(skeleton_connectivity_test PUBLIC CGAL::Eigen_support) - else() - message(STATUS "These tests require the Eigen library (3.2 or greater), and will not be compiled.") - endif() +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("MCF_Skeleton_test.cpp") + target_link_libraries(MCF_Skeleton_test PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("skeleton_connectivity_test.cpp") + target_link_libraries(skeleton_connectivity_test PUBLIC CGAL::Eigen_support) else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "These tests require the Eigen library (3.2 or greater), and will not be compiled." + ) endif() diff --git a/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt b/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt index 4887546db08..9b09cdbb440 100644 --- a/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt +++ b/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt @@ -7,16 +7,8 @@ find_package(CGAL) # add_definitions(-DCGAL_TRACE_PATH_TESTS) # add_definitions(-DCGAL_TRACE_CMAP_TOOLS) -if ( NOT CGAL_FOUND ) - - message(FATAL_ERROR "This program requires the CGAL library, and will not be compiled.") - -endif() - -set(SOURCE_FILES - quadrangulation_computation_benchmarks.cpp - path_homotopy_with_schema.cpp - ) +set(SOURCE_FILES quadrangulation_computation_benchmarks.cpp + path_homotopy_with_schema.cpp) foreach(cppfile ${SOURCE_FILES}) create_single_source_cgal_program("${cppfile}") diff --git a/Surface_mesh_topology/examples/Surface_mesh_topology/CMakeLists.txt b/Surface_mesh_topology/examples/Surface_mesh_topology/CMakeLists.txt index ba810895f23..68cd4f5a819 100644 --- a/Surface_mesh_topology/examples/Surface_mesh_topology/CMakeLists.txt +++ b/Surface_mesh_topology/examples/Surface_mesh_topology/CMakeLists.txt @@ -10,13 +10,9 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL QUIET COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) - add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) -endif() - -if ( NOT CGAL_FOUND ) - message(FATAL_ERROR "This program requires the CGAL library, and will not be compiled.") + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() # add_definitions(-DCGAL_TRACE_PATH_TESTS) @@ -25,21 +21,20 @@ endif() # add_definitions("-D_GLIBCXX_DEBUG") set(SOURCE_FILES - edgewidth_lcc.cpp - edgewidth_surface_mesh.cpp - facewidth.cpp - map_2_constructor.cpp - open_path_homotopy.cpp - path_homotopy.cpp - path_homotopy_double_torus.cpp - path_homotopy_torus.cpp - path_homotopy_with_sm_and_polyhedron.cpp - path_homotopy_with_symbols_2.cpp - path_homotopy_with_symbols.cpp - shortest_noncontractible_cycle_2.cpp - shortest_noncontractible_cycle.cpp - unsew_edgewidth_repeatedly.cpp - ) + edgewidth_lcc.cpp + edgewidth_surface_mesh.cpp + facewidth.cpp + map_2_constructor.cpp + open_path_homotopy.cpp + path_homotopy.cpp + path_homotopy_double_torus.cpp + path_homotopy_torus.cpp + path_homotopy_with_sm_and_polyhedron.cpp + path_homotopy_with_symbols_2.cpp + path_homotopy_with_symbols.cpp + shortest_noncontractible_cycle_2.cpp + shortest_noncontractible_cycle.cpp + unsew_edgewidth_repeatedly.cpp) foreach(cppfile ${SOURCE_FILES}) create_single_source_cgal_program("${cppfile}") @@ -53,7 +48,8 @@ if(CGAL_Qt5_FOUND) target_link_libraries(path_homotopy PUBLIC CGAL::CGAL_Qt5) target_link_libraries(path_homotopy_double_torus PUBLIC CGAL::CGAL_Qt5) target_link_libraries(path_homotopy_torus PUBLIC CGAL::CGAL_Qt5) - target_link_libraries(path_homotopy_with_sm_and_polyhedron PUBLIC CGAL::CGAL_Qt5) + target_link_libraries(path_homotopy_with_sm_and_polyhedron + PUBLIC CGAL::CGAL_Qt5) target_link_libraries(shortest_noncontractible_cycle_2 PUBLIC CGAL::CGAL_Qt5) target_link_libraries(shortest_noncontractible_cycle PUBLIC CGAL::CGAL_Qt5) target_link_libraries(unsew_edgewidth_repeatedly PUBLIC CGAL::CGAL_Qt5) diff --git a/Surface_mesh_topology/test/Surface_mesh_topology/CMakeLists.txt b/Surface_mesh_topology/test/Surface_mesh_topology/CMakeLists.txt index 36cc15870a8..070c7327bcd 100644 --- a/Surface_mesh_topology/test/Surface_mesh_topology/CMakeLists.txt +++ b/Surface_mesh_topology/test/Surface_mesh_topology/CMakeLists.txt @@ -10,13 +10,9 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) - add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) -endif() - -if ( NOT CGAL_FOUND ) - message(FATAL_ERROR "This program requires the CGAL library, and will not be compiled.") + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() # add_definitions(-DCGAL_TRACE_PATH_TESTS) @@ -25,20 +21,19 @@ endif() # add_definitions("-D_GLIBCXX_DEBUG") set(SOURCE_FILES - fundamental_group_of_the_circle.cpp - fundamental_group_of_the_torus.cpp - homotopy_big_cylinder.cpp - homotopy_double_torus_with_holes.cpp - homotopy_rond_point_saucisse.cpp - homotopy_small_cylinder.cpp - path_tests.cpp - path_with_rle_deformation_tests.cpp - shortest_noncontractible_cycle_tests.cpp - test_homotopy.cpp - test_homotopy_with_polygonal_schema.cpp - test_shortest_cycle_non_contractible.cpp - tests_path_on_surface.cpp - ) + fundamental_group_of_the_circle.cpp + fundamental_group_of_the_torus.cpp + homotopy_big_cylinder.cpp + homotopy_double_torus_with_holes.cpp + homotopy_rond_point_saucisse.cpp + homotopy_small_cylinder.cpp + path_tests.cpp + path_with_rle_deformation_tests.cpp + shortest_noncontractible_cycle_tests.cpp + test_homotopy.cpp + test_homotopy_with_polygonal_schema.cpp + test_shortest_cycle_non_contractible.cpp + tests_path_on_surface.cpp) foreach(cppfile ${SOURCE_FILES}) create_single_source_cgal_program("${cppfile}") diff --git a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt index a3026736db0..3402ae6a380 100644 --- a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt @@ -1,7 +1,7 @@ -set ( prj Surface_mesher ) +set(prj Surface_mesher) cmake_minimum_required(VERSION 3.1...3.15) -project ( Surface_mesher_Demo ) +project(Surface_mesher_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -30,39 +30,55 @@ set(PACKAGE_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../..) # Add several CGAL packages to the include and link paths, # if they lie in ${PACKAGE_ROOT}/. -foreach(LIB_DIR ${PACKAGE_ROOT}/../CGAL_ImageIO/src/CGAL_ImageIO ${PACKAGE_ROOT}/../GraphicsView/src/CGALQt5) - if (EXISTS ${LIB_DIR}) - link_directories (${LIB_DIR}) +foreach(LIB_DIR ${PACKAGE_ROOT}/../CGAL_ImageIO/src/CGAL_ImageIO + ${PACKAGE_ROOT}/../GraphicsView/src/CGALQt5) + if(EXISTS ${LIB_DIR}) + link_directories(${LIB_DIR}) endif() endforeach() -include_directories( ./ ) +include_directories(./) # QGLViwer needs Qt5 configured with QtOpenGL and QtXml support -find_package(CGAL COMPONENTS ImageIO Qt5) -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) +find_package(CGAL REQUIRED COMPONENTS ImageIO Qt5) +if(CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) add_definitions(-DQT_NO_KEYWORDS) find_package(Qt5 QUIET COMPONENTS OpenGL Xml Svg) - find_package(OpenGL ) + find_package(OpenGL) - if (Qt5_FOUND AND OPENGL_FOUND AND OPENGL_GLU_FOUND ) + if(Qt5_FOUND + AND OPENGL_FOUND + AND OPENGL_GLU_FOUND) - set( sources Raw_image_dialog.cpp colorlisteditor.cpp values_list.cpp mainwindow.cpp Surface_mesher.cpp viewer.cpp volume.cpp ) + set(sources + Raw_image_dialog.cpp + colorlisteditor.cpp + values_list.cpp + mainwindow.cpp + Surface_mesher.cpp + viewer.cpp + volume.cpp) if(EXISTS ${PACKAGE_ROOT}/../Marching_cube) - option(SURFACE_MESH_DEMO_USE_MARCHING_CUBE "Embed a marching cube implementation in the Surface Mesh demo." ON) + option(SURFACE_MESH_DEMO_USE_MARCHING_CUBE + "Embed a marching cube implementation in the Surface Mesh demo." + ON) mark_as_advanced(SURFACE_MESH_DEMO_USE_MARCHING_CUBE) endif() if(EXISTS ${PACKAGE_ROOT}/include/CGAL/Polyhedral_surface_3.h) - option(SURFACE_MESH_DEMO_WITH_POLYHEDRAL_SURFACE "Compile the support for polyhedral surfaces." OFF) + option(SURFACE_MESH_DEMO_WITH_POLYHEDRAL_SURFACE + "Compile the support for polyhedral surfaces." OFF) mark_as_advanced(SURFACE_MESH_DEMO_WITH_POLYHEDRAL_SURFACE) endif() - option(SURFACE_MESH_DEMO_VERBOSE "Set this option if you want the Surface Mesh demo to display messages on standard output." OFF) + option( + SURFACE_MESH_DEMO_VERBOSE + "Set this option if you want the Surface Mesh demo to display messages on standard output." + OFF) mark_as_advanced(SURFACE_MESH_DEMO_VERBOSE) if(SURFACE_MESH_DEMO_VERBOSE) @@ -80,25 +96,27 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) add_definitions(-DCGAL_SURFACE_MESH_DEMO_USE_MARCHING_CUBE) endif() + qt5_generate_moc("surface.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_surface.cpp") - qt5_generate_moc( "surface.h" "${CMAKE_CURRENT_BINARY_DIR}/moc_surface.cpp" ) + set(sources ${sources} moc_surface.cpp) - set( sources ${sources} moc_surface.cpp) + qt5_wrap_ui(uis ui/values_list.ui ui/mainwindow.ui ui/optionsdialog.ui + ui/raw_image.ui) - qt5_wrap_ui( uis ui/values_list.ui ui/mainwindow.ui ui/optionsdialog.ui ui/raw_image.ui ) + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES values_list.qrc + surface_mesher.qrc) - qt5_add_resources( CGAL_Qt5_RESOURCE_FILES values_list.qrc surface_mesher.qrc ) + add_executable(${prj} ${sources} ${uis} ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES}) - add_executable ( ${prj} ${sources} ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS ${prj}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${prj} ) - - find_package(VTK QUIET COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) + find_package(VTK QUIET COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE) if(VTK_FOUND) if(VTK_USE_FILE) include(${VTK_USE_FILE}) endif() - if ("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) + if("${VTK_VERSION_MAJOR}" GREATER "5" OR VTK_VERSION VERSION_GREATER 5) message(STATUS "VTK found") add_definitions(-DCGAL_USE_VTK) if(TARGET VTK::IOImage) @@ -111,21 +129,27 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) message(STATUS "For reading Dicom files install VTK first") endif() - target_link_libraries( ${prj} PRIVATE - CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_ImageIO - ${OPENGL_LIBRARIES} - ${VTK_LIBRARIES} ) + target_link_libraries( + ${prj} PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_ImageIO + ${OPENGL_LIBRARIES} ${VTK_LIBRARIES}) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(${prj}) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(${prj}) - endif( Qt5_FOUND AND OPENGL_FOUND AND OPENGL_GLU_FOUND ) -else(CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) + endif( + Qt5_FOUND + AND OPENGL_FOUND + AND OPENGL_GLU_FOUND) +else( + CGAL_Qt5_FOUND + AND CGAL_ImageIO_FOUND) if(RUNNING_CGAL_AUTO_TEST) # Just to avoid a warning from CMake if that variable is set on the command line... endif() message(STATUS "NOTICE: This demo needs Qt5, and will not be compiled.") -endif(CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) +endif( + CGAL_Qt5_FOUND + AND CGAL_ImageIO_FOUND) diff --git a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt index 314de3d8611..6e926872065 100644 --- a/Surface_mesher/examples/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/examples/Surface_mesher/CMakeLists.txt @@ -1,29 +1,29 @@ # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesher_Examples ) - +project(Surface_mesher_Examples) if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() -find_package(CGAL QUIET COMPONENTS ImageIO) +find_package(CGAL REQUIRED COMPONENTS ImageIO) -if ( CGAL_FOUND AND CGAL_ImageIO_FOUND ) +if(CGAL_ImageIO_FOUND) include(${CGAL_USE_FILE}) - create_single_source_cgal_program( "mesh_a_3d_gray_image.cpp" ) - create_single_source_cgal_program( "mesh_an_implicit_function.cpp" ) + create_single_source_cgal_program("mesh_a_3d_gray_image.cpp") + create_single_source_cgal_program("mesh_an_implicit_function.cpp") else() if(RUNNING_CGAL_AUTO_TEST) # Just to avoid a warning from CMake if that variable is set on the command line... endif() - message(STATUS "NOTICE: This program requires the CGAL and CGAL ImageIO libraries, and will not be compiled.") + message( + STATUS + "NOTICE: This program requires the CGAL and CGAL ImageIO libraries, and will not be compiled." + ) endif() - diff --git a/Surface_mesher/test/Surface_mesher/CMakeLists.txt b/Surface_mesher/test/Surface_mesher/CMakeLists.txt index b7246eb0399..0c7fd978162 100644 --- a/Surface_mesher/test/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/test/Surface_mesher/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_mesher_Tests ) +project(Surface_mesher_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt b/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt index 290fd852dc6..fca0d2b208c 100644 --- a/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt +++ b/Surface_sweep_2/examples/Surface_sweep_2/CMakeLists.txt @@ -2,24 +2,18 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_sweep_2_Examples ) +project(Surface_sweep_2_Examples) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -32,4 +26,4 @@ endif() # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "plane_sweep.cpp" ) +create_single_source_cgal_program("plane_sweep.cpp") diff --git a/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt b/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt index 788981308c7..20601a50184 100644 --- a/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt +++ b/Surface_sweep_2/test/Surface_sweep_2/CMakeLists.txt @@ -1,59 +1,53 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Surface_sweep_2_Tests ) +project(Surface_sweep_2_Tests) - -find_package(CGAL QUIET COMPONENTS Core ) +find_package(CGAL REQUIRED COMPONENTS Core) set(CGAL_SEGMENT_TRAITS 1) set(CGAL_SEGMENT_LEDA_TRAITS 2) set(CGAL_POLYLINE_TRAITS 11) set(CGAL_CONIC_TRAITS 21) -set(TRAP 1) # Trapezoidal decomposition +set(TRAP 1) # Trapezoidal decomposition set(NAIVE 2) set(WALK 3) -if ( CGAL_FOUND ) +include(${CGAL_USE_FILE}) - include(${CGAL_USE_FILE}) +function(compile name source_file point_location traits) + # message(compile ${source_file}) + add_executable(${name} ${source_file}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS ${name}) + if(TARGET CGAL::CGAL_Core) + target_link_libraries(${name} CGAL::CGAL CGAL::CGAL_Core) + endif() + target_compile_definitions( + ${name} PRIVATE -DCGAL_ARR_TEST_POINT_LOCATION=${point_location} + -DCGAL_ARR_TEST_TRAITS=${traits}) +endfunction() - function(compile name source_file point_location traits) -# message(compile ${source_file}) - add_executable(${name} ${source_file}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${name} ) - if(TARGET CGAL::CGAL_Core) - target_link_libraries(${name} CGAL::CGAL CGAL::CGAL_Core) - endif() - target_compile_definitions(${name} PRIVATE - -DCGAL_ARR_TEST_POINT_LOCATION=${point_location} - -DCGAL_ARR_TEST_TRAITS=${traits} - ) - endfunction() +function(compile_and_run_sweep name source_file point_location traits data_set) + compile(${ARGV}) + if(NOT BUILD_TESTING) + return() + endif() + cgal_add_compilation_test(${name}) + file( + GLOB files + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + "${CMAKE_CURRENT_SOURCE_DIR}/${data_set}/*") + foreach(file ${files}) + # message("test ${source_file} ${file}") + string(MAKE_C_IDENTIFIER "${name} ${file}" test_name) + # message(" --> ${test_name}") + cgal_add_test(${name} TEST_NAME ${test_name} ARGUMENTS ${file}) + endforeach() +endfunction() - function(compile_and_run_sweep name source_file point_location traits data_set) - compile(${ARGV}) - if(NOT BUILD_TESTING) - return() - endif() - cgal_add_compilation_test(${name}) - file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/${data_set}/*") - foreach(file ${files}) -# message("test ${source_file} ${file}") - string(MAKE_C_IDENTIFIER "${name} ${file}" test_name) -# message(" --> ${test_name}") - cgal_add_test(${name} TEST_NAME ${test_name} ARGUMENTS ${file}) - endforeach() - endfunction() - - compile_and_run_sweep(test_sweep test_sweep.cpp ${NAIVE} ${CGAL_SEGMENT_TRAITS} "DATA/segments_tight") - compile_and_run_sweep(test_sweep_conic test_sweep_conic.cpp ${NAIVE} ${CGAL_CONIC_TRAITS} "DATA/conics") - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +compile_and_run_sweep(test_sweep test_sweep.cpp ${NAIVE} ${CGAL_SEGMENT_TRAITS} + "DATA/segments_tight") +compile_and_run_sweep(test_sweep_conic test_sweep_conic.cpp ${NAIVE} + ${CGAL_CONIC_TRAITS} "DATA/conics") diff --git a/TDS_2/test/TDS_2/CMakeLists.txt b/TDS_2/test/TDS_2/CMakeLists.txt index 1e7c706022b..8220d9d0f05 100644 --- a/TDS_2/test/TDS_2/CMakeLists.txt +++ b/TDS_2/test/TDS_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( TDS_2_Tests ) +project(TDS_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/TDS_3/examples/TDS_3/CMakeLists.txt b/TDS_3/examples/TDS_3/CMakeLists.txt index b2df16cd6dd..b4c72966b84 100644 --- a/TDS_3/examples/TDS_3/CMakeLists.txt +++ b/TDS_3/examples/TDS_3/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( TDS_3_Examples ) +project(TDS_3_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/TDS_3/test/TDS_3/CMakeLists.txt b/TDS_3/test/TDS_3/CMakeLists.txt index 87f0c8a318e..57314785c86 100644 --- a/TDS_3/test/TDS_3/CMakeLists.txt +++ b/TDS_3/test/TDS_3/CMakeLists.txt @@ -1,20 +1,14 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( TDS_3_Tests ) +project(TDS_3_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +include_directories(BEFORE "./include") -if ( CGAL_FOUND ) - - include_directories (BEFORE "./include") - - find_package( TBB QUIET ) - include(CGAL_TBB_support) - create_single_source_cgal_program( "test_triangulation_tds_3.cpp" ) - create_single_source_cgal_program( "test_io_tds3.cpp" ) - if(TARGET CGAL::TBB_support) - target_link_libraries(test_triangulation_tds_3 PUBLIC CGAL::TBB_support) - endif() -else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") +find_package(TBB QUIET) +include(CGAL_TBB_support) +create_single_source_cgal_program("test_triangulation_tds_3.cpp") +create_single_source_cgal_program("test_io_tds3.cpp") +if(TARGET CGAL::TBB_support) + target_link_libraries(test_triangulation_tds_3 PUBLIC CGAL::TBB_support) endif() diff --git a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt index a84753fefd0..b692dded6f5 100644 --- a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt @@ -3,19 +3,16 @@ cmake_minimum_required(VERSION 3.1...3.14) -project( Tetrahedral_remeshing_Examples ) +project(Tetrahedral_remeshing_Examples) # CGAL and its components -find_package( CGAL REQUIRED ) -if ( NOT CGAL_FOUND ) - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) -if ( NOT Boost_FOUND ) - message(STATUS "This project requires the Boost library, and will not be compiled.") +find_package(Boost REQUIRED) +if(NOT Boost_FOUND) + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() @@ -25,9 +22,11 @@ include(CGAL_Eigen_support) # Creating entries for all C++ files with "main" routine # ########################################################## -create_single_source_cgal_program( "tetrahedral_remeshing_example.cpp" ) -create_single_source_cgal_program( "tetrahedral_remeshing_with_features.cpp") -create_single_source_cgal_program( "tetrahedral_remeshing_of_one_subdomain.cpp") +create_single_source_cgal_program("tetrahedral_remeshing_example.cpp") +create_single_source_cgal_program("tetrahedral_remeshing_with_features.cpp") +create_single_source_cgal_program("tetrahedral_remeshing_of_one_subdomain.cpp") -create_single_source_cgal_program( "mesh_and_remesh_polyhedral_domain_with_features.cpp" ) -target_link_libraries(mesh_and_remesh_polyhedral_domain_with_features PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program( + "mesh_and_remesh_polyhedral_domain_with_features.cpp") +target_link_libraries(mesh_and_remesh_polyhedral_domain_with_features + PUBLIC CGAL::Eigen_support) diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt index 3f39456eee7..69ffa77d16c 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt @@ -3,42 +3,45 @@ cmake_minimum_required(VERSION 3.1...3.14) -project( Tetrahedral_remeshing_Tests ) +project(Tetrahedral_remeshing_Tests) # CGAL and its components -find_package(CGAL COMPONENTS ImageIO) -if ( NOT CGAL_FOUND ) - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() -endif() +find_package(CGAL REQUIRED COMPONENTS ImageIO) # Boost and its components -find_package( Boost REQUIRED ) -if ( NOT Boost_FOUND ) - message(STATUS "This project requires the Boost library, and will not be compiled.") +find_package(Boost REQUIRED) +if(NOT Boost_FOUND) + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() endif() # Creating entries for all C++ files with "main" routine # ########################################################## -create_single_source_cgal_program( "test_tetrahedral_remeshing.cpp" ) -create_single_source_cgal_program( "test_tetrahedral_remeshing_with_features.cpp") -create_single_source_cgal_program( "test_tetrahedral_remeshing_of_one_subdomain.cpp") -create_single_source_cgal_program( "test_tetrahedral_remeshing_io.cpp") -create_single_source_cgal_program( "test_tetrahedral_remeshing_from_mesh_file.cpp") +create_single_source_cgal_program("test_tetrahedral_remeshing.cpp") +create_single_source_cgal_program( + "test_tetrahedral_remeshing_with_features.cpp") +create_single_source_cgal_program( + "test_tetrahedral_remeshing_of_one_subdomain.cpp") +create_single_source_cgal_program("test_tetrahedral_remeshing_io.cpp") +create_single_source_cgal_program( + "test_tetrahedral_remeshing_from_mesh_file.cpp") # Tests using Mesh_3 require Eigen find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) include(CGAL_Eigen_support) -if (NOT TARGET CGAL::Eigen_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") +if(NOT TARGET CGAL::Eigen_support) + message( + STATUS "This project requires the Eigen library, and will not be compiled.") return() endif() -create_single_source_cgal_program("test_mesh_and_remesh_polyhedral_domain_with_features.cpp") -target_link_libraries(test_mesh_and_remesh_polyhedral_domain_with_features PUBLIC CGAL::Eigen_support) +create_single_source_cgal_program( + "test_mesh_and_remesh_polyhedral_domain_with_features.cpp") +target_link_libraries(test_mesh_and_remesh_polyhedral_domain_with_features + PUBLIC CGAL::Eigen_support) -if( CGAL_ImageIO_USE_ZLIB ) - create_single_source_cgal_program( "test_mesh_and_remesh_image.cpp") +if(CGAL_ImageIO_USE_ZLIB) + create_single_source_cgal_program("test_mesh_and_remesh_image.cpp") target_link_libraries(test_mesh_and_remesh_image PUBLIC CGAL::Eigen_support) endif() diff --git a/Triangulation/applications/Triangulation/CMakeLists.txt b/Triangulation/applications/Triangulation/CMakeLists.txt index 1fc7365fd39..3c3de41bc4e 100644 --- a/Triangulation/applications/Triangulation/CMakeLists.txt +++ b/Triangulation/applications/Triangulation/CMakeLists.txt @@ -2,24 +2,18 @@ # This is the CMake script for compiling a set of CGAL applications. cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_apps ) +project(Triangulation_apps) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -29,14 +23,14 @@ find_package(Eigen3 3.1.0) include(CGAL_Eigen_support) # include for local directory -include_directories( BEFORE include ) +include_directories(BEFORE include) # include for local package # Creating entries for all .cpp/.C files with "main" routine # ########################################################## -create_single_source_cgal_program( "points_to_RT_to_off.cpp" ) +create_single_source_cgal_program("points_to_RT_to_off.cpp") target_link_libraries(points_to_RT_to_off PUBLIC CGAL::Eigen_support) -create_single_source_cgal_program( "points_to_DT_to_off.cpp" ) +create_single_source_cgal_program("points_to_DT_to_off.cpp") target_link_libraries(points_to_DT_to_off PUBLIC CGAL::Eigen_support) diff --git a/Triangulation/benchmark/Triangulation/CMakeLists.txt b/Triangulation/benchmark/Triangulation/CMakeLists.txt index 681ffd10bc0..79c84e05cb7 100644 --- a/Triangulation/benchmark/Triangulation/CMakeLists.txt +++ b/Triangulation/benchmark/Triangulation/CMakeLists.txt @@ -1,31 +1,25 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_benchmark ) +project(Triangulation_benchmark) +find_package(CGAL REQUIRED COMPONENTS Core) +include(${CGAL_USE_FILE}) -find_package(CGAL QUIET COMPONENTS Core ) - -if ( CGAL_FOUND ) - - include(${CGAL_USE_FILE}) - - find_package(Eigen3 3.1.0) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - include_directories (BEFORE "include") - create_single_source_cgal_program( "delaunay.cpp" ) - target_link_libraries(delaunay PUBLIC CGAL::Eigen_support) - create_single_source_cgal_program( "Td_vs_T2_and_T3.cpp" ) - target_link_libraries(Td_vs_T2_and_T3 PUBLIC CGAL::Eigen_support) - - else() - message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.") - endif() +find_package(Eigen3 3.1.0) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + include_directories(BEFORE "include") + create_single_source_cgal_program("delaunay.cpp") + target_link_libraries(delaunay PUBLIC CGAL::Eigen_support) + create_single_source_cgal_program("Td_vs_T2_and_T3.cpp") + target_link_libraries(Td_vs_T2_and_T3 PUBLIC CGAL::Eigen_support) else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") + message( + STATUS + "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/Triangulation/examples/Triangulation/CMakeLists.txt b/Triangulation/examples/Triangulation/CMakeLists.txt index f6589b3e63a..0294d48817b 100644 --- a/Triangulation/examples/Triangulation/CMakeLists.txt +++ b/Triangulation/examples/Triangulation/CMakeLists.txt @@ -1,48 +1,44 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_Examples ) - +project(Triangulation_Examples) if(CMAKE_COMPILER_IS_GNUCCX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - message(STATUS "NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled.") + message( + STATUS + "NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled." + ) return() endif() +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - find_package(Eigen3 3.1.0) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - create_single_source_cgal_program( "barycentric_subdivision.cpp" ) - create_single_source_cgal_program( "delaunay_triangulation.cpp" ) - create_single_source_cgal_program( "convex_hull.cpp" ) - create_single_source_cgal_program( "regular_triangulation.cpp" ) - create_single_source_cgal_program( "triangulation.cpp" ) - create_single_source_cgal_program( "triangulation_data_structure_dynamic.cpp" ) - create_single_source_cgal_program( "triangulation_data_structure_static.cpp" ) - - foreach(target - barycentric_subdivision - delaunay_triangulation - convex_hull - regular_triangulation - triangulation - triangulation_data_structure_dynamic - triangulation_data_structure_static) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endforeach() - else() - message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.") - endif() +find_package(Eigen3 3.1.0) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + create_single_source_cgal_program("barycentric_subdivision.cpp") + create_single_source_cgal_program("delaunay_triangulation.cpp") + create_single_source_cgal_program("convex_hull.cpp") + create_single_source_cgal_program("regular_triangulation.cpp") + create_single_source_cgal_program("triangulation.cpp") + create_single_source_cgal_program("triangulation_data_structure_dynamic.cpp") + create_single_source_cgal_program("triangulation_data_structure_static.cpp") + foreach( + target + barycentric_subdivision + delaunay_triangulation + convex_hull + regular_triangulation + triangulation + triangulation_data_structure_dynamic + triangulation_data_structure_static) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + endforeach() else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/Triangulation/test/Triangulation/CMakeLists.txt b/Triangulation/test/Triangulation/CMakeLists.txt index 8dd9796ba23..38538a731ea 100644 --- a/Triangulation/test/Triangulation/CMakeLists.txt +++ b/Triangulation/test/Triangulation/CMakeLists.txt @@ -2,43 +2,37 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_Tests ) - +project(Triangulation_Tests) if(CMAKE_COMPILER_IS_GNUCCX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.4) - message(STATUS "NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled.") + message( + STATUS + "NOTICE: this directory requires a version of gcc >= 4.4, and will not be compiled." + ) return() endif() -find_package(CGAL QUIET) +find_package(CGAL REQUIRED) -if ( CGAL_FOUND ) +find_package(Eigen3 3.1.0) +include(CGAL_Eigen_support) +if(TARGET CGAL::Eigen_support) + include_directories(BEFORE "include") - find_package(Eigen3 3.1.0) - include(CGAL_Eigen_support) - if (TARGET CGAL::Eigen_support) - include_directories (BEFORE "include") - - create_single_source_cgal_program( "test_triangulation.cpp" ) - create_single_source_cgal_program( "test_delaunay.cpp" ) - create_single_source_cgal_program( "test_regular.cpp" ) - create_single_source_cgal_program( "test_tds.cpp" ) - create_single_source_cgal_program( "test_torture.cpp" ) - create_single_source_cgal_program( "test_insert_if_in_star.cpp" ) - foreach(target - test_triangulation - test_delaunay - test_regular - test_tds - test_torture - test_insert_if_in_star) - target_link_libraries(${target} PUBLIC CGAL::Eigen_support) - endforeach() - - else() - message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.") - endif() + create_single_source_cgal_program("test_triangulation.cpp") + create_single_source_cgal_program("test_delaunay.cpp") + create_single_source_cgal_program("test_regular.cpp") + create_single_source_cgal_program("test_tds.cpp") + create_single_source_cgal_program("test_torture.cpp") + create_single_source_cgal_program("test_insert_if_in_star.cpp") + foreach(target test_triangulation test_delaunay test_regular test_tds + test_torture test_insert_if_in_star) + target_link_libraries(${target} PUBLIC CGAL::Eigen_support) + endforeach() else() - message(STATUS "This program requires the CGAL library, and will not be compiled.") + message( + STATUS + "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." + ) endif() diff --git a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt index 9139121cb67..7bcd212f817 100644 --- a/Triangulation_2/examples/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/examples/Triangulation_2/CMakeLists.txt @@ -1,10 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_2_Examples ) - +project(Triangulation_2_Examples) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -15,29 +13,26 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - if(CGAL_Qt5_FOUND) - target_link_libraries(draw_triangulation_2 PUBLIC CGAL::CGAL_Qt5) - else() - message(STATUS "NOTICE: The example draw_triangulation_2 requires Qt and will not be compiled.") - endif() +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +if(CGAL_Qt5_FOUND) + target_link_libraries(draw_triangulation_2 PUBLIC CGAL::CGAL_Qt5) else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message( + STATUS + "NOTICE: The example draw_triangulation_2 requires Qt and will not be compiled." + ) endif() - diff --git a/Triangulation_2/test/Triangulation_2/CMakeLists.txt b/Triangulation_2/test/Triangulation_2/CMakeLists.txt index 1f1191dadc0..e100aec6a6d 100644 --- a/Triangulation_2/test/Triangulation_2/CMakeLists.txt +++ b/Triangulation_2/test/Triangulation_2/CMakeLists.txt @@ -1,41 +1,33 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_2_Tests ) +project(Triangulation_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) +include_directories(BEFORE "include") -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - if(BUILD_TESTING) - set_tests_properties( - execution___of__test_constrained_triangulation_2 - execution___of__test_delaunay_triangulation_2 - execution___of__test_triangulation_geom_traits - execution___of__test_triangulation_2 - execution___of__test_triangulation_2_bis - execution___of__test_delaunay_hierarchy_2 - execution___of__test_const_triang_plus_2 - execution___of__test_regular_triangulation_2 - execution___of__test_const_del_triangulation_2 - execution___of__test_regular_hierarchy_2 - PROPERTIES RESOURCE_LOCK Triangulation_2_Tests_IO) - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +if(BUILD_TESTING) + set_tests_properties( + execution___of__test_constrained_triangulation_2 + execution___of__test_delaunay_triangulation_2 + execution___of__test_triangulation_geom_traits + execution___of__test_triangulation_2 + execution___of__test_triangulation_2_bis + execution___of__test_delaunay_hierarchy_2 + execution___of__test_const_triang_plus_2 + execution___of__test_regular_triangulation_2 + execution___of__test_const_del_triangulation_2 + execution___of__test_regular_hierarchy_2 + PROPERTIES RESOURCE_LOCK Triangulation_2_Tests_IO) endif() - diff --git a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt index 4d0c7c1c778..a04ac1c281c 100644 --- a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt @@ -3,26 +3,18 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_3 ) - +project(Triangulation_3) # CGAL and its components -find_package( CGAL QUIET COMPONENTS ) - -if ( NOT CGAL_FOUND ) - - message(STATUS "This project requires the CGAL library, and will not be compiled.") - return() - -endif() - +find_package(CGAL REQUIRED) # Boost and its components -find_package( Boost REQUIRED ) +find_package(Boost REQUIRED) -if ( NOT Boost_FOUND ) +if(NOT Boost_FOUND) - message(STATUS "This project requires the Boost library, and will not be compiled.") + message( + STATUS "This project requires the Boost library, and will not be compiled.") return() @@ -32,18 +24,16 @@ endif() # include for local package - # Creating entries for all C++ files with "main" routine # ########################################################## +create_single_source_cgal_program("incident_edges.cpp") -create_single_source_cgal_program( "incident_edges.cpp" ) +create_single_source_cgal_program("simple_2.cpp") -create_single_source_cgal_program( "simple_2.cpp" ) +create_single_source_cgal_program("simple.cpp") -create_single_source_cgal_program( "simple.cpp" ) - -create_single_source_cgal_program( "Triangulation_benchmark_3.cpp" ) +create_single_source_cgal_program("Triangulation_benchmark_3.cpp") find_package(benchmark) @@ -51,10 +41,16 @@ if(TARGET benchmark::benchmark) find_package(TBB REQUIRED) include(CGAL_TBB_support) - create_single_source_cgal_program( "DT3_benchmark_with_TBB.cpp" ) - target_link_libraries(DT3_benchmark_with_TBB PRIVATE benchmark::benchmark CGAL::TBB_support) + create_single_source_cgal_program("DT3_benchmark_with_TBB.cpp") + target_link_libraries(DT3_benchmark_with_TBB PRIVATE benchmark::benchmark + CGAL::TBB_support) - add_executable(DT3_benchmark_with_TBB_CCC_approximate_size DT3_benchmark_with_TBB.cpp) - target_compile_definitions(DT3_benchmark_with_TBB_CCC_approximate_size PRIVATE CGAL_CONCURRENT_COMPACT_CONTAINER_APPROXIMATE_SIZE) - target_link_libraries(DT3_benchmark_with_TBB_CCC_approximate_size PRIVATE CGAL::CGAL benchmark::benchmark CGAL::TBB_support) + add_executable(DT3_benchmark_with_TBB_CCC_approximate_size + DT3_benchmark_with_TBB.cpp) + target_compile_definitions( + DT3_benchmark_with_TBB_CCC_approximate_size + PRIVATE CGAL_CONCURRENT_COMPACT_CONTAINER_APPROXIMATE_SIZE) + target_link_libraries( + DT3_benchmark_with_TBB_CCC_approximate_size + PRIVATE CGAL::CGAL benchmark::benchmark CGAL::TBB_support) endif() diff --git a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt index 0f3412b545f..ddd0963b4a9 100644 --- a/Triangulation_3/demo/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/demo/Triangulation_3/CMakeLists.txt @@ -2,7 +2,7 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.15) -project (Triangulation_3_Demo) +project(Triangulation_3_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -18,8 +18,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) -find_package(CGAL COMPONENTS Qt5) - +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) find_package(Qt5 QUIET COMPONENTS OpenGL Xml) @@ -30,45 +29,48 @@ endif(Qt5_FOUND) # Activate concurrency ? (turned OFF by default) option(CGAL_ACTIVATE_CONCURRENT_TRIANGULATION_3 - "Activate parallelism in Triangulation_3" - OFF) + "Activate parallelism in Triangulation_3" OFF) # And add -DCGAL_CONCURRENT_TRIANGULATION_3 if that option is ON -if( CGAL_ACTIVATE_CONCURRENT_TRIANGULATION_3 ) - add_definitions( -DCGAL_CONCURRENT_TRIANGULATION_3 ) - find_package( TBB REQUIRED ) +if(CGAL_ACTIVATE_CONCURRENT_TRIANGULATION_3) + add_definitions(-DCGAL_CONCURRENT_TRIANGULATION_3) + find_package(TBB REQUIRED) include(CGAL_TBB_support) -else( CGAL_ACTIVATE_CONCURRENT_TRIANGULATION_3 ) - option( LINK_WITH_TBB - "Link with TBB anyway so we can use TBB timers for profiling" - ON) - if( LINK_WITH_TBB ) - find_package( TBB ) +else(CGAL_ACTIVATE_CONCURRENT_TRIANGULATION_3) + option(LINK_WITH_TBB + "Link with TBB anyway so we can use TBB timers for profiling" ON) + if(LINK_WITH_TBB) + find_package(TBB) include(CGAL_TBB_support) - endif( LINK_WITH_TBB ) + endif(LINK_WITH_TBB) endif() -if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +if(CGAL_Qt5_FOUND AND Qt5_FOUND) - include_directories (BEFORE ./ ) + include_directories(BEFORE ./) # ui files, created with Qt Designer - qt5_wrap_ui( uis MainWindow.ui ) + qt5_wrap_ui(uis MainWindow.ui) # qrc files (resources files, that contain icons, at least) - qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./T3_demo.qrc ) - + qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./T3_demo.qrc) # cpp files - add_executable ( T3_demo T3_demo.cpp - MainWindow.cpp Viewer.cpp - PreferenceDlg.cpp - Scene.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) + add_executable( + T3_demo + T3_demo.cpp + MainWindow.cpp + Viewer.cpp + PreferenceDlg.cpp + Scene.cpp + ${uis} + ${CGAL_Qt5_RESOURCE_FILES} + ${CGAL_Qt5_MOC_FILES}) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS T3_demo ) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS T3_demo) - target_link_libraries( T3_demo PRIVATE CGAL::CGAL CGAL::CGAL_Qt5) - target_link_libraries( T3_demo PRIVATE Qt5::OpenGL Qt5::Xml) + target_link_libraries(T3_demo PRIVATE CGAL::CGAL CGAL::CGAL_Qt5) + target_link_libraries(T3_demo PRIVATE Qt5::OpenGL Qt5::Xml) if(TARGET CGAL::TBB_support) target_link_libraries(T3_demo PUBLIC CGAL::TBB_support) endif() @@ -79,19 +81,24 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(T3_demo) -else( CGAL_FOUND AND Qt5_FOUND) +else(Qt5_FOUND) set(TRIANGULATION_3_MISSING_DEPS "") if(NOT CGAL_Qt5_FOUND) - set(TRIANGULATION_3_MISSING_DEPS "the CGAL Qt5 library, ${TRIANGULATION_3_MISSING_DEPS}") + set(TRIANGULATION_3_MISSING_DEPS + "the CGAL Qt5 library, ${TRIANGULATION_3_MISSING_DEPS}") endif() if(NOT Qt5_FOUND) set(TRIANGULATION_3_MISSING_DEPS "Qt5, ${TRIANGULATION_3_MISSING_DEPS}") endif() + message( + STATUS + "NOTICE: This demo requires ${TRIANGULATION_3_MISSING_DEPS}and will not be compiled." + ) - message(STATUS "NOTICE: This demo requires ${TRIANGULATION_3_MISSING_DEPS}and will not be compiled.") - -endif( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) +endif( + CGAL_Qt5_FOUND + AND Qt5_FOUND) diff --git a/Triangulation_3/demo/Triangulation_3_Geomview_demos/CMakeLists.txt b/Triangulation_3/demo/Triangulation_3_Geomview_demos/CMakeLists.txt index e506a6b275d..b1f748359bc 100644 --- a/Triangulation_3/demo/Triangulation_3_Geomview_demos/CMakeLists.txt +++ b/Triangulation_3/demo/Triangulation_3_Geomview_demos/CMakeLists.txt @@ -1,9 +1,8 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_3_Geomview_demos_Demo ) +project(Triangulation_3_Geomview_demos_Demo) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -12,18 +11,9 @@ endif() set_directory_properties(PROPERTIES CGAL_NO_TESTING TRUE) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "Triangulation_3_demo.cpp" ) - create_single_source_cgal_program( "Triangulation_3_color_demo.cpp" ) - create_single_source_cgal_program( "Triangulation_3_remove_demo.cpp" ) - create_single_source_cgal_program( "Triangulation_3_voronoi_demo.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +find_package(CGAL REQUIRED) +create_single_source_cgal_program("Triangulation_3_demo.cpp") +create_single_source_cgal_program("Triangulation_3_color_demo.cpp") +create_single_source_cgal_program("Triangulation_3_remove_demo.cpp") +create_single_source_cgal_program("Triangulation_3_voronoi_demo.cpp") diff --git a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt index a44531dec74..ad52d693912 100644 --- a/Triangulation_3/examples/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/examples/Triangulation_3/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_3_Examples ) - +project(Triangulation_3_Examples) if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. @@ -11,49 +10,45 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) - add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) + add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() -if ( CGAL_FOUND ) - create_single_source_cgal_program( "for_loop.cpp" ) - create_single_source_cgal_program( "adding_handles_3.cpp" ) - create_single_source_cgal_program( "color.cpp" ) - create_single_source_cgal_program( "copy_triangulation_3.cpp" ) - create_single_source_cgal_program( "fast_location_3.cpp" ) - create_single_source_cgal_program( "find_conflicts_3.cpp" ) - create_single_source_cgal_program( "info_insert_with_pair_iterator.cpp" ) - create_single_source_cgal_program( "info_insert_with_pair_iterator_regular.cpp" ) - create_single_source_cgal_program( "info_insert_with_transform_iterator.cpp" ) - create_single_source_cgal_program( "info_insert_with_zip_iterator.cpp" ) - create_single_source_cgal_program( "regular_3.cpp" ) - create_single_source_cgal_program( "regular_with_info_3.cpp" ) - create_single_source_cgal_program( "simple_triangulation_3.cpp" ) - create_single_source_cgal_program( "simplex.cpp" ) +create_single_source_cgal_program("for_loop.cpp") +create_single_source_cgal_program("adding_handles_3.cpp") +create_single_source_cgal_program("color.cpp") +create_single_source_cgal_program("copy_triangulation_3.cpp") +create_single_source_cgal_program("fast_location_3.cpp") +create_single_source_cgal_program("find_conflicts_3.cpp") +create_single_source_cgal_program("info_insert_with_pair_iterator.cpp") +create_single_source_cgal_program("info_insert_with_pair_iterator_regular.cpp") +create_single_source_cgal_program("info_insert_with_transform_iterator.cpp") +create_single_source_cgal_program("info_insert_with_zip_iterator.cpp") +create_single_source_cgal_program("regular_3.cpp") +create_single_source_cgal_program("regular_with_info_3.cpp") +create_single_source_cgal_program("simple_triangulation_3.cpp") +create_single_source_cgal_program("simplex.cpp") - create_single_source_cgal_program("draw_triangulation_3.cpp") - if(CGAL_Qt5_FOUND) - target_link_libraries(draw_triangulation_3 PUBLIC CGAL::CGAL_Qt5) - endif() +create_single_source_cgal_program("draw_triangulation_3.cpp") +if(CGAL_Qt5_FOUND) + target_link_libraries(draw_triangulation_3 PUBLIC CGAL::CGAL_Qt5) +endif() - find_package( TBB QUIET ) - include(CGAL_TBB_support) - - if( TARGET CGAL::TBB_support ) - create_single_source_cgal_program( "parallel_insertion_and_removal_in_regular_3.cpp" ) - create_single_source_cgal_program( "parallel_insertion_in_delaunay_3.cpp" ) - create_single_source_cgal_program( "sequential_parallel.cpp" ) - target_link_libraries( parallel_insertion_and_removal_in_regular_3 PUBLIC CGAL::TBB_support) - target_link_libraries( parallel_insertion_in_delaunay_3 PUBLIC CGAL::TBB_support ) - target_link_libraries( sequential_parallel PUBLIC CGAL::TBB_support) - else() - message(STATUS "NOTICE: a few examples require TBB and will not be compiled.") - endif() +find_package(TBB QUIET) +include(CGAL_TBB_support) +if(TARGET CGAL::TBB_support) + create_single_source_cgal_program( + "parallel_insertion_and_removal_in_regular_3.cpp") + create_single_source_cgal_program("parallel_insertion_in_delaunay_3.cpp") + create_single_source_cgal_program("sequential_parallel.cpp") + target_link_libraries(parallel_insertion_and_removal_in_regular_3 + PUBLIC CGAL::TBB_support) + target_link_libraries(parallel_insertion_in_delaunay_3 + PUBLIC CGAL::TBB_support) + target_link_libraries(sequential_parallel PUBLIC CGAL::TBB_support) else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - + message(STATUS "NOTICE: a few examples require TBB and will not be compiled.") endif() diff --git a/Triangulation_3/test/Triangulation_3/CMakeLists.txt b/Triangulation_3/test/Triangulation_3/CMakeLists.txt index 4dfcc8c4bb5..a429b925651 100644 --- a/Triangulation_3/test/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/test/Triangulation_3/CMakeLists.txt @@ -1,57 +1,45 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Triangulation_3_Tests ) +project(Triangulation_3_Tests) +find_package(CGAL REQUIRED) +find_package(TBB QUIET) +include(CGAL_TBB_support) -find_package(CGAL QUIET) +include_directories(BEFORE "include") -if ( CGAL_FOUND ) - - find_package( TBB QUIET ) - include(CGAL_TBB_support) - - include_directories (BEFORE "include") - - create_single_source_cgal_program( "test_delaunay_3.cpp" ) - create_single_source_cgal_program( "test_delaunay_hierarchy_3.cpp" ) - create_single_source_cgal_program( "test_delaunay_hierarchy_3_old.cpp" ) - create_single_source_cgal_program( "test_regular_3.cpp" ) - create_single_source_cgal_program( "test_regular_as_delaunay_3.cpp" ) - create_single_source_cgal_program( "test_regular_insert_range_with_info.cpp" ) - create_single_source_cgal_program( "test_regular_remove_3.cpp" ) - create_single_source_cgal_program( "test_regular_traits_3.cpp" ) - create_single_source_cgal_program( "test_RT_cell_base_with_weighted_circumcenter_3.cpp" ) - 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_static_filters.cpp" ) - create_single_source_cgal_program( "test_triangulation_3.cpp" ) - create_single_source_cgal_program( "test_io_triangulation_3.cpp" ) - - if(TARGET CGAL::TBB_support) - foreach(target - test_delaunay_3 - test_regular_3 - test_regular_insert_range_with_info) - target_link_libraries(${target} PUBLIC CGAL::TBB_support) - endforeach() - endif() - - if(BUILD_TESTING) - set_tests_properties( - execution___of__test_delaunay_hierarchy_3 - execution___of__test_delaunay_hierarchy_3_old - execution___of__test_regular_as_delaunay_3 - execution___of__test_triangulation_3 - execution___of__test_delaunay_3 - PROPERTIES RESOURCE_LOCK Triangulation_3_Tests_IO) - endif() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +create_single_source_cgal_program("test_delaunay_3.cpp") +create_single_source_cgal_program("test_delaunay_hierarchy_3.cpp") +create_single_source_cgal_program("test_delaunay_hierarchy_3_old.cpp") +create_single_source_cgal_program("test_regular_3.cpp") +create_single_source_cgal_program("test_regular_as_delaunay_3.cpp") +create_single_source_cgal_program("test_regular_insert_range_with_info.cpp") +create_single_source_cgal_program("test_regular_remove_3.cpp") +create_single_source_cgal_program("test_regular_traits_3.cpp") +create_single_source_cgal_program( + "test_RT_cell_base_with_weighted_circumcenter_3.cpp") +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_static_filters.cpp") +create_single_source_cgal_program("test_triangulation_3.cpp") +create_single_source_cgal_program("test_io_triangulation_3.cpp") +if(TARGET CGAL::TBB_support) + foreach(target test_delaunay_3 test_regular_3 + test_regular_insert_range_with_info) + target_link_libraries(${target} PUBLIC CGAL::TBB_support) + endforeach() +endif() + +if(BUILD_TESTING) + set_tests_properties( + execution___of__test_delaunay_hierarchy_3 + execution___of__test_delaunay_hierarchy_3_old + execution___of__test_regular_as_delaunay_3 + execution___of__test_triangulation_3 + execution___of__test_delaunay_3 + PROPERTIES RESOURCE_LOCK Triangulation_3_Tests_IO) endif() diff --git a/Union_find/test/Union_find/CMakeLists.txt b/Union_find/test/Union_find/CMakeLists.txt index 8de99fe5804..d4e07dff434 100644 --- a/Union_find/test/Union_find/CMakeLists.txt +++ b/Union_find/test/Union_find/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Union_find_Tests ) +project(Union_find_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Visibility_2/examples/Visibility_2/CMakeLists.txt b/Visibility_2/examples/Visibility_2/CMakeLists.txt index 0d54083a8c6..76b36d7d78b 100644 --- a/Visibility_2/examples/Visibility_2/CMakeLists.txt +++ b/Visibility_2/examples/Visibility_2/CMakeLists.txt @@ -1,24 +1,16 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Visibility_2_Examples ) +project(Visibility_2_Examples) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() - +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Visibility_2/test/Visibility_2/CMakeLists.txt b/Visibility_2/test/Visibility_2/CMakeLists.txt index ed3e5fff99f..704102c1baf 100644 --- a/Visibility_2/test/Visibility_2/CMakeLists.txt +++ b/Visibility_2/test/Visibility_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Visibility_2_Tests ) +project(Visibility_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() diff --git a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt index 29efc2ca19e..8827b78b94c 100644 --- a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt @@ -1,33 +1,24 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Voronoi_diagram_2_Examples ) +project(Voronoi_diagram_2_Examples) - -find_package(CGAL COMPONENTS Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) if(CGAL_Qt5_FOUND) add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS) endif() -if ( CGAL_FOUND ) - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - - if(CGAL_Qt5_FOUND ) - target_link_libraries(draw_voronoi_diagram_2 PUBLIC CGAL::CGAL_Qt5) - endif() - - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() +if(CGAL_Qt5_FOUND) + target_link_libraries(draw_voronoi_diagram_2 PUBLIC CGAL::CGAL_Qt5) endif() - diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt index 7ffc0676de0..67283a33554 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt @@ -1,26 +1,18 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. - cmake_minimum_required(VERSION 3.1...3.15) -project( Voronoi_diagram_2_Tests ) +project(Voronoi_diagram_2_Tests) +find_package(CGAL REQUIRED) -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - include_directories (BEFORE "include") - - # create a target per cppfile - file(GLOB cppfiles RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - foreach(cppfile ${cppfiles}) - create_single_source_cgal_program( "${cppfile}" ) - endforeach() - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +include_directories(BEFORE "include") +# create a target per cppfile +file( + GLOB cppfiles + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +foreach(cppfile ${cppfiles}) + create_single_source_cgal_program("${cppfile}") +endforeach() From 6b4734feff38420a82d6f0367dd2142a8144f9a3 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Tue, 27 Oct 2020 10:39:40 +0100 Subject: [PATCH 2/8] trailing whitespaces --- Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt | 2 +- Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt index d74d1f69e52..438f591f419 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Mesh_3/CMakeLists.txt @@ -63,7 +63,7 @@ if(Boost_FILESYSTEM_FOUND) Volume_plane_intersection.cpp Raw_image_dialog.cpp ${imgUI_FILES} - ${VOLUME_MOC_OUTFILES} + ${VOLUME_MOC_OUTFILES} KEYWORDS Viewer Mesh_3) target_link_libraries(io_image_plugin PUBLIC scene_image_item ${VTK_LIBRARIES} CGAL::CGAL_ImageIO) if(VTK_LIBRARIES) diff --git a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt index bdc80c74f06..94e8db68642 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/PMP/CMakeLists.txt @@ -46,7 +46,7 @@ if(TARGET CGAL::Eigen_support) target_compile_definitions( smoothing_plugin PRIVATE CGAL_PMP_USE_CERES_SOLVER ) target_link_libraries(smoothing_plugin PUBLIC ceres) endif() - + set_package_properties( Ceres PROPERTIES DESCRIPTION "A large scale non-linear optimization library." From aa26d7a58b14a2f6de730d0f7c9cdb39bf23465f Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Wed, 28 Oct 2020 08:45:29 +0100 Subject: [PATCH 3/8] Fix merging error --- Installation/test/Installation/CMakeLists.txt | 9 --------- 1 file changed, 9 deletions(-) diff --git a/Installation/test/Installation/CMakeLists.txt b/Installation/test/Installation/CMakeLists.txt index c3ad78f74ae..f22bddd7708 100644 --- a/Installation/test/Installation/CMakeLists.txt +++ b/Installation/test/Installation/CMakeLists.txt @@ -83,15 +83,6 @@ if(WITH_CGAL_Qt5) endif() endif() -if(WIN32 OR CMAKE_SYSTEM_NAME STREQUAL Windows) - add_executable(display_dll_version_info display_dll_version_info.cpp) - target_link_libraries(display_dll_version_info version) - add_executable(test_gmp_mpfr_dll test_gmp_mpfr_dll.cpp) - target_link_libraries(test_gmp_mpfr_dll version) - cgal_add_test(test_gmp_mpfr_dll) - add_to_cached_list(CGAL_EXECUTABLE_TARGETS test_gmp_mpfr_dll) -endif() - find_package(LEDA QUIET) if(LEDA_FOUND) include(${LEDA_USE_FILE}) From e6c237bad37f235e3cecb8e762231f14b40807a4 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 30 Oct 2020 11:04:11 +0100 Subject: [PATCH 4/8] FIX --- .../CMakeLists.txt | 40 +------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt index 568a4005a1c..d65ecb7d1f0 100644 --- a/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt +++ b/Poisson_surface_reconstruction_3/test/Poisson_surface_reconstruction_3/CMakeLists.txt @@ -4,7 +4,6 @@ cmake_minimum_required(VERSION 3.1...3.15) project(Poisson_surface_reconstruction_3_Tests) # Find CGAL -<<<<<<< HEAD find_package(CGAL REQUIRED) # VisualC++ optimization for applications dealing with large data @@ -29,32 +28,13 @@ if(MSVC) "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" ) endif() -======= -find_package(CGAL QUIET) - -if ( CGAL_FOUND ) - - # VisualC++ optimization for applications dealing with large data - if (MSVC) - # Allow Windows 32bit applications to use up to 3GB of RAM - SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") - - # Prints new compilation options - message( STATUS "USING DEBUG CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG}'" ) - message( STATUS "USING DEBUG EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_DEBUG}'" ) - message( STATUS "USING RELEASE CXXFLAGS = '${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE}'" ) - message( STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" ) - endif() - # Temporary debugging stuff - find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) include(CGAL_Eigen_support) if(TARGET CGAL::Eigen_support) # Executables that require Eigen 3.1 - create_single_source_cgal_program( "poisson_reconstruction_test.cpp" ) + create_single_source_cgal_program("poisson_reconstruction_test.cpp") target_link_libraries(poisson_reconstruction_test PUBLIC CGAL::Eigen_support) - find_package(TBB) include(CGAL_TBB_support) if (TBB_FOUND) @@ -64,23 +44,5 @@ if ( CGAL_FOUND ) message(STATUS "NOTICE: test with parallel Mesh_3 needs TBB and will not be compiled.") endif() else() - message(STATUS "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled.") ->>>>>>> cgal/master - -# Temporary debugging stuff - -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) -include(CGAL_Eigen_support) -if(TARGET CGAL::Eigen_support) - # Executables that require Eigen 3.1 - create_single_source_cgal_program("poisson_reconstruction_test.cpp") - target_link_libraries(poisson_reconstruction_test PUBLIC CGAL::Eigen_support) -else() - - message( - STATUS - "NOTICE: Some of the executables in this directory need Eigen 3.1 (or greater) and will not be compiled." - ) - endif() From 933522afdcdcbe7b95e7f4aa09b0ed0d9a1695a8 Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 6 Nov 2020 09:29:11 +0100 Subject: [PATCH 5/8] Silter CMP0115 warning --- Polyhedron/demo/Polyhedron/CMakeLists.txt | 3 +++ .../demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt | 3 +++ Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt | 3 +++ 3 files changed, 9 insertions(+) diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index 75c53e0c8b0..9243abaea8c 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -17,6 +17,9 @@ if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() +if(POLICY CMP0115) + cmake_policy(SET CMP0115 OLD) +endif() include(FeatureSummary) # Find includes in corresponding build directories diff --git a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt index 6cde165b88d..9cc582b653c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt @@ -5,6 +5,9 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. cmake_policy(SET CMP0053 OLD) endif() +if(POLICY CMP0115) + cmake_policy(SET CMP0115 OLD) +endif() # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. diff --git a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt index 4d84a65f7e1..5db48752673 100644 --- a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt @@ -13,6 +13,9 @@ if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() +if(POLICY CMP0115) + cmake_policy(SET CMP0115 OLD) +endif() # Let plugins be compiled in the same directory as the executable. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") From 25e65bcedacdad2f5f4645f695cda65da0994b31 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 6 Nov 2020 10:48:19 +0100 Subject: [PATCH 6/8] partial fix of CMP0115 --- Polyhedron/demo/Polyhedron/CMakeLists.txt | 3 --- .../demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt | 2 +- .../demo/Polyhedron/Plugins/Classification/CMakeLists.txt | 6 +++--- .../demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt | 3 --- .../demo/Polyhedron/implicit_functions/CMakeLists.txt | 3 --- 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index ce3e8f7727b..d57be49c9e1 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -17,9 +17,6 @@ if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() -if(POLICY CMP0115) - cmake_policy(SET CMP0115 OLD) -endif() include(FeatureSummary) # Find includes in corresponding build directories diff --git a/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt index e772b94b01c..d3d02304559 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Camera_position/CMakeLists.txt @@ -3,7 +3,7 @@ include( polyhedron_demo_macros ) qt5_wrap_ui( cameraUI_FILES Camera_positions_list.ui ) polyhedron_demo_plugin(camera_positions_plugin Camera_positions_plugin - Camera_positions_list + Camera_positions_list.cpp ${cameraUI_FILES} KEYWORDS Viewer) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt index c106c536c74..ed1d4c80cdc 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt @@ -59,9 +59,9 @@ if(TARGET CGAL::Eigen_support) polyhedron_demo_plugin( classification_plugin Classification_plugin - Point_set_item_classification - Cluster_classification - Surface_mesh_item_classification + Point_set_item_classification.cpp + Cluster_classification.cpp + Surface_mesh_item_classification.cpp ${classificationUI_FILES} KEYWORDS Classification) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt index 9cc582b653c..6cde165b88d 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Three_examples/CMakeLists.txt @@ -5,9 +5,6 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053) # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. cmake_policy(SET CMP0053 OLD) endif() -if(POLICY CMP0115) - cmake_policy(SET CMP0115 OLD) -endif() # Find includes in corresponding build directories set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. diff --git a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt index 5db48752673..4d84a65f7e1 100644 --- a/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/implicit_functions/CMakeLists.txt @@ -13,9 +13,6 @@ if(POLICY CMP0074) cmake_policy(SET CMP0074 NEW) endif() -if(POLICY CMP0115) - cmake_policy(SET CMP0115 OLD) -endif() # Let plugins be compiled in the same directory as the executable. set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") From cc3cb3c18d0b431d22a0924d2edefdadde3c330a Mon Sep 17 00:00:00 2001 From: Maxime Gimeno Date: Fri, 6 Nov 2020 11:54:26 +0100 Subject: [PATCH 7/8] Finish adding missing `.cpp` in cmakelists of polyhedron_demo --- .../demo/Polyhedron/Plugins/Point_set/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt index ad05661274e..39d5e3f1124 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt @@ -33,10 +33,10 @@ if(TARGET CGAL::Eigen_support) polyhedron_demo_plugin( surface_reconstruction_plugin Surface_reconstruction_plugin - Surface_reconstruction_poisson_impl - Surface_reconstruction_advancing_front_impl - Surface_reconstruction_scale_space_impl - Surface_reconstruction_polygonal_impl + Surface_reconstruction_poisson_impl.cpp + Surface_reconstruction_advancing_front_impl.cpp + Surface_reconstruction_scale_space_impl.cpp + Surface_reconstruction_polygonal_impl.cpp ${surface_reconstructionUI_FILES} KEYWORDS PointSetProcessing) From 20619a586b33c313ebaacc93544924d3e6c6be30 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Fri, 6 Nov 2020 12:54:19 +0100 Subject: [PATCH 8/8] Finish with the last one --- Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt index d1e2abea1e5..1b5367ac64c 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh/CMakeLists.txt @@ -54,7 +54,7 @@ target_link_libraries( qt5_wrap_ui(basicUI_FILES Surface_mesh_approximation_dockwidget.ui) polyhedron_demo_plugin( surface_mesh_approximation_plugin Surface_mesh_approximation_plugin - ${basicUI_FILES} VSA_wrapper) + ${basicUI_FILES} VSA_wrapper.cpp) target_link_libraries( surface_mesh_approximation_plugin PUBLIC scene_surface_mesh_item scene_polygon_soup_item scene_polylines_item)