From 9c56293e8b6b4e719f7591c2a2c4cd52f799c095 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 5 Aug 2025 15:14:06 +0200 Subject: [PATCH] build targets only if Eigen is available --- .../examples/Basic_viewer/CMakeLists.txt | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt index 29c492e8864..14d1847d719 100644 --- a/Basic_viewer/examples/Basic_viewer/CMakeLists.txt +++ b/Basic_viewer/examples/Basic_viewer/CMakeLists.txt @@ -15,8 +15,6 @@ find_package(Eigen3 3.1.0) include(CGAL_Eigen3_support) create_single_source_cgal_program("draw_lcc.cpp") -create_single_source_cgal_program("draw_mesh_and_points.cpp") -create_single_source_cgal_program("draw_several_windows.cpp") create_single_source_cgal_program("draw_surface_mesh_height.cpp") create_single_source_cgal_program("draw_surface_mesh_small_faces.cpp") create_single_source_cgal_program("draw_surface_mesh_vcolor.cpp") @@ -24,18 +22,20 @@ create_single_source_cgal_program("draw_surface_mesh_vcolor.cpp") if(CGAL_Qt6_FOUND) #link it with the required CGAL libraries target_link_libraries(draw_lcc PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(draw_mesh_and_points PUBLIC CGAL::CGAL_Basic_viewer) - target_link_libraries(draw_several_windows PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_surface_mesh_height PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_surface_mesh_small_faces PUBLIC CGAL::CGAL_Basic_viewer) target_link_libraries(draw_surface_mesh_vcolor PUBLIC CGAL::CGAL_Basic_viewer) + if(TARGET CGAL::Eigen3_support) + create_single_source_cgal_program("draw_mesh_and_points.cpp") + create_single_source_cgal_program("draw_several_windows.cpp") + target_link_libraries(draw_mesh_and_points PUBLIC CGAL::Eigen3_support CGAL::CGAL_Basic_viewer) + target_link_libraries(draw_several_windows PUBLIC CGAL::Eigen3_support CGAL::CGAL_Basic_viewer) + else() + message("Eigen3 is not found, examples that require Eigen3 will not be compiled.") + endif() else() message("CGAL_Qt6 not configured: examples that require Qt will not be compiled.") endif() -if(TARGET CGAL::Eigen3_support) - target_link_libraries(draw_mesh_and_points PUBLIC CGAL::Eigen3_support) - target_link_libraries(draw_several_windows PUBLIC CGAL::Eigen3_support) -endif() #end of the file