diff --git a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt index 3a314302b01..b6ae8fdc0e2 100644 --- a/AABB_tree/benchmark/AABB_tree/CMakeLists.txt +++ b/AABB_tree/benchmark/AABB_tree/CMakeLists.txt @@ -6,14 +6,14 @@ project(AABB_traits_benchmark) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) -# google benchmark -find_package(benchmark) +create_single_source_cgal_program("test.cpp") +create_single_source_cgal_program("tree_construction.cpp") -if (benchmark_FOUND) +# google benchmark +find_package(benchmark QUIET) +if(benchmark_FOUND) create_single_source_cgal_program("tree_creation.cpp") target_link_libraries(tree_creation benchmark::benchmark) else() message(STATUS "NOTICE: The benchmark 'tree_creation.cpp' requires the Google benchmark library, and will not be compiled.") endif() -create_single_source_cgal_program("test.cpp") -create_single_source_cgal_program("tree_construction.cpp") diff --git a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt index fca83423fa4..c1fd8d009f6 100644 --- a/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt +++ b/Algebraic_kernel_d/examples/Algebraic_kernel_d/CMakeLists.txt @@ -3,8 +3,7 @@ project(Algebraic_kernel_d_Examples) find_package(CGAL REQUIRED COMPONENTS Core) -find_package(MPFI QUIET) - +find_package(MPFI) if(MPFI_FOUND AND NOT CGAL_DISABLE_GMP) include(${MPFI_USE_FILE}) create_single_source_cgal_program("Compare_1.cpp") diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt index cb56ac2bc55..08d054ea54c 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt +++ b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt @@ -6,7 +6,7 @@ project(Arithmetic_kernel_Tests) find_package(CGAL REQUIRED COMPONENTS Core) -find_package(GMP QUIET) +find_package(GMP) if(GMP_FOUND) @@ -18,7 +18,7 @@ if(GMP_FOUND) include_directories(include) - find_package(MPFI) + find_package(MPFI QUIET) if(MPFI_FOUND) include(${MPFI_USE_FILE}) 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 8574cef2a18..82e33197dae 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 @@ -12,10 +12,10 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL QUIET COMPONENTS Qt5 OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core Qt5) find_package(Qt5 QUIET COMPONENTS Gui Widgets) -if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) +if (CGAL_Qt5_FOUND AND Qt5_FOUND) include(${CGAL_USE_FILE}) add_compile_definitions(QT_NO_KEYWORDS) include_directories( BEFORE ./ ) @@ -110,10 +110,10 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND) ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - target_link_libraries(arrangement_2 Qt5::Core Qt5::Gui Qt5::Widgets) - target_link_libraries(arrangement_2 CGAL::CGAL CGAL::CGAL_Qt5) + target_link_libraries(arrangement_2 PRIVATE Qt5::Core Qt5::Gui Qt5::Widgets) + target_link_libraries(arrangement_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5) if(CGAL_Core_FOUND) - target_link_libraries(arrangement_2 CGAL::CGAL_Core) + target_link_libraries(arrangement_2 PRIVATE CGAL::CGAL_Core) endif() add_to_cached_list(CGAL_EXECUTABLE_TARGETS arrangement_2) diff --git a/BGL/examples/BGL_OpenMesh/CMakeLists.txt b/BGL/examples/BGL_OpenMesh/CMakeLists.txt index 45babdf9fed..aa4e0e208f2 100644 --- a/BGL/examples/BGL_OpenMesh/CMakeLists.txt +++ b/BGL/examples/BGL_OpenMesh/CMakeLists.txt @@ -7,7 +7,7 @@ project(BGL_OpenMesh_Examples) # CGAL and its components find_package(CGAL REQUIRED) -find_package(OpenMesh QUIET) +find_package(OpenMesh) if(OpenMesh_FOUND) include(UseOpenMesh) create_single_source_cgal_program("TriMesh.cpp") diff --git a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt index 5a541371584..31f3a4f2d51 100644 --- a/BGL/examples/BGL_polyhedron_3/CMakeLists.txt +++ b/BGL/examples/BGL_polyhedron_3/CMakeLists.txt @@ -15,21 +15,20 @@ create_single_source_cgal_program("normals.cpp") create_single_source_cgal_program("range.cpp") create_single_source_cgal_program("transform_iterator.cpp") -create_single_source_cgal_program("copy_polyhedron.cpp") - -find_package( OpenMesh QUIET ) +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) - target_link_libraries( copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES} ) - target_compile_definitions( copy_polyhedron PRIVATE -DCGAL_USE_OPENMESH ) + create_single_source_cgal_program("copy_polyhedron.cpp") + target_link_libraries(copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES}) + target_compile_definitions(copy_polyhedron PRIVATE -DCGAL_USE_OPENMESH) else() message(STATUS "NOTICE: The example 'copy_polyhedron' requires OpenMesh, and will not be compiled.") endif() -find_package( METIS ) +find_package(METIS QUIET) include(CGAL_METIS_support) -if( TARGET CGAL::METIS_support ) - create_single_source_cgal_program( "polyhedron_partition.cpp" ) - target_link_libraries( polyhedron_partition PUBLIC CGAL::METIS_support) +if(TARGET CGAL::METIS_support) + create_single_source_cgal_program("polyhedron_partition.cpp") + target_link_libraries(polyhedron_partition PUBLIC CGAL::METIS_support) else() message(STATUS "NOTICE: The example 'polyhedron_partition' requires the METIS library, and will not be compiled.") endif() diff --git a/BGL/examples/BGL_surface_mesh/CMakeLists.txt b/BGL/examples/BGL_surface_mesh/CMakeLists.txt index 1056de28413..551484979a1 100644 --- a/BGL/examples/BGL_surface_mesh/CMakeLists.txt +++ b/BGL/examples/BGL_surface_mesh/CMakeLists.txt @@ -10,11 +10,11 @@ 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 QUIET) include(CGAL_METIS_support) -if( TARGET CGAL::METIS_support ) - create_single_source_cgal_program( "surface_mesh_partition.cpp" ) - target_link_libraries( surface_mesh_partition PUBLIC CGAL::METIS_support ) +if(TARGET CGAL::METIS_support) + create_single_source_cgal_program("surface_mesh_partition.cpp") + target_link_libraries(surface_mesh_partition PUBLIC CGAL::METIS_support) else() message(STATUS "NOTICE: Examples that use the METIS library will not be compiled.") endif() diff --git a/BGL/test/BGL/CMakeLists.txt b/BGL/test/BGL/CMakeLists.txt index 30b6aaf28d0..3f81213dd21 100644 --- a/BGL/test/BGL/CMakeLists.txt +++ b/BGL/test/BGL/CMakeLists.txt @@ -7,18 +7,6 @@ project(BGL_Tests) # CGAL and its components find_package(CGAL REQUIRED) -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) - add_definitions(-DCGAL_USE_OPENMESH) -else() - message(STATUS "Tests that use OpenMesh will not be compiled.") -endif() -if(OpenMesh_FOUND) - create_single_source_cgal_program("graph_concept_OpenMesh.cpp") - target_link_libraries(graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) -endif() create_single_source_cgal_program("test_split.cpp") create_single_source_cgal_program("next.cpp") create_single_source_cgal_program("test_circulator.cpp") @@ -52,7 +40,11 @@ create_single_source_cgal_program("bench_read_from_stream_vs_add_face_and_add_fa create_single_source_cgal_program("graph_traits_inheritance.cpp" ) create_single_source_cgal_program("test_deprecated_io.cpp") +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) + add_definitions(-DCGAL_USE_OPENMESH) + target_link_libraries(test_clear PRIVATE ${OPENMESH_LIBRARIES}) target_compile_definitions(test_clear PRIVATE -DCGAL_USE_OPENMESH) target_link_libraries(test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES}) @@ -67,6 +59,11 @@ if(OpenMesh_FOUND) target_compile_definitions(test_Properties PRIVATE -DCGAL_USE_OPENMESH) target_link_libraries(test_bgl_read_write PRIVATE ${OPENMESH_LIBRARIES}) target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_OPENMESH) + + create_single_source_cgal_program("graph_concept_OpenMesh.cpp") + target_link_libraries(graph_concept_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: Tests that use OpenMesh will not be compiled.") endif() find_package(VTK QUIET COMPONENTS vtkCommonCore vtkIOCore vtkIOLegacy vtkIOXML vtkFiltersCore vtkFiltersSources) diff --git a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt index 81d14bb28d7..0a032673863 100644 --- a/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt +++ b/Box_intersection_d/test/Box_intersection_d/CMakeLists.txt @@ -6,15 +6,14 @@ project(Box_intersection_d_Tests) find_package(CGAL REQUIRED) -find_package(TBB) -include(CGAL_TBB_support) - 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("test_Has_member_report.cpp") +find_package(TBB QUIET) +include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) target_link_libraries(test_box_grid PUBLIC CGAL::TBB_support) else() diff --git a/Classification/examples/Classification/CMakeLists.txt b/Classification/examples/Classification/CMakeLists.txt index 83cc5c6149d..3901b756407 100644 --- a/Classification/examples/Classification/CMakeLists.txt +++ b/Classification/examples/Classification/CMakeLists.txt @@ -23,29 +23,20 @@ if(NOT TARGET CGAL::Boost_iostreams_support) 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." - ) -endif() - -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) message("NOTICE: 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) return() endif() +find_package(TBB QUIET) +include(CGAL_TBB_support) + 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" ) @@ -55,10 +46,13 @@ create_single_source_cgal_program( "example_cluster_classification.cpp" ) create_single_source_cgal_program( "gis_tutorial_example.cpp" ) create_single_source_cgal_program( "example_deprecated_conversion.cpp" ) -if (TARGET CGAL::OpenCV_support) +find_package(OpenCV QUIET COMPONENTS core ml) # Need core + machine learning +include(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) + target_link_libraries(example_opencv_random_forest PUBLIC CGAL::OpenCV_support) +else() + message("NOTICE: OpenCV was not found. OpenCV random forest predicate for classification won't be available.") endif() foreach(target @@ -72,9 +66,9 @@ foreach(target gis_tutorial_example example_deprecated_conversion) if(TARGET ${target}) - target_link_libraries( - ${target} PUBLIC CGAL::Eigen3_support CGAL::Boost_iostreams_support - CGAL::Boost_serialization_support) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_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 d785190f8cb..c2a8f3211dc 100644 --- a/Classification/test/Classification/CMakeLists.txt +++ b/Classification/test/Classification/CMakeLists.txt @@ -23,20 +23,20 @@ if(NOT TARGET CGAL::Boost_iostreams_support) set(Classification_dependencies_met FALSE) endif() -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) message("NOTICE: 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) return() endif() +find_package(TBB QUIET) +include(CGAL_TBB_support) + create_single_source_cgal_program("test_classification_point_set.cpp") create_single_source_cgal_program("test_classification_io.cpp") diff --git a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt index 94b110c4ac7..898951705f9 100644 --- a/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt +++ b/Combinatorial_map/test/Combinatorial_map/CMakeLists.txt @@ -28,5 +28,9 @@ cgal_add_compilation_test(Combinatorial_map_copy_test_index) find_package(OpenMesh QUIET) if(TARGET OpenMesh::OpenMesh) target_link_libraries(Combinatorial_map_copy_test PRIVATE OpenMesh::OpenMesh) + target_compile_definitions(Combinatorial_map_copy_test PRIVATE -DCGAL_USE_OPENMESH) target_link_libraries(Combinatorial_map_copy_test_index PRIVATE OpenMesh::OpenMesh) + target_compile_definitions(Combinatorial_map_copy_test_index PRIVATE -DCGAL_USE_OPENMESH) +else() + message(STATUS "NOTICE: Tests will not use 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 06592fa2548..ded37dfad08 100644 --- a/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/examples/Cone_spanners_2/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Cone_spanners_2_Examples) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) find_package(LEDA QUIET) if(CGAL_Core_FOUND OR LEDA_FOUND) diff --git a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt index ac3d47b8f6d..462edfc7819 100644 --- a/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt +++ b/Cone_spanners_2/test/Cone_spanners_2/CMakeLists.txt @@ -6,23 +6,11 @@ project(Cone_spanners_2_Tests) find_package(CGAL REQUIRED COMPONENTS Core) -if(CGAL_Core_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 and CGAL_Core libraries, 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_3/examples/Convex_hull_3/CMakeLists.txt b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt index 55bc102f967..bfb1068c315 100644 --- a/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt +++ b/Convex_hull_3/examples/Convex_hull_3/CMakeLists.txt @@ -7,13 +7,6 @@ project(Convex_hull_3_Examples) # CGAL and its components find_package(CGAL REQUIRED) -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("quickhull_indexed_triangle_set_3.cpp") create_single_source_cgal_program("dynamic_hull_3.cpp") create_single_source_cgal_program("dynamic_hull_LCC_3.cpp") @@ -26,11 +19,13 @@ 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") +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) - create_single_source_cgal_program("quickhull_OM_3.cpp") - create_single_source_cgal_program("dynamic_hull_OM_3.cpp") + include(UseOpenMesh) + create_single_source_cgal_program("quickhull_OM_3.cpp") target_link_libraries(quickhull_OM_3 PRIVATE ${OPENMESH_LIBRARIES}) + create_single_source_cgal_program("dynamic_hull_OM_3.cpp") target_link_libraries(dynamic_hull_OM_3 PRIVATE ${OPENMESH_LIBRARIES}) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") diff --git a/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt b/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt index 44baf0d84aa..68318652bdc 100644 --- a/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt +++ b/Documentation/doc/Documentation/Developer_manual/create_and_use_a_cmakelist.txt @@ -14,7 +14,7 @@ target_link_libraries(my_executable CGAL::CGAL) Other \cgal libraries are linked similarly. For example, with `CGAL_Core`: \code -find_package(CGAL REQUIRED COMPONENTS Core) +find_package(CGAL COMPONENTS Core) target_link_libraries(my_executable CGAL::CGAL CGAL::CGAL_Core) \endcode diff --git a/Generator/benchmark/Generator/CMakeLists.txt b/Generator/benchmark/Generator/CMakeLists.txt index 37b35229acf..7cc0116c64b 100644 --- a/Generator/benchmark/Generator/CMakeLists.txt +++ b/Generator/benchmark/Generator/CMakeLists.txt @@ -6,12 +6,17 @@ project(Generator_example) find_package(CGAL REQUIRED COMPONENTS Core) -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") +find_package(Boost COMPONENTS program_options) +if(Boost_PROGRAM_OPTIONS_FOUND) + create_single_source_cgal_program("random_grid.cpp") + create_single_source_cgal_program("random_disc_2.cpp") + if(TARGET Boost::program_options) + target_link_libraries(random_grid PRIVATE Boost::program_options) + target_link_libraries(random_disc_2 PRIVATE Boost::program_options) + else() + target_link_libraries(random_grid PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) + target_link_libraries(random_disc_2 PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) + endif() +else() + message("NOTICE: The benchmarks requires Boost Program Options, and will not be compiled.") +endif() diff --git a/Generator/examples/Generator/CMakeLists.txt b/Generator/examples/Generator/CMakeLists.txt index f9239ce0dbb..0e9f4189a2e 100644 --- a/Generator/examples/Generator/CMakeLists.txt +++ b/Generator/examples/Generator/CMakeLists.txt @@ -6,23 +6,34 @@ project(Generator_Examples) find_package(CGAL REQUIRED) -# Use Eigen +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_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 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_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::Eigen3_support) - create_single_source_cgal_program("${cppfile}") - if(TARGET CGAL::Eigen3_support) - get_filename_component(target ${cppfile} NAME_WE) - target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) - endif() - endif() -endforeach() +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() diff --git a/Generator/test/Generator/CMakeLists.txt b/Generator/test/Generator/CMakeLists.txt index 50edd9f6e5c..5bd1befed5e 100644 --- a/Generator/test/Generator/CMakeLists.txt +++ b/Generator/test/Generator/CMakeLists.txt @@ -6,22 +6,20 @@ project(Generator_Tests) find_package(CGAL REQUIRED) -# Use Eigen +create_single_source_cgal_program("random_hull_test.cpp") +create_single_source_cgal_program("random_poly_test.cpp") +create_single_source_cgal_program("rcs_test.cpp") +create_single_source_cgal_program("test_combination_enumerator.cpp") +create_single_source_cgal_program("test_generators.cpp") +create_single_source_cgal_program("test_tetrahedron_3.cpp") +create_single_source_cgal_program("test_triangle_2.cpp") +create_single_source_cgal_program("test_triangle_3.cpp") + find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_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::Eigen3_support) - create_single_source_cgal_program("${cppfile}") - if(TARGET CGAL::Eigen3_support) - get_filename_component(target ${cppfile} NAME_WE) - target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) - endif() - endif() -endforeach() +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program("generic_random_test.cpp") + target_link_libraries(generic_random_test PRIVATE CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: The test 'generic_random_test' uses Eigen, and will not be compiled.") +endif() diff --git a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt index b61e95c544a..fbdf3791ccb 100644 --- a/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt +++ b/Hyperbolic_triangulation_2/demo/Hyperbolic_triangulation_2/CMakeLists.txt @@ -11,7 +11,7 @@ if(POLICY CMP0071) cmake_policy(SET CMP0071 NEW) endif() -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core Qt5) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core Qt5) find_package(LEDA QUIET) # Find Qt5 itself diff --git a/Kernel_23/benchmark/Kernel_23/CMakeLists.txt b/Kernel_23/benchmark/Kernel_23/CMakeLists.txt index 409561c1b6e..862b98b2152 100644 --- a/Kernel_23/benchmark/Kernel_23/CMakeLists.txt +++ b/Kernel_23/benchmark/Kernel_23/CMakeLists.txt @@ -2,11 +2,8 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.23) -project( benchmark ) +project(Kernel_23_benchmark) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core ) - - include_directories (BEFORE "../include") +find_package(CGAL QUIET OPTIONAL_COMPONENTS Core) create_single_source_cgal_program( "cmp_epeck_points.cpp" ) - diff --git a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt index 26d56becb15..50b7730178e 100644 --- a/Mesh_3/benchmark/Mesh_3/CMakeLists.txt +++ b/Mesh_3/benchmark/Mesh_3/CMakeLists.txt @@ -66,31 +66,20 @@ else() endif(LINK_WITH_TBB) endif() +# 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() + # 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") + if(TARGET Boost::program_options) + target_link_libraries(concurrency PRIVATE Boost::program_options) else() - message( - STATUS "Boost.ProgramOptions library: ${Boost_PROGRAM_OPTIONS_LIBRARY}") + target_link_libraries(concurrency PRIVATE ${Boost_PROGRAM_OPTIONS_LIBRARY}) endif() - add_definitions("-DCGAL_USE_BOOST_PROGRAM_OPTIONS") - list(APPEND CGAL_3RD_PARTY_LIBRARIES ${Boost_LIBRARIES}) -endif() - -if(Boost_FOUND ) - # 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." - ) endif() diff --git a/Mesh_3/test/Mesh_3/CMakeLists.txt b/Mesh_3/test/Mesh_3/CMakeLists.txt index 3f91ea357bd..58fb91a6bb9 100644 --- a/Mesh_3/test/Mesh_3/CMakeLists.txt +++ b/Mesh_3/test/Mesh_3/CMakeLists.txt @@ -1,147 +1,142 @@ # 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.23) project( Mesh_3_Tests ) -find_package(CGAL QUIET COMPONENTS ImageIO) +find_package(CGAL REQUIRED COMPONENTS ImageIO) -if ( CGAL_FOUND ) +# Use Eigen +find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +include(CGAL_Eigen3_support) +if (NOT TARGET CGAL::Eigen3_support) + message("NOTICE: This project requires the Eigen library, and will not be compiled.") + return() +endif() - find_package( TBB QUIET ) - include(CGAL_TBB_support) +find_package(TBB QUIET) +include(CGAL_TBB_support) - find_package( ITT QUIET ) +find_package(ITT QUIET) - # Use Eigen - find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) - include(CGAL_Eigen3_support) - if (NOT TARGET CGAL::Eigen3_support) - message(STATUS "This project requires the Eigen library, and will not be compiled.") - return() +create_single_source_cgal_program( "test_boost_has_xxx.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_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_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 "NOTICE: The test '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_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" ) +create_single_source_cgal_program( "test_mesh_cell_base_3.cpp") + +foreach(target + test_boost_has_xxx + test_mesh_capsule_var_distance_bound + test_implicit_multi_domain_to_labeling_function_wrapper + test_criteria + test_domain_with_polyline_features + test_labeled_mesh_domain_3 + test_mesh_criteria_creation + 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_mesh_3_issue_1554 + test_mesh_polyhedral_domain_with_features_deprecated + test_mesh_cell_base_3 + test_meshing_with_one_step.cpp) + if(TARGET ${target}) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endif() +endforeach() - create_single_source_cgal_program( "test_boost_has_xxx.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_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_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_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" ) - create_single_source_cgal_program( "test_mesh_cell_base_3.cpp") - +if(TARGET CGAL::TBB_support) foreach(target - test_boost_has_xxx - test_mesh_capsule_var_distance_bound - test_implicit_multi_domain_to_labeling_function_wrapper - test_criteria - test_domain_with_polyline_features - test_labeled_mesh_domain_3 - test_mesh_criteria_creation - 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_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_with_default_edge_size - test_meshing_determinism + 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 test_mesh_cell_base_3 - test_meshing_with_one_step.cpp) + ) if(TARGET ${target}) - target_link_libraries(${target} PUBLIC CGAL::Eigen3_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 - test_mesh_cell_base_3 - ) - if(TARGET ${target}) - target_link_libraries(${target} PUBLIC CGAL::TBB_support) - endif() - endforeach() - - if(BUILD_TESTING) + if(BUILD_TESTING) + set_property(TEST + execution___of__test_meshing_verbose + execution___of__test_meshing_polyhedron_with_features + execution___of__test_meshing_implicit_function + execution___of__test_meshing_unit_tetrahedron + execution___of__test_meshing_polyhedron + execution___of__test_meshing_polyhedral_complex + execution___of__test_mesh_capsule_var_distance_bound + execution___of__test_mesh_3_issue_1554 + execution___of__test_mesh_polyhedral_domain_with_features_deprecated + execution___of__test_mesh_cell_base_3 + PROPERTY RUN_SERIAL 1) + if(TARGET test_meshing_3D_image) set_property(TEST - execution___of__test_meshing_verbose - execution___of__test_meshing_polyhedron_with_features - execution___of__test_meshing_implicit_function - execution___of__test_meshing_unit_tetrahedron - execution___of__test_meshing_polyhedron - execution___of__test_meshing_polyhedral_complex - execution___of__test_mesh_capsule_var_distance_bound - execution___of__test_mesh_3_issue_1554 - execution___of__test_mesh_polyhedral_domain_with_features_deprecated - execution___of__test_mesh_cell_base_3 + execution___of__test_meshing_3D_image + execution___of__test_meshing_3D_gray_image PROPERTY RUN_SERIAL 1) - if(TARGET test_meshing_3D_image) - set_property(TEST - execution___of__test_meshing_3D_image - execution___of__test_meshing_3D_gray_image - PROPERTY RUN_SERIAL 1) - endif() endif() endif() - if(TARGET ITT::ITT) - target_link_libraries(test_meshing_polyhedron_with_features PRIVATE ITT::ITT) - target_compile_definitions(test_meshing_polyhedron_with_features PRIVATE CGAL_MESH_3_USE_INTEL_ITT) - target_link_libraries(test_meshing_verbose PRIVATE ITT::ITT) - target_compile_definitions(test_meshing_verbose PRIVATE CGAL_MESH_3_USE_INTEL_ITT) - endif() - - if(BUILD_TESTING) - set_tests_properties( - execution___of__test_meshing_polyhedron_with_features - execution___of__test_meshing_verbose - PROPERTIES RESOURCE_LOCK Mesh_3_Tests_IO) - endif() -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - +endif() + +if(TARGET ITT::ITT) + target_link_libraries(test_meshing_polyhedron_with_features PRIVATE ITT::ITT) + target_compile_definitions(test_meshing_polyhedron_with_features PRIVATE CGAL_MESH_3_USE_INTEL_ITT) + target_link_libraries(test_meshing_verbose PRIVATE ITT::ITT) + target_compile_definitions(test_meshing_verbose PRIVATE CGAL_MESH_3_USE_INTEL_ITT) +endif() + +if(BUILD_TESTING) + set_tests_properties( + execution___of__test_meshing_polyhedron_with_features + execution___of__test_meshing_verbose + PROPERTIES RESOURCE_LOCK Mesh_3_Tests_IO) endif() diff --git a/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt index 8ad70c5f829..31b92ab56e6 100644 --- a/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/benchmark/Optimal_bounding_box/CMakeLists.txt @@ -7,8 +7,7 @@ project(Optimal_bounding_box_Benchmark) # CGAL and its components find_package(CGAL REQUIRED) - -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) message("NOTICE: This project requires the Eigen library, and will not be compiled.") diff --git a/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt index e35a681812b..97f9a323685 100644 --- a/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/examples/Optimal_bounding_box/CMakeLists.txt @@ -6,7 +6,7 @@ project(Optimal_bounding_box_Examples) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) message("NOTICE: This project requires the Eigen library, and will not be compiled.") diff --git a/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt b/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt index bd6f6a443b3..db5e5b0a874 100644 --- a/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt +++ b/Optimal_bounding_box/test/Optimal_bounding_box/CMakeLists.txt @@ -6,7 +6,7 @@ project(Optimal_bounding_box_Tests) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) message("NOTICE: This project requires the Eigen library, and will not be compiled.") 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 81e68f53bd3..96eb570c9c9 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 @@ -77,7 +77,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND) 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) + find_package(Threads QUIET) if(CMAKE_USE_PTHREADS_INIT) target_link_libraries(Otr2_demo PRIVATE ${CMAKE_THREAD_LIBS_INIT}) endif() diff --git a/Orthtree/benchmark/Orthtree/CMakeLists.txt b/Orthtree/benchmark/Orthtree/CMakeLists.txt index 06cea796719..24274ae62b8 100644 --- a/Orthtree/benchmark/Orthtree/CMakeLists.txt +++ b/Orthtree/benchmark/Orthtree/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Orthtree_benchmarks) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) create_single_source_cgal_program("construction.cpp") create_single_source_cgal_program("nearest_neighbor.cpp") diff --git a/Orthtree/examples/Orthtree/CMakeLists.txt b/Orthtree/examples/Orthtree/CMakeLists.txt index 09026783dab..b4e92f36ee9 100644 --- a/Orthtree/examples/Orthtree/CMakeLists.txt +++ b/Orthtree/examples/Orthtree/CMakeLists.txt @@ -4,27 +4,21 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Orthtree_Examples) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) -if (CGAL_FOUND) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) - create_single_source_cgal_program("octree_build_from_point_set.cpp") - create_single_source_cgal_program("octree_build_from_point_vector.cpp") - create_single_source_cgal_program("octree_build_with_custom_split.cpp") - create_single_source_cgal_program("octree_find_nearest_neighbor.cpp") - create_single_source_cgal_program("octree_traversal_custom.cpp") - create_single_source_cgal_program("octree_traversal_manual.cpp") - create_single_source_cgal_program("octree_traversal_preorder.cpp") - create_single_source_cgal_program("octree_grade.cpp") - create_single_source_cgal_program("quadtree_build_from_point_vector.cpp") +create_single_source_cgal_program("octree_build_from_point_set.cpp") +create_single_source_cgal_program("octree_build_from_point_vector.cpp") +create_single_source_cgal_program("octree_build_with_custom_split.cpp") +create_single_source_cgal_program("octree_find_nearest_neighbor.cpp") +create_single_source_cgal_program("octree_traversal_custom.cpp") +create_single_source_cgal_program("octree_traversal_manual.cpp") +create_single_source_cgal_program("octree_traversal_preorder.cpp") +create_single_source_cgal_program("octree_grade.cpp") +create_single_source_cgal_program("quadtree_build_from_point_vector.cpp") - 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("orthtree_build.cpp") - target_link_libraries(orthtree_build PUBLIC CGAL::Eigen_support) - endif() - -else () - message(WARNING - "This program requires the CGAL library, and will not be compiled.") -endif () +find_package(Eigen3 3.1.91) #(requires 3.1.91 or greater) +include(CGAL_Eigen_support) +if (TARGET CGAL::Eigen_support) + create_single_source_cgal_program("orthtree_build.cpp") + target_link_libraries(orthtree_build PUBLIC CGAL::Eigen_support) +endif() diff --git a/Orthtree/test/Orthtree/CMakeLists.txt b/Orthtree/test/Orthtree/CMakeLists.txt index 6ffe9220aaf..6776af02157 100644 --- a/Orthtree/test/Orthtree/CMakeLists.txt +++ b/Orthtree/test/Orthtree/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Orthtree_Tests) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) create_single_source_cgal_program("test_octree_equality.cpp") create_single_source_cgal_program("test_octree_refine.cpp") 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 05c83888820..70027d80b08 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 @@ -5,11 +5,10 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Periodic_3_mesh_3_Examples) # CGAL and its components -find_package(CGAL REQUIRED COMPONENTS ImageIO) - +find_package(CGAL REQUIRED) # Use Eigen -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) message("NOTICE: This project requires the Eigen library, and will not be compiled.") 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 22faeaf1c29..b962e56be41 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 @@ -7,7 +7,7 @@ project(Periodic_3_mesh_3_Tests) find_package(CGAL REQUIRED COMPONENTS ImageIO) # Use Eigen -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) message("NOTICE: This project requires the Eigen library, and will not be compiled.") 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 1a7e63715ec..a4ee8805749 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,11 +1,10 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Periodic_4_hyperbolic_triangulation_2_Examples) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) + find_package(LEDA QUIET) - -if((CGAL_Core_FOUND OR LEDA_FOUND)) - +if(CGAL_Core_FOUND OR LEDA_FOUND) create_single_source_cgal_program("p4ht2_example_insertion.cpp") else() message("NOTICE: This program requires the CGAL library, and will not be compiled.") 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 812dc8b307d..ef5923f844c 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,11 +1,10 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Periodic_4_hyperbolic_triangulation_2_Tests) -find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Core) +find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) + find_package(LEDA QUIET) - -if((CGAL_Core_FOUND OR LEDA_FOUND)) - +if(CGAL_Core_FOUND OR LEDA_FOUND) 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") diff --git a/Point_set_3/examples/Point_set_3/CMakeLists.txt b/Point_set_3/examples/Point_set_3/CMakeLists.txt index 1ba5c604bab..1699f75d099 100644 --- a/Point_set_3/examples/Point_set_3/CMakeLists.txt +++ b/Point_set_3/examples/Point_set_3/CMakeLists.txt @@ -16,9 +16,9 @@ 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}) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) -if(EIGEN3_FOUND) +if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("point_set_algo.cpp") target_link_libraries(point_set_algo PUBLIC CGAL::Eigen3_support) else() diff --git a/Point_set_3/test/Point_set_3/CMakeLists.txt b/Point_set_3/test/Point_set_3/CMakeLists.txt index 970ffd456f5..4daea00a56b 100644 --- a/Point_set_3/test/Point_set_3/CMakeLists.txt +++ b/Point_set_3/test/Point_set_3/CMakeLists.txt @@ -14,7 +14,7 @@ create_single_source_cgal_program("test_deprecated_io_ps.cpp") #Use LAS #disable if MSVC 2017 if(NOT MSVC_VERSION OR (MSVC_VERSION GREATER_EQUAL 1919 AND MSVC_VERSION LESS 1910)) - find_package(LASLIB) + find_package(LASLIB QUIET) include(CGAL_LASLIB_support) if (TARGET CGAL::LASLIB_support) target_link_libraries(test_deprecated_io_ps PUBLIC CGAL::LASLIB_support) 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 39655c8b217..ac5e71b1aa1 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 @@ -6,8 +6,6 @@ project(Point_set_processing_3_Examples) # Find CGAL find_package(CGAL REQUIRED) -find_package(Boost QUIET) - # VisualC++ optimization for applications dealing with large data if(MSVC) # Quit warning in the lasreader @@ -56,7 +54,7 @@ foreach( target_link_libraries(${target} PRIVATE ${CGAL_libs}) endforeach() -find_package(LASLIB) +find_package(LASLIB QUIET) include(CGAL_LASLIB_support) if(TARGET CGAL::LASLIB_support) create_single_source_cgal_program("read_las_example.cpp") @@ -66,7 +64,7 @@ else() endif() # Use Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) set(CGAL_libs ${CGAL_libs} CGAL::Eigen3_support) 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 b96bd07f0d9..8766b4c40ca 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 @@ -19,9 +19,6 @@ if (MSVC) message( STATUS "USING RELEASE EXEFLAGS = '${CMAKE_EXE_LINKER_FLAGS} ${CMAKE_EXE_LINKER_FLAGS_RELEASE}'" ) endif() -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( "test_read_write_point_set.cpp" ) @@ -37,7 +34,7 @@ create_single_source_cgal_program( "structuring_test.cpp" ) #Use LAS #disable if MSVC 2017 if(NOT MSVC_VERSION OR (MSVC_VERSION GREATER_EQUAL 1919 AND MSVC_VERSION LESS 1910)) - find_package(LASLIB) + find_package(LASLIB QUIET) include(CGAL_LASLIB_support) if (TARGET CGAL::LASLIB_support) target_link_libraries(test_read_write_point_set PUBLIC ${CGAL_libs} CGAL::LASLIB_support) @@ -50,9 +47,9 @@ else() endif() # Use Eigen -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) -if (EIGEN3_FOUND) +if(TARGET CGAL::Eigen3_support) # Executables that require Eigen create_single_source_cgal_program( "normal_estimation_test.cpp" ) target_link_libraries(normal_estimation_test PUBLIC CGAL::Eigen3_support) @@ -76,6 +73,8 @@ else() message(STATUS "NOTICE: Some tests require Eigen 3.1 (or greater), and will not be compiled.") endif() +find_package(TBB QUIET) +include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) foreach( target 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 978908627f2..347a37eeab9 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 @@ -17,21 +17,22 @@ if(MSVC) 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_Eigen3_support) - if(TARGET CGAL::Eigen3_support) - # Executables that require Eigen 3.1 - create_single_source_cgal_program("poisson_reconstruction_test.cpp") - target_link_libraries(poisson_reconstruction_test PUBLIC CGAL::Eigen3_support) - find_package(TBB) - include(CGAL_TBB_support) - if (TBB_FOUND) - create_single_source_cgal_program( "poisson_and_parallel_mesh_3.cpp" ) - target_link_libraries(poisson_and_parallel_mesh_3 PUBLIC CGAL::Eigen3_support CGAL::TBB_support) - else() - message(STATUS "NOTICE: test with parallel Mesh_3 needs TBB and will not be compiled.") - endif() + +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen3_support) +if(TARGET CGAL::Eigen3_support) + # Executables that require Eigen 3.1 + create_single_source_cgal_program("poisson_reconstruction_test.cpp") + target_link_libraries(poisson_reconstruction_test PUBLIC CGAL::Eigen3_support) + + find_package(TBB QUIET) + include(CGAL_TBB_support) + if (TBB_FOUND) + create_single_source_cgal_program( "poisson_and_parallel_mesh_3.cpp" ) + target_link_libraries(poisson_and_parallel_mesh_3 PUBLIC CGAL::Eigen3_support CGAL::TBB_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: The test 'poisson_and_parallel_mesh_3' requires TBB, and will not be compiled.") + endif() +else() + message("NOTICE: Tests in this directory require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt index 22a07946a15..fd77f8a046d 100644 --- a/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/benchmark/Polygon_mesh_processing/CMakeLists.txt @@ -33,13 +33,11 @@ if (FAST_ENVELOPE_BUILD_DIR) target_link_libraries( fastE PUBLIC FastEnvelope IndirectPredicates geogram) else() - message(STATUS "Cmake variable FAST_ENVELOPE_BUILD_DIR is not defined fastE will not be built") + message(STATUS "CMake variable FAST_ENVELOPE_BUILD_DIR is not defined; benchmark 'fastE' will not be built") endif() -create_single_source_cgal_program( "fast.cpp" ) +create_single_source_cgal_program("fast.cpp") + create_single_source_cgal_program("polygon_mesh_slicer.cpp") +target_link_libraries(polygon_mesh_slicer PUBLIC CGAL::Eigen3_support) - -if(TARGET CGAL::Eigen3_support) - target_link_libraries(polygon_mesh_slicer PUBLIC CGAL::Eigen3_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 11be7ccef68..192e7d29b74 100644 --- a/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/examples/Polygon_mesh_processing/CMakeLists.txt @@ -7,38 +7,52 @@ project(Polygon_mesh_processing_Examples) # CGAL and its components 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.") - - return() - -endif() - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - -# include for local directory - -# include for local package -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) -include(CGAL_Eigen3_support) - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - +create_single_source_cgal_program("extrude.cpp" ) +create_single_source_cgal_program("polyhedral_envelope.cpp" ) +create_single_source_cgal_program("polyhedral_envelope_of_triangle_soup.cpp" ) +create_single_source_cgal_program("polyhedral_envelope_mesh_containment.cpp" ) +create_single_source_cgal_program("self_intersections_example.cpp" ) +create_single_source_cgal_program("stitch_borders_example.cpp" ) +create_single_source_cgal_program("compute_normals_example_Polyhedron.cpp" CXX_FEATURES cxx_range_for ) +create_single_source_cgal_program("compute_normals_example.cpp" CXX_FEATURES cxx_range_for cxx_auto_type ) +create_single_source_cgal_program("point_inside_example.cpp") +create_single_source_cgal_program("triangulate_faces_example.cpp") +create_single_source_cgal_program("triangulate_faces_split_visitor_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("tangential_relaxation_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_progress.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") +create_single_source_cgal_program("match_faces.cpp") +create_single_source_cgal_program("cc_compatible_orientations.cpp") create_single_source_cgal_program("hausdorff_distance_remeshing_example.cpp") -create_single_source_cgal_program( "hausdorff_bounded_error_distance_example.cpp") +create_single_source_cgal_program("hausdorff_bounded_error_distance_example.cpp") +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) +include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("hole_filling_example.cpp") target_link_libraries(hole_filling_example PUBLIC CGAL::Eigen3_support) @@ -56,65 +70,22 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(mesh_smoothing_example PUBLIC CGAL::Eigen3_support) create_single_source_cgal_program("delaunay_remeshing_example.cpp") target_link_libraries(delaunay_remeshing_example PUBLIC CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: Examples that use Eigen will not be compiled.") endif() -create_single_source_cgal_program( "extrude.cpp" ) -create_single_source_cgal_program( "polyhedral_envelope.cpp" ) -create_single_source_cgal_program( "polyhedral_envelope_of_triangle_soup.cpp" ) -create_single_source_cgal_program( "polyhedral_envelope_mesh_containment.cpp" ) -create_single_source_cgal_program( "self_intersections_example.cpp" ) -create_single_source_cgal_program( "stitch_borders_example.cpp" ) -create_single_source_cgal_program( "compute_normals_example_Polyhedron.cpp" CXX_FEATURES cxx_range_for ) -create_single_source_cgal_program( "compute_normals_example.cpp" CXX_FEATURES cxx_range_for cxx_auto_type ) -create_single_source_cgal_program( "point_inside_example.cpp") -create_single_source_cgal_program( "triangulate_faces_example.cpp") -create_single_source_cgal_program( "triangulate_faces_split_visitor_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("tangential_relaxation_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_progress.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") -create_single_source_cgal_program("match_faces.cpp") -create_single_source_cgal_program("cc_compatible_orientations.cpp") - +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) create_single_source_cgal_program("compute_normals_example_OM.cpp") - target_link_libraries(compute_normals_example_OM - PRIVATE ${OPENMESH_LIBRARIES}) - + target_link_libraries(compute_normals_example_OM PRIVATE ${OPENMESH_LIBRARIES}) create_single_source_cgal_program("corefinement_OM_union.cpp") - target_link_libraries(corefinement_OM_union - PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(corefinement_OM_union PRIVATE ${OPENMESH_LIBRARIES}) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("hole_filling_example_OM.cpp") - target_link_libraries(hole_filling_example_OM PRIVATE CGAL::Eigen3_support - ${OPENMESH_LIBRARIES}) + target_link_libraries(hole_filling_example_OM PRIVATE CGAL::Eigen3_support ${OPENMESH_LIBRARIES}) endif() create_single_source_cgal_program("point_inside_example_OM.cpp") @@ -123,15 +94,17 @@ if(OpenMesh_FOUND) 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}) + #target_compile_definitions(remove_degeneracies_example PRIVATE -DCGAL_USE_OPENMESH) create_single_source_cgal_program("triangulate_faces_example_OM.cpp") - target_link_libraries(triangulate_faces_example_OM - PRIVATE ${OPENMESH_LIBRARIES}) -endif(OpenMesh_FOUND) + target_link_libraries(triangulate_faces_example_OM PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") +endif() -find_package(METIS) +find_package(METIS QUIET) include(CGAL_METIS_support) if(TARGET CGAL::METIS_support) target_link_libraries(hausdorff_bounded_error_distance_example PUBLIC CGAL::METIS_support) @@ -139,15 +112,12 @@ else() message(STATUS "NOTICE: Examples that use the METIS library will not be compiled.") endif() -find_package(TBB) +find_package(TBB QUIET) include(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_bounded_error_distance_example - PUBLIC CGAL::TBB_support) - + target_link_libraries(hausdorff_distance_remeshing_example PUBLIC CGAL::TBB_support) + target_link_libraries(hausdorff_bounded_error_distance_example PUBLIC CGAL::TBB_support) create_single_source_cgal_program("corefinement_parallel_union_meshes.cpp") target_link_libraries(corefinement_parallel_union_meshes PUBLIC CGAL::TBB_support) diff --git a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt index f5a2182b27f..b7328227479 100644 --- a/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt +++ b/Polygon_mesh_processing/test/Polygon_mesh_processing/CMakeLists.txt @@ -7,52 +7,6 @@ project(Polygon_mesh_processing_Tests) # CGAL and its components find_package(CGAL REQUIRED COMPONENTS Core) -# 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.") - - return() - -endif() - -# include for local directory - -# include for local package -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) -include(CGAL_Eigen3_support) - -find_package(TBB) -include(CGAL_TBB_support) - -if(TARGET CGAL::Eigen3_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::Eigen3_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::Eigen3_support) - create_single_source_cgal_program("triangulate_hole_Polyhedron_3_test.cpp") - target_link_libraries(triangulate_hole_Polyhedron_3_test - PUBLIC CGAL::Eigen3_support) - create_single_source_cgal_program("test_shape_smoothing.cpp") - target_link_libraries(test_shape_smoothing PUBLIC CGAL::Eigen3_support) - create_single_source_cgal_program("delaunay_remeshing_test.cpp") - target_link_libraries(delaunay_remeshing_test PUBLIC CGAL::Eigen3_support) -endif() - -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("test_pmp_triangle.cpp") create_single_source_cgal_program("test_hausdorff_bounded_error_distance.cpp") create_single_source_cgal_program("test_pmp_read_polygon_mesh.cpp") @@ -112,7 +66,24 @@ create_single_source_cgal_program("test_pmp_np_function.cpp") create_single_source_cgal_program("test_degenerate_pmp_clip_split_corefine.cpp") # create_single_source_cgal_program("test_pmp_repair_self_intersections.cpp") -find_package(METIS) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) +include(CGAL_Eigen3_support) +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program("fairing_test.cpp") + target_link_libraries(fairing_test PUBLIC CGAL::Eigen3_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::Eigen3_support) + create_single_source_cgal_program("triangulate_hole_Polyhedron_3_test.cpp") + target_link_libraries(triangulate_hole_Polyhedron_3_test PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("test_shape_smoothing.cpp") + target_link_libraries(test_shape_smoothing PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("delaunay_remeshing_test.cpp") + target_link_libraries(delaunay_remeshing_test PUBLIC CGAL::Eigen3_support) +else() + message(STATUS "NOTICE: Tests that use the Eigen library will not be compiled.") +endif() + +find_package(METIS QUIET) include(CGAL_METIS_support) if(TARGET CGAL::METIS_support) target_link_libraries(test_hausdorff_bounded_error_distance PUBLIC CGAL::METIS_support) @@ -120,6 +91,8 @@ else() message(STATUS "NOTICE: Tests are not using METIS.") endif() +find_package(TBB QUIET) +include(CGAL_TBB_support) if(TARGET CGAL::TBB_support) target_link_libraries(test_hausdorff_bounded_error_distance PUBLIC CGAL::TBB_support) target_link_libraries(test_pmp_distance PUBLIC CGAL::TBB_support) @@ -130,7 +103,9 @@ else() message(STATUS "NOTICE: Intel TBB was not found. Tests will use sequential code.") endif() +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) create_single_source_cgal_program("remeshing_test_P_SM_OM.cpp") target_link_libraries(remeshing_test_P_SM_OM PRIVATE ${OPENMESH_LIBRARIES}) else() @@ -140,11 +115,13 @@ endif() find_package(Ceres QUIET) include(CGAL_Ceres_support) if(TARGET CGAL::Ceres_support AND TARGET CGAL::Eigen3_support) - target_link_libraries( test_mesh_smoothing PUBLIC CGAL::Eigen3_support CGAL::Ceres_support) + target_link_libraries(test_mesh_smoothing PUBLIC CGAL::Eigen3_support CGAL::Ceres_support) -# 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 CGAL::Ceres_support AND TARGET CGAL::Eigen3_support) +# target_compile_definitions(test_pmp_repair_self_intersections PUBLIC CGAL_PMP_USE_CERES_SOLVER) +# target_link_libraries(test_pmp_repair_self_intersections PUBLIC CGAL::Eigen3_support CGAL::Ceres_support) +else() + message(STATUS "NOTICE: Tests are not using Ceres.") +endif() if(BUILD_TESTING) set_tests_properties( diff --git a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt index e3b460139a0..a5bd6e2c6a4 100644 --- a/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt +++ b/Polygonal_surface_reconstruction/examples/Polygonal_surface_reconstruction/CMakeLists.txt @@ -15,10 +15,10 @@ if(NOT TARGET CGAL::Eigen3_support) return() endif() -find_package(SCIP QUIET) +find_package(SCIP) include(CGAL_SCIP_support) if(NOT TARGET CGAL::SCIP_support) - find_package(GLPK QUIET) + find_package(GLPK) include(CGAL_GLPK_support) if(NOT TARGET CGAL::GLPK_support) message("NOTICE: This project requires either SCIP or GLPK, and will not be compiled.") diff --git a/Polyhedron/demo/Polyhedron/CMakeLists.txt b/Polyhedron/demo/Polyhedron/CMakeLists.txt index e560e6b44f0..a15bb212d96 100644 --- a/Polyhedron/demo/Polyhedron/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/CMakeLists.txt @@ -55,7 +55,7 @@ if(Qt5_FOUND) add_definitions(-DSCENE_IMAGE_GL_BUFFERS_AVAILABLE) endif(Qt5_FOUND) -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) set_package_properties( Eigen3 PROPERTIES DESCRIPTION "A library for linear algebra." @@ -75,7 +75,7 @@ set_package_properties( # Activate concurrency? option(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY "Enable concurrency" ON) if(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY) - find_package(TBB) + find_package(TBB QUIET) 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.") @@ -83,7 +83,7 @@ if(POLYHEDRON_DEMO_ACTIVATE_CONCURRENCY) endif() #find libssh for scene sharing -find_package(LibSSH) +find_package(LibSSH QUIET) set_package_properties( LibSSH PROPERTIES DESCRIPTION "A library implementing the SSH protocol on client and server side. " diff --git a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt index e2314c89202..86d60a56319 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Classification/CMakeLists.txt @@ -2,7 +2,7 @@ include(polyhedron_demo_macros) if(TARGET CGAL::Eigen3_support) - find_package(Boost OPTIONAL_COMPONENTS serialization iostreams) + find_package(Boost QUIET OPTIONAL_COMPONENTS serialization iostreams) include(CGAL_Boost_serialization_support) include(CGAL_Boost_iostreams_support) if(NOT TARGET CGAL::Boost_serialization_support OR NOT TARGET CGAL::Boost_iostreams_support) diff --git a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt index 7d404d7f196..fefcc2706b4 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/IO/CMakeLists.txt @@ -1,6 +1,6 @@ include(polyhedron_demo_macros) -find_package(LASLIB) +find_package(LASLIB QUIET) set_package_properties( LASLIB PROPERTIES DESCRIPTION "A library for LIDAR I/O." diff --git a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt index 702e4a1898e..1955755b2db 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Point_set/CMakeLists.txt @@ -1,6 +1,6 @@ include(polyhedron_demo_macros) -if(TARGET CGAL::Eigen3_support) +if(TARGET CGAL::Eigen3_support) find_package(SCIP QUIET) set_package_properties( diff --git a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt index b7f9d81ad41..876ccbd0f36 100644 --- a/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt +++ b/Polyhedron/demo/Polyhedron/Plugins/Surface_mesh_deformation/CMakeLists.txt @@ -1,5 +1,6 @@ include(polyhedron_demo_macros) -if(EIGEN3_FOUND AND "${EIGEN3_VERSION}" VERSION_GREATER "3.1.90") + +if(TARGET CGAL::Eigen3_support 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 diff --git a/Property_map/test/Property_map/CMakeLists.txt b/Property_map/test/Property_map/CMakeLists.txt index cc6b86f23d7..ab38886b812 100644 --- a/Property_map/test/Property_map/CMakeLists.txt +++ b/Property_map/test/Property_map/CMakeLists.txt @@ -4,19 +4,17 @@ project(Property_map_Tests) # CGAL and its components find_package(CGAL REQUIRED) -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) - add_definitions(-DCGAL_USE_OPENMESH) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() create_single_source_cgal_program("test_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("kernel_converter_properties_test.cpp") +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) + target_link_libraries(dynamic_properties_test PRIVATE ${OPENMESH_LIBRARIES}) + target_compile_definitions(dynamic_properties_test PRIVATE -DCGAL_USE_OPENMESH) +else() + message(STATUS "NOTICE: Tests will not use OpenMesh.") endif() diff --git a/Ridges_3/examples/Ridges_3/CMakeLists.txt b/Ridges_3/examples/Ridges_3/CMakeLists.txt index 2c8200b2bed..f310a7f98f0 100644 --- a/Ridges_3/examples/Ridges_3/CMakeLists.txt +++ b/Ridges_3/examples/Ridges_3/CMakeLists.txt @@ -9,8 +9,7 @@ include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) # Link with Boost.ProgramOptions (optional) - find_package(Boost QUIET COMPONENTS program_options) - + find_package(Boost COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) create_single_source_cgal_program(Compute_Ridges_Umbilics.cpp) target_link_libraries(Compute_Ridges_Umbilics PUBLIC CGAL::Eigen3_support) diff --git a/SMDS_3/examples/SMDS_3/CMakeLists.txt b/SMDS_3/examples/SMDS_3/CMakeLists.txt index 54bb8f0ecf1..a1d23ab87ab 100644 --- a/SMDS_3/examples/SMDS_3/CMakeLists.txt +++ b/SMDS_3/examples/SMDS_3/CMakeLists.txt @@ -8,10 +8,5 @@ project(SMDS_3_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Boost and its components -find_package(Boost REQUIRED) - -# Creating entries for all C++ files with "main" routine -# ########################################################## -create_single_source_cgal_program( "c3t3_example.cpp" ) -create_single_source_cgal_program( "tetrahedron_soup_to_c3t3_example.cpp" ) +create_single_source_cgal_program("c3t3_example.cpp") +create_single_source_cgal_program("tetrahedron_soup_to_c3t3_example.cpp") diff --git a/SMDS_3/test/SMDS_3/CMakeLists.txt b/SMDS_3/test/SMDS_3/CMakeLists.txt index 43cea5fc098..2baa66ee018 100644 --- a/SMDS_3/test/SMDS_3/CMakeLists.txt +++ b/SMDS_3/test/SMDS_3/CMakeLists.txt @@ -2,29 +2,33 @@ # This is the CMake script for compiling a CGAL application. cmake_minimum_required(VERSION 3.1...3.20) -project( SMDS_3_Tests ) +project(SMDS_3_Tests) find_package(CGAL REQUIRED) -# Use Eigen -find_package(Eigen3 3.1.0 REQUIRED) #(requires 3.1.0 or greater) -include(CGAL_Eigen3_support) - -create_single_source_cgal_program( "test_c3t3.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_c3t3_into_facegraph.cpp" ) -create_single_source_cgal_program( "test_c3t3_extract_subdomains_boundaries.cpp" ) -create_single_source_cgal_program( "test_c3t3_io_MEDIT.cpp" ) create_single_source_cgal_program( "test_simplicial_cb_vb.cpp") -foreach(target - test_c3t3 - test_c3t3_io - test_c3t3_with_features - test_c3t3_into_facegraph - test_c3t3_extract_subdomains_boundaries) - if(TARGET ${target}) - target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) - endif() -endforeach() +find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +include(CGAL_Eigen3_support) +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program( "test_c3t3.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_c3t3_into_facegraph.cpp" ) + create_single_source_cgal_program( "test_c3t3_extract_subdomains_boundaries.cpp" ) + create_single_source_cgal_program( "test_c3t3_io_MEDIT.cpp" ) + + foreach(target + test_c3t3 + test_c3t3_io + test_c3t3_with_features + test_c3t3_into_facegraph + test_c3t3_extract_subdomains_boundaries + test_c3t3_io_MEDIT) + if(TARGET ${target}) + target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) + endif() + endforeach() +else() + message(STATUS "NOTICE: Some tests require Eigen 3.1 (or greater), and will not be compiled.") +endif() diff --git a/STL_Extension/test/STL_Extension/CMakeLists.txt b/STL_Extension/test/STL_Extension/CMakeLists.txt index 65a100afa6d..a295d487ca3 100644 --- a/STL_Extension/test/STL_Extension/CMakeLists.txt +++ b/STL_Extension/test/STL_Extension/CMakeLists.txt @@ -5,16 +5,11 @@ cmake_minimum_required(VERSION 3.1...3.23) project(STL_Extension_Tests) find_package(CGAL REQUIRED) -find_package( TBB QUIET ) + +find_package(TBB QUIET) include(CGAL_TBB_support) - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) - add_definitions(-DCGAL_USE_OPENMESH) -else() - message(STATUS "Tests that use OpenMesh will not be compiled.") +if(NOT TARGET CGAL::TBB_support) + message(STATUS "NOTICE: Tests are not using TBB.") endif() create_single_source_cgal_program("test_Boolean_tag.cpp") @@ -59,7 +54,9 @@ if(TARGET CGAL::TBB_support) target_link_libraries(test_for_each PUBLIC CGAL::TBB_support) endif() +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) create_single_source_cgal_program("test_hash_OpenMesh.cpp") target_link_libraries(test_hash_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) else() 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 ba2c593d83e..8aec35e8e15 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 @@ -7,7 +7,7 @@ find_package(CGAL REQUIRED) option(ACTIVATE_CONCURRENCY "Enable concurrency" ON) if(ACTIVATE_CONCURRENCY) - find_package(TBB) + find_package(TBB QUIET) include(CGAL_TBB_support) if(NOT TARGET CGAL::TBB_support) message(STATUS "NOTICE: Intel TBB not found. Examples are faster if TBB is linked.") diff --git a/Shape_detection/benchmark/Shape_detection/CMakeLists.txt b/Shape_detection/benchmark/Shape_detection/CMakeLists.txt index 3baee301825..8b7bd020dd3 100644 --- a/Shape_detection/benchmark/Shape_detection/CMakeLists.txt +++ b/Shape_detection/benchmark/Shape_detection/CMakeLists.txt @@ -6,19 +6,13 @@ project(Shape_detection_Benchmarks) 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) +find_package(Eigen3 3.1.0) # (3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_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::Eigen3_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::Eigen3_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::Eigen3_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::Eigen3_support) +else() + message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Shape_detection/test/Shape_detection/CMakeLists.txt b/Shape_detection/test/Shape_detection/CMakeLists.txt index 149f34e57f0..5250b7a6a4b 100644 --- a/Shape_detection/test/Shape_detection/CMakeLists.txt +++ b/Shape_detection/test/Shape_detection/CMakeLists.txt @@ -20,7 +20,7 @@ create_single_source_cgal_program("test_efficient_RANSAC_scene.cpp") find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) include(CGAL_Eigen3_support) -if(EIGEN3_FOUND) +if(TARGET CGAL::Eigen3_support) 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") diff --git a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt index f053e7e5079..24e5253b5ea 100644 --- a/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt +++ b/Skin_surface_3/examples/Skin_surface_3/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Skin_surface_3_Examples) -find_package(CGAL) +find_package(CGAL REQUIRED) include_directories(BEFORE include) @@ -20,7 +20,7 @@ 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) +find_package(ESBTL QUIET) if(ESBTL_FOUND) include_directories(${ESBTL_INCLUDE_DIR}) create_single_source_cgal_program("skin_surface_pdb_reader.cpp") diff --git a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt index 0585028eec8..239b7f03600 100644 --- a/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/benchmark/Spatial_searching/CMakeLists.txt @@ -6,13 +6,15 @@ project(Spatial_searching_) find_package(CGAL REQUIRED COMPONENTS Core) -include(${CGAL_USE_FILE}) - -find_package(Eigen3 3.1.91) # (requires 3.2.0 or greater) -include(CGAL_Eigen3_support) - include_directories(BEFORE "include") +find_package(Eigen3 3.1.91) # (requires 3.1.91 or greater) +include(CGAL_Eigen3_support) +if(NOT TARGET CGAL::Eigen3_support) + message("NOTICE: These benchmarks require Eigen 3.1.91 (or greater), and will not be compiled.") + return() +endif() + # create_single_source_cgal_program("Compare_ANN_STANN_CGAL.cpp") # does not compile, missing dependency create_single_source_cgal_program("nanoflan.cpp") create_single_source_cgal_program("binary.cpp") diff --git a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt index 5dc1eab0dcd..53661afd8bb 100644 --- a/Spatial_searching/examples/Spatial_searching/CMakeLists.txt +++ b/Spatial_searching/examples/Spatial_searching/CMakeLists.txt @@ -27,6 +27,8 @@ 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("weighted_Minkowski_distance.cpp") +find_package(Eigen3 3.1.91 QUIET) #(requires 3.1.91 or greater) +include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("fuzzy_range_query.cpp") target_link_libraries(fuzzy_range_query PUBLIC CGAL::Eigen3_support) diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt index 1d5b7047fd7..7748468d634 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/CMakeLists.txt @@ -8,7 +8,7 @@ project(Surface_mesh_approximation_Examples) find_package(CGAL REQUIRED) # Use Eigen (for PCA) -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt b/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt index ab1ca32384a..d1acae25bf2 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/CMakeLists.txt @@ -8,7 +8,7 @@ project(Surface_mesh_approximation_Tests) find_package(CGAL REQUIRED) # Use Eigen (for PCA) -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0) #(3.1.0 or greater) include(CGAL_Eigen3_support) if(NOT TARGET CGAL::Eigen3_support) message("NOTICE: This project requires Eigen 3.1 (or greater), and will not be compiled.") diff --git a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt index 40354505e1b..d0e7ddae9bb 100644 --- a/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/demo/Surface_mesh_deformation/CMakeLists.txt @@ -13,7 +13,7 @@ set_property(DIRECTORY PROPERTY CGAL_NO_TESTING TRUE) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) +find_package(Eigen3 3.1.91) #(requires 3.1.91 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("deform_mesh_for_botsch08_format.cpp") diff --git a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt index 168b336edff..19989c9654d 100644 --- a/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/examples/Surface_mesh_deformation/CMakeLists.txt @@ -6,7 +6,7 @@ project(Surface_mesh_deformation_Examples) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) +find_package(Eigen3 3.1.91) #(requires 3.1.91 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("all_roi_assign_example.cpp") diff --git a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt index 5046d551a55..cc33b2b8f22 100644 --- a/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt +++ b/Surface_mesh_deformation/test/Surface_mesh_deformation/CMakeLists.txt @@ -6,7 +6,7 @@ project(Surface_mesh_deformation_Tests) find_package(CGAL REQUIRED) -find_package(Eigen3 3.1.91) #(requires 3.2.0 or greater) +find_package(Eigen3 3.1.91) #(requires 3.1.91 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("Cactus_deformation_session.cpp") diff --git a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt index 17af23300b8..6f8460fec27 100644 --- a/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt +++ b/Surface_mesh_segmentation/examples/Surface_mesh_segmentation/CMakeLists.txt @@ -7,13 +7,6 @@ project(Surface_mesh_segmentation_Examples) # CGAL and its components find_package(CGAL REQUIRED) -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("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") @@ -22,9 +15,11 @@ 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") +find_package(OpenMesh QUIET) 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}) + include(UseOpenMesh) + create_single_source_cgal_program("segmentation_from_sdf_values_OpenMesh_example.cpp") + target_link_libraries(segmentation_from_sdf_values_OpenMesh_example PRIVATE ${OPENMESH_LIBRARIES}) +else() + message(STATUS "NOTICE: 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 95099585460..f086d72d46a 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 @@ -3,8 +3,6 @@ project(Surface_mesh_shortest_path_Tests) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Core) -find_package(LEDA QUIET) - include_directories(BEFORE "include") create_single_source_cgal_program("Surface_mesh_shortest_path_test_1.cpp") @@ -15,6 +13,8 @@ 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") +find_package(LEDA QUIET) + # Link with Boost.ProgramOptions (optional) find_package(Boost QUIET COMPONENTS program_options) if(Boost_PROGRAM_OPTIONS_FOUND) diff --git a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt index df746cdc92c..e082b7e942a 100644 --- a/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt +++ b/Surface_mesh_simplification/examples/Surface_mesh_simplification/CMakeLists.txt @@ -7,13 +7,6 @@ project(Surface_mesh_simplification_Examples) # CGAL and its components find_package(CGAL REQUIRED) -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("edge_collapse_envelope.cpp") create_single_source_cgal_program("edge_collapse_constrain_sharp_edges.cpp") create_single_source_cgal_program("edge_collapse_constrained_border_polyhedron.cpp") @@ -35,17 +28,19 @@ else() message(STATUS "NOTICE: Garland-Heckbert polices require the Eigen library, which has not been found; related examples will not be compiled.") endif() +find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) create_single_source_cgal_program("edge_collapse_OpenMesh.cpp") target_link_libraries(edge_collapse_OpenMesh PRIVATE ${OPENMESH_LIBRARIES}) else() message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() -find_package(METIS) +find_package(METIS QUIET) include(CGAL_METIS_support) -find_package(TBB) +find_package(TBB QUIET) include(CGAL_TBB_support) if(TARGET CGAL::TBB_support AND TARGET CGAL::METIS_support) create_single_source_cgal_program("collapse_small_edges_in_parallel.cpp") diff --git a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt index 061db68f7e1..e61824ac4f5 100644 --- a/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/benchmark/Surface_mesh_skeletonization/CMakeLists.txt @@ -9,15 +9,11 @@ find_package(CGAL REQUIRED) find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) - -if(NOT TARGET CGAL::Eigen3_support) - message(STATUS "NOTICE: Eigen 3.2 (or greater) is not found.") +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program("solver_benchmark.cpp") + target_link_libraries(solver_benchmark PUBLIC CGAL::Eigen3_support) + create_single_source_cgal_program("mcf_scale_invariance.cpp") + target_link_libraries(mcf_scale_invariance PUBLIC CGAL::Eigen3_support) +else() + message("NOTICE: This project requires Eigen 3.2.0 (or greater), and will not be compiled.") endif() - -# Creating entries for all .cpp/.C files with "main" routine -# ########################################################## - -create_single_source_cgal_program("solver_benchmark.cpp") -target_link_libraries(solver_benchmark PUBLIC CGAL::Eigen3_support) -create_single_source_cgal_program("mcf_scale_invariance.cpp") -target_link_libraries(mcf_scale_invariance PUBLIC CGAL::Eigen3_support) diff --git a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt index e809e5b742d..a2916b9e2a0 100644 --- a/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/examples/Surface_mesh_skeletonization/CMakeLists.txt @@ -8,15 +8,6 @@ find_package(CGAL REQUIRED) find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) - -find_package(OpenMesh QUIET) - -if(OpenMesh_FOUND) - include(UseOpenMesh) -else() - message(STATUS "Examples that use OpenMesh will not be compiled.") -endif() - if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("simple_mcfskel_example.cpp") create_single_source_cgal_program("simple_mcfskel_sm_example.cpp") @@ -37,9 +28,13 @@ if(TARGET CGAL::Eigen3_support) target_link_libraries(${target} PUBLIC CGAL::Eigen3_support) endforeach() + find_package(OpenMesh QUIET) if(OpenMesh_FOUND) + include(UseOpenMesh) create_single_source_cgal_program("MCF_Skeleton_om_example.cpp") - target_link_libraries( MCF_Skeleton_om_example PUBLIC CGAL::Eigen3_support PRIVATE ${OPENMESH_LIBRARIES}) + target_link_libraries(MCF_Skeleton_om_example PUBLIC CGAL::Eigen3_support PRIVATE ${OPENMESH_LIBRARIES}) + else() + message(STATUS "NOTICE: Examples that use OpenMesh will not be compiled.") endif() else() message("NOTICE: These programs require the Eigen library (3.2 or greater), and will not be compiled.") diff --git a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt index 0c39993aed8..758f2f8bd87 100644 --- a/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt +++ b/Surface_mesh_skeletonization/test/Surface_mesh_skeletonization/CMakeLists.txt @@ -6,7 +6,7 @@ project(Surface_mesh_skeletonization_Tests) find_package(CGAL REQUIRED) -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +find_package(Eigen3 3.2.0 REQUIRED) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("MCF_Skeleton_test.cpp") diff --git a/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt b/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt index d0521ebfc51..1eaee1642bc 100644 --- a/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt +++ b/Surface_mesh_topology/benchmark/Surface_mesh_topology/CMakeLists.txt @@ -2,7 +2,7 @@ project(Surface_mesh_topology_Benchmarks) cmake_minimum_required(VERSION 3.1...3.23) -find_package(CGAL) +find_package(CGAL REQUIRED) # add_definitions(-DCGAL_TRACE_PATH_TESTS) # add_definitions(-DCGAL_TRACE_CMAP_TOOLS) diff --git a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt index b94703841f1..9e89831fc98 100644 --- a/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/examples/Tetrahedral_remeshing/CMakeLists.txt @@ -8,11 +8,10 @@ project(Tetrahedral_remeshing_Examples) # CGAL and its components find_package(CGAL REQUIRED) -# Use Eigen for Mesh_3 -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) -include(CGAL_Eigen3_support) -find_package(TBB QUIET) -include(CGAL_TBB_support) +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_from_mesh.cpp") # Concurrent Mesh_3 option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF) @@ -20,17 +19,16 @@ 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) +else() + find_package(TBB QUIET) + include(CGAL_TBB_support) endif() -# 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_from_mesh.cpp") - +# Use Eigen for Mesh_3 +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) +include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) -create_single_source_cgal_program( "mesh_and_remesh_polyhedral_domain_with_features.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::Eigen3_support) if(CGAL_ACTIVATE_CONCURRENT_MESH_3 AND TARGET CGAL::TBB_support) target_link_libraries(mesh_and_remesh_polyhedral_domain_with_features PRIVATE CGAL::TBB_support) diff --git a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt index 6cebbe30e7e..a47c71cd04f 100644 --- a/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt +++ b/Tetrahedral_remeshing/test/Tetrahedral_remeshing/CMakeLists.txt @@ -8,40 +8,25 @@ project(Tetrahedral_remeshing_Tests) # CGAL and its components 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.") - 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_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_from_mesh_file.cpp") # Tests using Mesh_3 require Eigen -find_package(Eigen3 3.1.0 REQUIRED) #(3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater) include(CGAL_Eigen3_support) -if(NOT TARGET CGAL::Eigen3_support) - message( - STATUS "This project requires the Eigen library, and will not be compiled.") - return() -endif() +if(TARGET CGAL::Eigen3_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::Eigen3_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::Eigen3_support) - -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::Eigen3_support) + 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::Eigen3_support) + else() + message(STATUS "NOTICE: The test 'test_mesh_and_remesh_image' uses zlib, and will not be compiled.") + endif() +else() + message(STATUS "NOTICE: Some tests require Eigen 3.1 (or greater), and will not be compiled.") endif() diff --git a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt index 8a207c2b79f..19fd0c0efac 100644 --- a/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt +++ b/Triangulation_3/benchmark/Triangulation_3/CMakeLists.txt @@ -12,25 +12,25 @@ create_single_source_cgal_program("incident_edges.cpp") create_single_source_cgal_program("simple_2.cpp") create_single_source_cgal_program("simple.cpp") create_single_source_cgal_program("Triangulation_benchmark_3.cpp") +create_single_source_cgal_program("segment_traverser_benchmark.cpp" ) -create_single_source_cgal_program( "segment_traverser_benchmark.cpp" ) - -find_package(benchmark) - -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) - - 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) +find_package(benchmark QUIET) +if(NOT TARGET benchmark::benchmark) + message(STATUS "NOTICE: Some benchmarks require the Google benchmark library, and will not be compiled.") + return() +endif() + +find_package(TBB REQUIRED) +include(CGAL_TBB_support) +if(TARGET 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) +else() + message(STATUS "NOTICE: Some benchmarks require the TBB library, and will not be compiled.") endif() diff --git a/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt index b8c1d21bba3..0e8422aefa1 100644 --- a/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/benchmark/Triangulation_on_sphere_2/CMakeLists.txt @@ -1,20 +1,12 @@ # Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. -project( Triangulation_on_sphere_2_Benchmarks ) - cmake_minimum_required(VERSION 3.1...3.23) +project( Triangulation_on_sphere_2_Benchmarks ) + find_package(CGAL REQUIRED COMPONENTS Core ) -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "bench_dtos2.cpp" ) - create_single_source_cgal_program( "generate_points.cpp" ) - -else() - - message(STATUS "This program requires the CGAL library, and will not be compiled.") - -endif() +create_single_source_cgal_program( "bench_dtos2.cpp" ) +create_single_source_cgal_program( "generate_points.cpp" ) diff --git a/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt index f99b2a133d0..a06979d869f 100644 --- a/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/demo/Triangulation_on_sphere_2/CMakeLists.txt @@ -26,7 +26,7 @@ find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) # Find Qt5 itself find_package(Qt5 QUIET COMPONENTS Script OpenGL Gui Svg) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(CGAL_Qt5_FOUND AND Qt5_FOUND AND TARGET CGAL::Eigen3_support) diff --git a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt index 36405ad2cb7..6e26394bee1 100644 --- a/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt +++ b/Triangulation_on_sphere_2/test/Triangulation_on_sphere_2/CMakeLists.txt @@ -4,23 +4,18 @@ project( Triangulation_on_sphere_2_Tests ) find_package(CGAL REQUIRED COMPONENTS Core) -find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) +create_single_source_cgal_program( "test_dtos.cpp" ) +create_single_source_cgal_program( "test_dtos2_remove.cpp" ) +create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) +create_single_source_cgal_program( "test_dtos_illegal_points.cpp" ) +create_single_source_cgal_program( "test_dtos_projection_traits.cpp" ) +create_single_source_cgal_program( "test_dtos_traits.cpp" ) + +find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater) include(CGAL_Eigen3_support) - -if ( CGAL_FOUND ) - - create_single_source_cgal_program( "test_dtos.cpp" ) - create_single_source_cgal_program( "test_dtos2_remove.cpp" ) - create_single_source_cgal_program( "test_dtos_degenerate_cases.cpp" ) - create_single_source_cgal_program( "test_dtos_illegal_points.cpp" ) - create_single_source_cgal_program( "test_dtos_projection_traits.cpp" ) - create_single_source_cgal_program( "test_dtos_traits.cpp" ) - - if(TARGET CGAL::Eigen3_support) - create_single_source_cgal_program( "test_dtos_dual.cpp" ) - target_link_libraries(test_dtos_dual PUBLIC CGAL::Eigen3_support) - endif() - +if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program( "test_dtos_dual.cpp" ) + target_link_libraries(test_dtos_dual PUBLIC CGAL::Eigen3_support) else() message(STATUS "NOTICE: The Eigen library was not found. The test 'test_dtos_dual' will not be compiled.") endif() diff --git a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt index 3408ad984cb..ea1bf322bf5 100644 --- a/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/examples/Voronoi_diagram_2/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.1...3.23) project(Voronoi_diagram_2_Examples) -find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5) +find_package(CGAL REQUIRED QUIET OPTIONAL_COMPONENTS Qt5) # create a target per cppfile file( diff --git a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt index 9172b01d64d..3c52d3d7eca 100644 --- a/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt +++ b/Voronoi_diagram_2/test/Voronoi_diagram_2/CMakeLists.txt @@ -12,7 +12,7 @@ create_single_source_cgal_program("vda_pt.cpp") create_single_source_cgal_program("vda_rt.cpp") create_single_source_cgal_program("vda_sdg.cpp") -find_package(Eigen3 3.2.0) #(requires 3.2.0 or greater) +find_package(Eigen3 3.2.0 QUIET) #(requires 3.2.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("vda_tos2.cpp") diff --git a/Weights/examples/Weights/CMakeLists.txt b/Weights/examples/Weights/CMakeLists.txt index 1ccd0cf4364..bfa7a57734b 100644 --- a/Weights/examples/Weights/CMakeLists.txt +++ b/Weights/examples/Weights/CMakeLists.txt @@ -11,7 +11,7 @@ create_single_source_cgal_program("projection_traits.cpp") create_single_source_cgal_program("custom_traits.cpp") create_single_source_cgal_program("convergence.cpp") -find_package(Eigen3 3.1.0 QUIET) # (3.1.0 or greater) +find_package(Eigen3 3.1.0 QUIET) # (requires 3.1.0 or greater) include(CGAL_Eigen3_support) if(TARGET CGAL::Eigen3_support) create_single_source_cgal_program("weighted_laplacian.cpp")