# Created by the script cgal_create_cmake_script
# This is the CMake script for compiling a CGAL application.

cmake_minimum_required(VERSION 3.12...3.31)
project(Generator_Examples)

find_package(CGAL REQUIRED)

create_single_source_cgal_program("ball_d.cpp")
create_single_source_cgal_program("combination_enumerator.cpp")
create_single_source_cgal_program("cube_d.cpp")
create_single_source_cgal_program("grid_d.cpp")
create_single_source_cgal_program("name_pairs.cpp")
create_single_source_cgal_program("random_convex_hull_2.cpp")
create_single_source_cgal_program("random_convex_set.cpp")
create_single_source_cgal_program("random_degenerate_point_set.cpp")
create_single_source_cgal_program("random_grid.cpp")
create_single_source_cgal_program("random_points_23.cpp")
create_single_source_cgal_program("random_points_in_triangles_2.cpp")
create_single_source_cgal_program("random_points_in_triangles_3.cpp")
create_single_source_cgal_program("random_points_on_triangle_mesh_2.cpp")
create_single_source_cgal_program("random_points_on_triangle_mesh_3.cpp")
create_single_source_cgal_program("random_points_tetrahedron_and_triangle_3.cpp")
create_single_source_cgal_program("random_points_triangle_2.cpp")
create_single_source_cgal_program("random_polygon2.cpp")
create_single_source_cgal_program("random_polygon.cpp")
create_single_source_cgal_program("random_segments1.cpp")
create_single_source_cgal_program("random_segments2.cpp")
create_single_source_cgal_program("sphere_d.cpp")

find_package(Eigen3 QUIET)
include(CGAL_Eigen3_support)

if(TARGET CGAL::Eigen3_support)
  create_single_source_cgal_program("random_points_in_tetrahedral_mesh_3.cpp")
  target_link_libraries(random_points_in_tetrahedral_mesh_3 PRIVATE CGAL::Eigen3_support)
  create_single_source_cgal_program("random_points_on_tetrahedral_mesh_3.cpp")
  target_link_libraries(random_points_on_tetrahedral_mesh_3 PRIVATE CGAL::Eigen3_support)
else()
  message(STATUS "NOTICE: Some examples use Eigen, and will not be compiled.")
endif()
