diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index 4530e273a65..2aa8c6dc98b 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -59,15 +59,12 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FO "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp" ) add_executable ( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - qt5_use_modules(AABB_demo Gui OpenGL Xml Script Svg ) # Link with Qt libraries - target_link_libraries( AABB_demo ${QT_LIBRARIES} ) - - # Link with CGAL - target_link_libraries( AABB_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) - - # Link with libQGLViewer, OpenGL - target_link_libraries( AABB_demo ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) + target_link_libraries( AABB_demo PRIVATE + Qt5::OpenGL Qt5::Gui + CGAL::CGAL + CGAL::CGAL_Qt5 + ${QGLVIEWER_LIBRARIES}) add_to_cached_list( CGAL_EXECUTABLE_TARGETS AABB_demo ) diff --git a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt index 26cb959127e..aff5f691af5 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -40,12 +40,12 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_ qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Alpha_shape_3.qrc ) add_executable ( Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - qt5_use_modules(Alpha_shape_3 Xml Script OpenGL Svg) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Alpha_shape_3 ) - target_link_libraries( Alpha_shape_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) - target_link_libraries( Alpha_shape_3 ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ) - target_link_libraries( Alpha_shape_3 ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) + target_link_libraries( Alpha_shape_3 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::OpenGL Qt5::Gui + ${QGLVIEWER_LIBRARIES} ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Alpha_shapes_3) 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 5f57b028681..e74250bee26 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 @@ -11,7 +11,7 @@ endif() find_package(CGAL COMPONENTS Core Qt5 ) include( ${CGAL_USE_FILE} ) -find_package( Qt5 QUIET COMPONENTS Script Widgets ) +find_package( Qt5 QUIET COMPONENTS Gui ) if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) include_directories( ./ ) @@ -68,11 +68,9 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND CGAL_Core_FOUND) ${arrangement_2_uis} ${CGAL_Qt5_RESOURCE_FILES} ) - qt5_use_modules(arrangement_2 Widgets Script) - target_link_libraries( arrangement_2 - ${CGAL_LIBRARIES} - ${CGAL_3RD_PARTY_LIBRARIES} - ${QT_LIBRARIES} + target_link_libraries( arrangement_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_Core + Qt5::Gui ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS arrangement_2 ) diff --git a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt index e0710c8dca8..1d3a689b16f 100644 --- a/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt +++ b/Circular_kernel_3/demo/Circular_kernel_3/CMakeLists.txt @@ -22,13 +22,11 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_ add_executable (Circular_kernel_3 Circular_kernel_3.cpp Viewer.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - qt5_use_modules( Circular_kernel_3 Xml Script OpenGL) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Circular_kernel_3 ) - target_link_libraries( Circular_kernel_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) - target_link_libraries( Circular_kernel_3 ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ) - target_link_libraries( Circular_kernel_3 ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) + target_link_libraries( Circular_kernel_3 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::OpenGL Qt5::Gui ${QGLVIEWER_LIBRARIES} ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Circular_kernel_3) diff --git a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt index 95b214b90f7..6a25f5aca4b 100644 --- a/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt +++ b/GraphicsView/demo/Alpha_shapes_2/CMakeLists.txt @@ -35,14 +35,10 @@ qt5_generate_moc( Alpha_shapes_2.cpp Alpha_shapes_2.moc ) # The executable itself. add_executable ( Alpha_shapes_2 Alpha_shapes_2.cpp Alpha_shapes_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -qt5_use_modules(Alpha_shapes_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Alpha_shapes_2 ) -# Link with Qt libraries -target_link_libraries( Alpha_shapes_2 ${QT_LIBRARIES} ) -# Link with CGAL -target_link_libraries( Alpha_shapes_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( Alpha_shapes_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Alpha_shapes_2) diff --git a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt index cb361a81704..216003b19ae 100644 --- a/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Apollonius_graph_2/CMakeLists.txt @@ -33,14 +33,11 @@ qt5_generate_moc( Apollonius_graph_2.cpp Apollonius_graph_2.moc ) # The executable itself. add_executable ( Apollonius_graph_2 Apollonius_graph_2.cpp Apollonius_graph_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -qt5_use_modules(Apollonius_graph_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Apollonius_graph_2 ) -# Link with Qt libraries -target_link_libraries( Apollonius_graph_2 ${QT_LIBRARIES} ) -# Link with CGAL -target_link_libraries( Apollonius_graph_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( Apollonius_graph_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 + Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Apollonius_graph_2) diff --git a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt index 17b88d135da..f313788c6d3 100644 --- a/GraphicsView/demo/Bounding_volumes/CMakeLists.txt +++ b/GraphicsView/demo/Bounding_volumes/CMakeLists.txt @@ -38,14 +38,10 @@ qt5_generate_moc( "Bounding_volumes.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Bounding_v # The executable itself. add_executable ( Bounding_volumes Bounding_volumes.cpp Bounding_volumes.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -qt5_use_modules(Bounding_volumes Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Bounding_volumes ) -# Link with Qt libraries -target_link_libraries( Bounding_volumes ${QT_LIBRARIES} ) -# Link with CGAL -target_link_libraries( Bounding_volumes ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( Bounding_volumes PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Bounding_volumes) diff --git a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt index 6f033007c36..a117a1bbd86 100644 --- a/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt +++ b/GraphicsView/demo/Circular_kernel_2/CMakeLists.txt @@ -38,14 +38,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # The executable itself. add_executable ( Circular_kernel_2 Circular_kernel_2.cpp Circular_kernel_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - qt5_use_modules(Circular_kernel_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Circular_kernel_2 ) - # Link with Qt libraries - target_link_libraries( Circular_kernel_2 ${QT_LIBRARIES} ) - # Link with CGAL - target_link_libraries( Circular_kernel_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) + target_link_libraries( Circular_kernel_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Circular_kernel_2) diff --git a/GraphicsView/demo/Generator/CMakeLists.txt b/GraphicsView/demo/Generator/CMakeLists.txt index 20d55b80364..186f37e94dd 100644 --- a/GraphicsView/demo/Generator/CMakeLists.txt +++ b/GraphicsView/demo/Generator/CMakeLists.txt @@ -1,4 +1,3 @@ -# Created by the script cgal_create_cmake_script # This is the CMake script for compiling a CGAL application. project (Generator_Demo) @@ -15,8 +14,6 @@ include(${CGAL_USE_FILE}) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) -include_directories (BEFORE ../../include) - if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_definitions(-DQT_NO_KEYWORDS) @@ -35,14 +32,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # The executable itself. add_executable ( Generator_2 Generator_2.cpp Generator_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) - qt5_use_modules(Generator_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Generator_2 ) - # Link with Qt libraries - target_link_libraries( Generator_2 ${QT_LIBRARIES} ) - # And with CGAL libraries - target_link_libraries( Generator_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) + target_link_libraries( Generator_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Generator_2) diff --git a/GraphicsView/demo/GraphicsView/CMakeLists.txt b/GraphicsView/demo/GraphicsView/CMakeLists.txt index 43fe068f16b..3da163ace44 100644 --- a/GraphicsView/demo/GraphicsView/CMakeLists.txt +++ b/GraphicsView/demo/GraphicsView/CMakeLists.txt @@ -20,14 +20,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) add_executable ( min min.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - qt5_use_modules(min Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS min ) - # Link with Qt libraries - target_link_libraries( min ${QT_LIBRARIES} ) - # Link with CGAL - target_link_libraries( min ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) + target_link_libraries( min PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(min) diff --git a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt index 4200fea0c99..dcdca1f8b5c 100644 --- a/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt +++ b/GraphicsView/demo/L1_Voronoi_diagram_2/CMakeLists.txt @@ -37,14 +37,10 @@ qt5_generate_moc( L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc ) # The executable itself. add_executable ( L1_voronoi_diagram_2 L1_voronoi_diagram_2.cpp L1_voronoi_diagram_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) -qt5_use_modules(L1_voronoi_diagram_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS L1_voronoi_diagram_2 ) -# Link with Qt libraries -target_link_libraries( L1_voronoi_diagram_2 ${QT_LIBRARIES} ) -# Link with CGAL -target_link_libraries( L1_voronoi_diagram_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( L1_voronoi_diagram_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(L1_voronoi_diagram_2) diff --git a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt index 2ad6a04906b..f3ea3822cee 100644 --- a/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt +++ b/GraphicsView/demo/Largest_empty_rect_2/CMakeLists.txt @@ -36,14 +36,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # The executable itself. add_executable ( Largest_empty_rectangle_2 Largest_empty_rectangle_2.cpp Largest_empty_rectangle_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) - qt5_use_modules(Largest_empty_rectangle_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Largest_empty_rectangle_2 ) - # Link with Qt libraries - target_link_libraries( Largest_empty_rectangle_2 ${QT_LIBRARIES} ) - # And with CGAL libraries - target_link_libraries( Largest_empty_rectangle_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) + target_link_libraries( Largest_empty_rectangle_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Largest_empty_rectangle_2) diff --git a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt index 72ac2b6b0b1..065264be817 100644 --- a/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt +++ b/GraphicsView/demo/Periodic_2_triangulation_2/CMakeLists.txt @@ -53,14 +53,10 @@ add_executable ( Periodic_2_Delaunay_triangulation_2 ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ${headers} ${QT_headers} ${P2T2_headers}) -qt5_use_modules( Periodic_2_Delaunay_triangulation_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Periodic_2_Delaunay_triangulation_2 ) -# Link with Qt libraries -target_link_libraries( Periodic_2_Delaunay_triangulation_2 ${QT_LIBRARIES} ) -# Link with CGAL -target_link_libraries( Periodic_2_Delaunay_triangulation_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( Periodic_2_Delaunay_triangulation_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Periodic_2_Delaunay_triangulation_2) diff --git a/GraphicsView/demo/Polygon/CMakeLists.txt b/GraphicsView/demo/Polygon/CMakeLists.txt index 45df0dadfe6..ed26300f92c 100644 --- a/GraphicsView/demo/Polygon/CMakeLists.txt +++ b/GraphicsView/demo/Polygon/CMakeLists.txt @@ -43,15 +43,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # The executable itself. add_executable ( Polygon_2 Polygon_2.cpp Polygon_2.moc ${DT_UI_FILES} ${DT_RESOURCE_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) - qt5_use_modules(Polygon_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polygon_2 ) - - # Link with Qt libraries - target_link_libraries( Polygon_2 ${QT_LIBRARIES} ) - # And with CGAL libraries - target_link_libraries( Polygon_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) + target_link_libraries( Polygon_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Polygon_2) diff --git a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt index ba62fdb3ca2..d686684058e 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_2/CMakeLists.txt @@ -43,14 +43,10 @@ qt5_generate_moc( "Segment_voronoi_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Segment_v # The executable itself. add_executable ( Segment_voronoi_2 Segment_voronoi_2.cpp Segment_voronoi_2.moc ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -qt5_use_modules(Segment_voronoi_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Segment_voronoi_2 ) -# Link with Qt libraries -target_link_libraries( Segment_voronoi_2 ${QT_LIBRARIES} ) -# Link with CGAL -target_link_libraries( Segment_voronoi_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( Segment_voronoi_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Segment_voronoi_2) diff --git a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt index dd4b1b0f9b9..235361f99be 100644 --- a/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt +++ b/GraphicsView/demo/Segment_Delaunay_graph_Linf_2/CMakeLists.txt @@ -43,14 +43,10 @@ qt5_generate_moc( "Segment_voronoi_linf_2.cpp" "${CMAKE_CURRENT_BINARY_DIR}/Segm # The executable itself. add_executable ( Segment_voronoi_linf_2 Segment_voronoi_linf_2.cpp Segment_voronoi_linf_2.moc ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -qt5_use_modules(Segment_voronoi_linf_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Segment_voronoi_linf_2 ) -# Link with Qt libraries -target_link_libraries( Segment_voronoi_linf_2 ${QT_LIBRARIES} ) -# Link with CGAL -target_link_libraries( Segment_voronoi_linf_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( Segment_voronoi_linf_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Segment_voronoi_linf_2) diff --git a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt index b18bfb544f7..6ece40f7cc4 100644 --- a/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt +++ b/GraphicsView/demo/Snap_rounding_2/CMakeLists.txt @@ -35,14 +35,10 @@ qt5_generate_moc( Snap_rounding_2.cpp Snap_rounding_2.moc ) # The executable itself. add_executable ( Snap_rounding_2 Snap_rounding_2.cpp Snap_rounding_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) -qt5_use_modules(Snap_rounding_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Snap_rounding_2 ) -# Link with Qt libraries -target_link_libraries( Snap_rounding_2 ${QT_LIBRARIES} ) -# Link with CGAL -target_link_libraries( Snap_rounding_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( Snap_rounding_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Snap_rounding_2) diff --git a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt index 5115e9ef877..92c07195c75 100644 --- a/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt +++ b/GraphicsView/demo/Spatial_searching_2/CMakeLists.txt @@ -37,14 +37,11 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) # The executable itself. add_executable ( Spatial_searching_2 Spatial_searching_2.cpp Spatial_searching_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) - qt5_use_modules(Spatial_searching_2 Xml Script OpenGL Svg) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Spatial_searching_2 ) - # Link with Qt libraries - target_link_libraries( Spatial_searching_2 ${QT_LIBRARIES} ) - # And with CGAL libraries - target_link_libraries( Spatial_searching_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) + target_link_libraries( Spatial_searching_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Spatial_searching_2) diff --git a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt index 1eb35afe5da..3a743095650 100644 --- a/GraphicsView/demo/Stream_lines_2/CMakeLists.txt +++ b/GraphicsView/demo/Stream_lines_2/CMakeLists.txt @@ -36,14 +36,10 @@ qt5_generate_moc( Stream_lines_2.cpp Stream_lines_2.moc ) # The executable itself. add_executable ( Stream_lines_2 Stream_lines_2.cpp Stream_lines_2.moc ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} ) -qt5_use_modules(Stream_lines_2 Xml Script OpenGL Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS Stream_lines_2 ) -# Link with Qt libraries -target_link_libraries( Stream_lines_2 ${QT_LIBRARIES} ) -# Link with CGAL -target_link_libraries( Stream_lines_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( Stream_lines_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Stream_lines_2) diff --git a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt index c903c41c7c5..489aab258da 100644 --- a/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt +++ b/Linear_cell_complex/demo/Linear_cell_complex/CMakeLists.txt @@ -71,15 +71,11 @@ add_executable(Linear_cell_complex_3_demo typedefs.h import_moka.h ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -qt5_use_modules(Linear_cell_complex_3_demo Xml Script OpenGL Svg) add_to_cached_list(CGAL_EXECUTABLE_TARGETS Linear_cell_complex_3_demo) -target_link_libraries(Linear_cell_complex_3_demo ${CGAL_LIBRARIES} - ${CGAL_3RD_PARTY_LIBRARIES}) -target_link_libraries(Linear_cell_complex_3_demo ${QT_LIBRARIES} - ${QGLVIEWER_LIBRARIES} ) -target_link_libraries(Linear_cell_complex_3_demo ${OPENGL_gl_LIBRARY} - ${OPENGL_glu_LIBRARY} ) +target_link_libraries(Linear_cell_complex_3_demo PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui Qt5::OpenGL + ${QGLVIEWER_LIBRARIES} ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Linear_cell_complex_3_demo) 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 cfa65d829cb..e45680f895b 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 @@ -31,8 +31,6 @@ find_path(CIMG_INCLUDE_DIR DOC "Path to the header of the CImg library") if (CIMG_INCLUDE_DIR) - add_definitions(-DCGAL_USE_CIMG) - include_directories(${CIMG_INCLUDE_DIR}) MESSAGE(STATUS "CImg library found, the demo can load point set from image files.") else() MESSAGE(STATUS "CImg library was not found, the demo will not be able to load point set from image files. " @@ -79,24 +77,18 @@ if(CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND) add_executable ( Otr2_demo ${SRCS} ${CGAL_Qt5_MOC_FILES} ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}) - qt5_use_modules(Otr2_demo OpenGL) - - # Link with Qt libraries - target_link_libraries( Otr2_demo ${QT_LIBRARIES} ) - - # Link with CGAL - target_link_libraries( Otr2_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) - - # Link with OpenGL - target_link_libraries( Otr2_demo ${OPENGL_gl_LIBRARY} ) + target_link_libraries( Otr2_demo PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui Qt5::OpenGL ) # Link with pthread if necessary if (CIMG_INCLUDE_DIR) + target_compile_definitions( Otr2_demo PRIVATE -DCGAL_USE_CIMG ) + target_include_directories( Otr2_demo PRIVATE ${CIMG_INCLUDE_DIR} ) # Is pthread around? If yes, we need to link against it set(CMAKE_THREAD_PREFER_PTHREAD TRUE) find_package (Threads) if (CMAKE_USE_PTHREADS_INIT) - target_link_libraries( Otr2_demo ${CMAKE_THREAD_LIBS_INIT} ) + target_link_libraries( Otr2_demo PRIVATE ${CMAKE_THREAD_LIBS_INIT} ) endif() endif() diff --git a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt index bfbb1a30ed0..a7ca6372d32 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_3_triangulation_3/CMakeLists.txt @@ -67,12 +67,10 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND OPENGL_FOUND AND Qt5_FOUND AND QGLVIEWER_F MainWindow.ui moc_MainWindow.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES} Periodic_3_triangulation_3.qhc) - qt5_use_modules(periodic_3_triangulation_3_demo Xml Help OpenGL) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS periodic_3_triangulation_3_demo) - # Link the executable to CGAL and third-party libraries - target_link_libraries(periodic_3_triangulation_3_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) + target_link_libraries(periodic_3_triangulation_3_demo PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::OpenGL Qt5::Help ${QGLVIEWER_LIBRARIES}) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(periodic_3_triangulation_3_demo) diff --git a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt index e7129539cd1..4947dbfd2d4 100644 --- a/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt +++ b/Periodic_3_triangulation_3/demo/Periodic_Lloyd_3/CMakeLists.txt @@ -58,12 +58,11 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_ add_executable ( Periodic_Lloyd_3 Periodic_Lloyd_3.qhc Periodic_Lloyd_3.cpp MainWindow.cpp Viewer.cpp ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - qt5_use_modules(Periodic_Lloyd_3 Xml Script Help OpenGL Svg) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Periodic_Lloyd_3 ) - target_link_libraries( Periodic_Lloyd_3 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) - target_link_libraries( Periodic_Lloyd_3 ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ) - target_link_libraries( Periodic_Lloyd_3 ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) + target_link_libraries( Periodic_Lloyd_3 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::OpenGL Qt5::Help + ${QGLVIEWER_LIBRARIES} ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Periodic_Lloyd_3) diff --git a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt index 6e386fd7cc2..3b076bd0f77 100644 --- a/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt +++ b/Polyline_simplification_2/demo/Polyline_simplification_2/CMakeLists.txt @@ -36,12 +36,8 @@ qt5_generate_moc( ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp Poly # The executable itself. add_executable ( Polyline_simplification_2 ${CMAKE_CURRENT_SOURCE_DIR}/Polyline_simplification_2.cpp Polyline_simplification_2.moc ${CDT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) -qt5_use_modules(Polyline_simplification_2 Xml Script OpenGL Widgets Svg) -# Link with Qt libraries -target_link_libraries( Polyline_simplification_2 ${QT_LIBRARIES} ) - -# Link with CGAL -target_link_libraries( Polyline_simplification_2 ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) +target_link_libraries( Polyline_simplification_2 PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS Polyline_simplification_2 ) diff --git a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt index 19580d1c191..b7f1604f58d 100644 --- a/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt +++ b/Principal_component_analysis/demo/Principal_component_analysis/CMakeLists.txt @@ -47,18 +47,12 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND) qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES PCA_demo.qrc ) - add_file_dependencies( PCA_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" - "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" ) - add_executable ( PCA_demo PCA_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - qt5_use_modules( PCA_demo Xml Script OpenGL) - # Link with Qt libraries - target_link_libraries( PCA_demo ${QT_LIBRARIES} ) + add_file_dependencies( PCA_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp" + "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp" ) + add_executable ( PCA_demo PCA_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - # Link with CGAL - target_link_libraries( PCA_demo ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES} ) - - # Link with libQGLViewer, OpenGL - target_link_libraries( PCA_demo ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}) + target_link_libraries( PCA_demo PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui ) add_to_cached_list( CGAL_EXECUTABLE_TARGETS PCA_demo ) diff --git a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt index e2d29549dd9..4a80ee6e571 100644 --- a/Surface_mesher/demo/Surface_mesher/CMakeLists.txt +++ b/Surface_mesher/demo/Surface_mesher/CMakeLists.txt @@ -97,8 +97,6 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) add_executable ( ${prj} ${sources} ${uis} ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES}) - qt5_use_modules(${prj} OpenGL Xml Svg) - add_to_cached_list( CGAL_EXECUTABLE_TARGETS ${prj} ) set(VTK_LIBS "") @@ -116,10 +114,10 @@ if ( CGAL_FOUND AND CGAL_Qt5_FOUND AND CGAL_ImageIO_FOUND) message(STATUS "For reading Dicom files install VTK first") endif() - # Link the executable to CGAL and third-party libraries - target_link_libraries( ${prj} ${CGAL_LIBRARIES} ${CGAL_3RD_PARTY_LIBRARIES}) - - target_link_libraries( ${prj} ${QT_LIBRARIES} ${QGLVIEWER_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ${VTK_LIBS}) + target_link_libraries( ${prj} PRIVATE + CGAL::CGAL CGAL::CGAL_Qt5 CGAL::CGAL_ImageIO + ${QGLVIEWER_LIBRARIES} + ${VTK_LIBS} ) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(${prj})