Switch to QT6 for the GraphicsView demos

This commit is contained in:
Andreas Fabri 2023-04-19 12:19:38 +01:00
parent ef46506378
commit c6ce5fb120
28 changed files with 236 additions and 239 deletions

View File

@ -13,31 +13,31 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
include_directories(BEFORE ./include)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Alpha_shapes_2.ui)
qt6_wrap_ui(DT_UI_FILES Alpha_shapes_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Alpha_shapes_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Alpha_shapes_2.qrc)
# The executable itself.
add_executable(
Alpha_shapes_2 Alpha_shapes_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}
${CGAL_Qt5_MOC_FILES})
Alpha_shapes_2 Alpha_shapes_2.cpp ${DT_UI_FILES} ${CGAL_Qt6_RESOURCE_FILES}
${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Alpha_shapes_2)
target_link_libraries(Alpha_shapes_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui)
target_link_libraries(Alpha_shapes_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Alpha_shapes_2)
@ -45,5 +45,5 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Alpha_shapes_2)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -13,32 +13,32 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
#--------------------------------
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Apollonius_graph_2.ui)
qt6_wrap_ui(DT_UI_FILES Apollonius_graph_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Apollonius_graph_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Apollonius_graph_2.qrc)
# use the Qt MOC preprocessor on classes that derives from QObject
# The executable itself.
add_executable(
Apollonius_graph_2 Apollonius_graph_2.cpp ${DT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Apollonius_graph_2)
target_link_libraries(Apollonius_graph_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui)
target_link_libraries(Apollonius_graph_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Apollonius_graph_2)
@ -46,5 +46,5 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Apollonius_graph_2)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -13,34 +13,34 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
include_directories(BEFORE ./include)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_AUTOMOC ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Bounding_volumes.ui)
qt6_wrap_ui(DT_UI_FILES Bounding_volumes.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Bounding_volumes.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Bounding_volumes.qrc)
# use the Qt MOC preprocessor on classes that derives from QObject
# The executable itself.
add_executable(
Bounding_volumes Bounding_volumes.cpp ${DT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Bounding_volumes)
target_link_libraries(Bounding_volumes PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui)
target_link_libraries(Bounding_volumes PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Bounding_volumes)
@ -50,6 +50,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -13,32 +13,32 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Circular_kernel_2.ui)
qt6_wrap_ui(DT_UI_FILES Circular_kernel_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Circular_kernel_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Circular_kernel_2.qrc)
# use the Qt MOC preprocessor on classes that derives from QObject
# The executable itself.
add_executable(
Circular_kernel_2 Circular_kernel_2.cpp ${DT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Circular_kernel_2)
target_link_libraries(Circular_kernel_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui)
target_link_libraries(Circular_kernel_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Circular_kernel_2)
@ -48,6 +48,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -12,36 +12,36 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Generator_2.ui)
qt6_wrap_ui(DT_UI_FILES Generator_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Generator_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Generator_2.qrc)
# use the Qt MOC preprocessor on classes that derives from QObject
# The executable itself.
add_executable(Generator_2 Generator_2.cpp ${DT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Generator_2)
target_link_libraries(Generator_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui)
target_link_libraries(Generator_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Generator_2)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -12,25 +12,25 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS Widgets OpenGLWidgets Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_executable(min min.cpp ${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
add_executable(min min.cpp ${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS min)
target_link_libraries(min PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui)
target_link_libraries(min PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(min)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -13,32 +13,32 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
include_directories(BEFORE ./include)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES L1_voronoi_diagram_2.ui)
qt6_wrap_ui(DT_UI_FILES L1_voronoi_diagram_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./L1_voronoi_diagram_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./L1_voronoi_diagram_2.qrc)
# The executable itself.
add_executable(
L1_voronoi_diagram_2 L1_voronoi_diagram_2.cpp ${DT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS L1_voronoi_diagram_2)
target_link_libraries(L1_voronoi_diagram_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui)
target_link_libraries(L1_voronoi_diagram_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(L1_voronoi_diagram_2)
@ -48,6 +48,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -13,36 +13,36 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Largest_empty_rectangle_2.ui)
qt6_wrap_ui(DT_UI_FILES Largest_empty_rectangle_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Largest_empty_rectangle_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Largest_empty_rectangle_2.qrc)
# The executable itself.
add_executable(
Largest_empty_rectangle_2 Largest_empty_rectangle_2.cpp ${DT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Largest_empty_rectangle_2)
target_link_libraries(Largest_empty_rectangle_2
PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui)
PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Largest_empty_rectangle_2)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -10,22 +10,22 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
include_directories(BEFORE ./include)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Periodic_2_triangulation_2.ui)
qt6_wrap_ui(DT_UI_FILES Periodic_2_triangulation_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Periodic_2_triangulation_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Periodic_2_triangulation_2.qrc)
# find header files for projects that can show them
file(GLOB headers "*.h")
@ -39,8 +39,8 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
Periodic_2_Delaunay_triangulation_2
Periodic_2_Delaunay_triangulation_2.cpp
${DT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES}
${CGAL_Qt5_MOC_FILES}
${CGAL_Qt6_RESOURCE_FILES}
${CGAL_Qt6_MOC_FILES}
${headers}
${QT_headers}
${P2T2_headers})
@ -49,12 +49,12 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
Periodic_2_Delaunay_triangulation_2)
target_link_libraries(Periodic_2_Delaunay_triangulation_2
PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui)
PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Periodic_2_Delaunay_triangulation_2)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -13,7 +13,7 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 Core)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6 Core)
find_package(Eigen3 3.1.0 QUIET) #(requires 3.1.0 or greater)
include(CGAL_Eigen3_support)
@ -22,9 +22,9 @@ if(NOT TARGET CGAL::Eigen3_support)
return()
endif()
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
include(${CGAL_USE_FILE})
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_AUTOMOC ON)
@ -34,25 +34,25 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
endif()
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Polygon_2.ui)
qt6_wrap_ui(DT_UI_FILES Polygon_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Polygon_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Polygon_2.qrc)
# add_library( CGAL SHARED IMPORTED )
# SET_PROPERTY(TARGET CGAL PROPERTY IMPORTED_LOCATION ${CGAL_LIBRARY} )
# The executable itself.
add_executable(Polygon_2 Polygon_2.cpp ${DT_UI_FILES} ${DT_RESOURCE_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Polygon_2)
target_link_libraries(Polygon_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
CGAL::Eigen3_support Qt5::Gui)
target_link_libraries(Polygon_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
CGAL::Eigen3_support Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Polygon_2)
else()
message("NOTICE: This demo requires CGAL, CGAL_Core, and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL, CGAL_Core, and Qt6, and will not be compiled.")
endif()

View File

@ -13,40 +13,36 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 Core)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6 Core)
set(QT_USE_QTXML TRUE)
set(QT_USE_QTMAIN TRUE)
set(QT_USE_QTSCRIPT TRUE)
set(QT_USE_QTOPENGL TRUE)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
include_directories(BEFORE ./include)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
set(CMAKE_AUTOMOC ON)
include(${CGAL_USE_FILE})
add_definitions(-DQT_NO_KEYWORDS)
# UI files (Qt Designer files)
qt5_wrap_ui(CDT_UI_FILES Segment_voronoi_2.ui)
qt6_wrap_ui(CDT_UI_FILES Segment_voronoi_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Segment_voronoi_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Segment_voronoi_2.qrc)
# The executable itself.
add_executable(
Segment_voronoi_2 Segment_voronoi_2.cpp ${CDT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Segment_voronoi_2)
target_link_libraries(Segment_voronoi_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui)
target_link_libraries(Segment_voronoi_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Segment_voronoi_2)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -13,39 +13,39 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5 Core)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6 Core)
set(QT_USE_QTXML TRUE)
set(QT_USE_QTMAIN TRUE)
set(QT_USE_QTSCRIPT TRUE)
set(QT_USE_QTOPENGL TRUE)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
include_directories(BEFORE ./include)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
set(CMAKE_AUTOMOC ON)
include(${CGAL_USE_FILE})
add_definitions(-DQT_NO_KEYWORDS)
# UI files (Qt Designer files)
qt5_wrap_ui(CDT_UI_FILES Segment_voronoi_2.ui)
qt6_wrap_ui(CDT_UI_FILES Segment_voronoi_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Segment_voronoi_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Segment_voronoi_2.qrc)
# The executable itself.
add_executable(
Segment_voronoi_linf_2 Segment_voronoi_linf_2.cpp ${CDT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Segment_voronoi_linf_2)
target_link_libraries(Segment_voronoi_linf_2 PRIVATE CGAL::CGAL
CGAL::CGAL_Qt5 Qt5::Gui)
CGAL::CGAL_Qt6 Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Segment_voronoi_linf_2)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -13,30 +13,30 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
set(CMAKE_AUTOMOC ON)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Snap_rounding_2.ui)
qt6_wrap_ui(DT_UI_FILES Snap_rounding_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Snap_rounding_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Snap_rounding_2.qrc)
# The executable itself.
add_executable(
Snap_rounding_2 Snap_rounding_2.cpp ${DT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Snap_rounding_2)
target_link_libraries(Snap_rounding_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui)
target_link_libraries(Snap_rounding_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Snap_rounding_2)
@ -44,5 +44,5 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Snap_rounding_2)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6<, and will not be compiled.")
endif()

View File

@ -13,36 +13,36 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Spatial_searching_2.ui)
qt6_wrap_ui(DT_UI_FILES Spatial_searching_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Spatial_searching_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Spatial_searching_2.qrc)
# The executable itself.
add_executable(
Spatial_searching_2 Spatial_searching_2.cpp ${DT_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CGAL_Qt5_MOC_FILES})
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Spatial_searching_2)
target_link_libraries(Spatial_searching_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui)
target_link_libraries(Spatial_searching_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Spatial_searching_2)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -13,31 +13,31 @@ if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
# UI files (Qt Designer files)
qt5_wrap_ui(DT_UI_FILES Stream_lines_2.ui)
qt6_wrap_ui(DT_UI_FILES Stream_lines_2.ui)
# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Stream_lines_2.qrc)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Stream_lines_2.qrc)
# The executable itself.
add_executable(
Stream_lines_2 Stream_lines_2.cpp ${DT_UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}
${CGAL_Qt5_MOC_FILES})
Stream_lines_2 Stream_lines_2.cpp ${DT_UI_FILES} ${CGAL_Qt6_RESOURCE_FILES}
${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Stream_lines_2)
target_link_libraries(Stream_lines_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Gui)
target_link_libraries(Stream_lines_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Gui)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Stream_lines_2)
@ -47,6 +47,6 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
else()
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
endif()

View File

@ -16,11 +16,11 @@ endif()
set(CMAKE_AUTOMOC TRUE)
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Widgets)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
find_package(Qt6 QUIET COMPONENTS Widgets)
if(NOT CGAL_Qt5_FOUND OR NOT Qt5_FOUND)
message("NOTICE: This demo requires CGAL and Qt5, and will not be compiled.")
if(NOT CGAL_Qt6_FOUND OR NOT Qt6_FOUND)
message("NOTICE: This demo requires CGAL and Qt6, and will not be compiled.")
return()
endif()
@ -31,15 +31,15 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
# The "constrained Delaunay" demo: Constrained_Delaunay_triangulation_2
#--------------------------------
qt5_add_resources(CD_RES_FILE Constrained_Delaunay_triangulation_2.qrc)
qt5_wrap_ui(CD_UI_FILES Constrained_Delaunay_triangulation_2.ui)
qt6_add_resources(CD_RES_FILE Constrained_Delaunay_triangulation_2.qrc)
qt6_wrap_ui(CD_UI_FILES Constrained_Delaunay_triangulation_2.ui)
# The executable itself.
add_executable(
Constrained_Delaunay_triangulation_2
Constrained_Delaunay_triangulation_2.cpp ${CD_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${CD_RES_FILE})
${CGAL_Qt6_RESOURCE_FILES} ${CD_RES_FILE})
target_link_libraries(Constrained_Delaunay_triangulation_2
PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets)
PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Widgets)
target_include_directories(Constrained_Delaunay_triangulation_2
PRIVATE ./include)
@ -48,14 +48,14 @@ add_to_cached_list(CGAL_EXECUTABLE_TARGETS Constrained_Delaunay_triangulation_2)
#--------------------------------
# The "Delaunay" demo: Delaunay_triangulation_2
#--------------------------------
qt5_wrap_ui(D_UI_FILES Delaunay_triangulation_2.ui)
qt5_add_resources(D_RES_FILE Delaunay_triangulation_2.qrc)
qt6_wrap_ui(D_UI_FILES Delaunay_triangulation_2.ui)
qt6_add_resources(D_RES_FILE Delaunay_triangulation_2.qrc)
# The executable itself.
add_executable(
Delaunay_triangulation_2 Delaunay_triangulation_2.cpp ${D_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${D_RES_FILE})
${CGAL_Qt6_RESOURCE_FILES} ${D_RES_FILE})
target_link_libraries(Delaunay_triangulation_2
PRIVATE CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Widgets)
PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 Qt6::Widgets)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Delaunay_triangulation_2)
@ -64,13 +64,13 @@ add_to_cached_list(CGAL_EXECUTABLE_TARGETS Delaunay_triangulation_2)
#--------------------------------
# The executable itself.
qt5_add_resources(R_RES_FILE Regular_triangulation_2.qrc)
qt5_wrap_ui(R_UI_FILES Regular_triangulation_2.ui)
qt6_add_resources(R_RES_FILE Regular_triangulation_2.qrc)
qt6_wrap_ui(R_UI_FILES Regular_triangulation_2.ui)
add_executable(
Regular_triangulation_2 Regular_triangulation_2.cpp ${R_UI_FILES}
${CGAL_Qt5_RESOURCE_FILES} ${R_RES_FILE})
target_link_libraries(Regular_triangulation_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Widgets)
${CGAL_Qt6_RESOURCE_FILES} ${R_RES_FILE})
target_link_libraries(Regular_triangulation_2 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Widgets)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Regular_triangulation_2)

View File

@ -32,12 +32,11 @@
#include <QMessageBox>
#include <QStatusBar>
#include <QGraphicsView>
#include <QGLWidget>
#include <QOpenGLWidget>
#include <QTextStream>
#include <QSettings>
#include <QUrl>
#include <QDesktopWidget>
#include <QRegExp>
#include <QRegularExpression>
#include <QSvgGenerator>
#include <QtCore>
#include <QtOpenGL>
@ -205,16 +204,16 @@ void
DemosMainWindow::setUseOpenGL(bool checked)
{
if(checked) {
QGLWidget* new_viewport = new QGLWidget;
// AF QOpenGLWidget* new_viewport = new QOpenGLWidget;
// Setup the format to allow antialiasing with OpenGL:
// one need to activate the SampleBuffers, if the graphic driver allows
// this.
QGLFormat glformat = new_viewport->format();
glformat.setOption(QGL::SampleBuffers);
new_viewport->setFormat(glformat);
// AF QGLFormat glformat = new_viewport->format();
// AF glformat.setOption(QGL::SampleBuffers);
// AF new_viewport->setFormat(glformat);
view->setViewport(new_viewport);
// AF view->setViewport(new_viewport);
}
else {
view->setViewport(new QWidget);

View File

@ -30,7 +30,6 @@
#include <QVector>
#include <QElapsedTimer>
#include <QTimer>
#include <QGLContext>
#include <QOpenGLWidget>
#include <QMouseEvent>
@ -72,8 +71,7 @@ class CGAL_QT_EXPORT QGLViewer : public QOpenGLWidget, public QOpenGLFunctions {
public:
//todo check if this is used. If not remove it
explicit QGLViewer(QGLContext* context, QWidget *parent = nullptr,
::Qt::WindowFlags flags = ::Qt::WindowType(0));
explicit QGLViewer(QOpenGLContext* context, QWidget *parent = nullptr,
::Qt::WindowFlags flags = ::Qt::WindowType(0));
explicit QGLViewer(QWidget *parent = nullptr,

View File

@ -31,7 +31,7 @@
#include <QDateTime>
#include <QDir>
#include <QFileInfo>
#include <QGLContext>
#include <QOpenGLContext>
#include <QImage>
#include <QMessageBox>
#include <QMouseEvent>

View File

@ -500,7 +500,7 @@ macro(set_special_prefix library prefix)
set(CGAL_EXT_LIB_${library}_PREFIX ${prefix})
endmacro()
set_special_prefix(Qt5 QT)
set_special_prefix(Qt6 QT)
set_special_prefix(Eigen3 EIGEN3)
set_special_prefix(Coin3D COIN3D)
@ -647,10 +647,10 @@ cache_get(CGAL_3RD_PARTY_INCLUDE_DIRS )
cache_get(CGAL_3RD_PARTY_LIBRARIES )
cache_get(CGAL_3RD_PARTY_LIBRARIES_DIRS)
install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/Qt" COMPONENT CGAL_Qt5)
install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/" DESTINATION "${CGAL_INSTALL_INC_DIR}/CGAL/Qt" COMPONENT CGAL_Qt6)
if(CGAL_BRANCH_BUILD)
install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/resources" COMPONENT CGAL_Qt5)
install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/icons" COMPONENT CGAL_Qt5)
install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/resources" COMPONENT CGAL_Qt6)
install(DIRECTORY "${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/" DESTINATION "${CGAL_INSTALL_CMAKE_DIR}/demo/icons" COMPONENT CGAL_Qt6)
endif()
#
@ -660,7 +660,7 @@ set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake)
get_property(CGAL_FOUND GLOBAL PROPERTY CGAL_FOUND)
get_property(CGAL_Core_FOUND GLOBAL PROPERTY CGAL_Core_FOUND)
get_property(CGAL_ImageIO_FOUND GLOBAL PROPERTY CGAL_ImageIO_FOUND)
get_property(CGAL_Qt5_FOUND GLOBAL PROPERTY CGAL_Qt5_FOUND)
get_property(CGAL_Qt6_FOUND GLOBAL PROPERTY CGAL_Qt6_FOUND)
#
# Repeat some problems
@ -928,7 +928,7 @@ if(CGAL_BRANCH_BUILD)
find_package(GMP REQUIRED)
find_package(Doxygen REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(Qt5 COMPONENTS Core Widgets OpenGL Gui REQUIRED)
find_package(Qt6 COMPONENTS Core Widgets OpenGL Gui REQUIRED)
find_package(VTK COMPONENTS vtkImagingGeneral vtkIOImage NO_MODULE)
find_package(IPE)
find_package(RS3)
@ -939,10 +939,10 @@ if(CGAL_BRANCH_BUILD)
set(compile_options
"\
${CMAKE_CXX_FLAGS} -DCGAL_EIGEN3_ENABLED -DCGAL_PROFILE \
${Qt5Widgets_DEFINITIONS} ${Qt5OpenGL_DEFINITIONS} ${Qt5Gui_DEFINITIONS} \
${Qt5OpenGL_EXECUTABLE_COMPILE_FLAGS} -fPIC \
${Qt5Gui_EXECUTABLE_COMPILE_FLAGS} \
${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt5_3RD_PARTY_DEFINITIONS} \
${Qt6Widgets_DEFINITIONS} ${Qt6OpenGL_DEFINITIONS} ${Qt6Gui_DEFINITIONS} \
${Qt6OpenGL_EXECUTABLE_COMPILE_FLAGS} -fPIC \
${Qt6Gui_EXECUTABLE_COMPILE_FLAGS} \
${CGAL_3RD_PARTY_DEFINITIONS} ${CGAL_Qt6_3RD_PARTY_DEFINITIONS} \
${CGAL_DEFINITIONS}")
message("COMPILATION OPTIONS ARE : ${compile_options}")
@ -1032,11 +1032,11 @@ You must disable CGAL_ENABLE_CHECK_HEADERS.")
${RS_INCLUDE_DIR}
${EIGEN3_INCLUDE_DIR}
${GMP_INCLUDE_DIR}
${Qt5OpenGL_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5Gui_DEFINITIONS}
${Qt6OpenGL_INCLUDE_DIRS}
${Qt6Widgets_INCLUDE_DIRS}
${Qt6Gui_DEFINITIONS}
${CGAL_3RD_PARTY_INCLUDE_DIRS}
${CGAL_Qt5_3RD_PARTY_INCLUDE_DIRS})
${CGAL_Qt6_3RD_PARTY_INCLUDE_DIRS})
list(APPEND include_options "-I${incdir}")
endforeach()
include_directories(SYSTEM ${CGAL_3RD_PARTY_INCLUDE_DIRS})
@ -1234,7 +1234,7 @@ endif()
#print some info about versions
if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE)
find_package(Qt5 QUIET COMPONENTS Core)
find_package(Qt6 QUIET COMPONENTS Core)
find_package(Boost)
if(NOT CGAL_DISABLE_GMP)
find_package(GMP)
@ -1248,7 +1248,7 @@ if(RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE)
STATUS
"USING BOOST_VERSION = '${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}'"
)
if(Qt5_FOUND)
message(STATUS "USING Qt5_VERSION = '${Qt5Core_VERSION_STRING}'")
endif()#Qt5_FOUND
if(Qt6_FOUND)
message(STATUS "USING Qt6_VERSION = '${Qt6Core_VERSION_STRING}'")
endif()#Qt6_FOUND
endif()#RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE

View File

@ -36,7 +36,7 @@ else()
CGAL_alias_library(CGAL)
CGAL_alias_library(CGAL_Core)
CGAL_alias_library(CGAL_ImageIO)
CGAL_alias_library(CGAL_Qt5)
CGAL_alias_library(CGAL_Qt6)
endif()
macro(CGAL_set_LIB_LIBRARY_var lib)
@ -50,7 +50,7 @@ endmacro()
CGAL_set_LIB_LIBRARY_var(CGAL)
CGAL_set_LIB_LIBRARY_var(CGAL_Core)
CGAL_set_LIB_LIBRARY_var(CGAL_ImageIO)
CGAL_set_LIB_LIBRARY_var(CGAL_Qt5)
CGAL_set_LIB_LIBRARY_var(CGAL_Qt6)
set(CGAL_CONFIGURED_LIBRARIES "@CGAL_ACTUAL_CONFIGURED_LIBRARIES@")
@ -120,15 +120,15 @@ macro(check_cgal_component COMPONENT)
else( "${CGAL_LIB}" STREQUAL "CGAL" )
if ( WITH_${CGAL_LIB} )
if(TARGET CGAL::${CGAL_LIB})
if ("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_Qt5Dependencies.cmake")
if ("${CGAL_LIB}" STREQUAL "CGAL_Qt6")
if(CGAL_Qt5_MISSING_DEPS)
set( CGAL_Qt5_FOUND FALSE )
message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.")
include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_Qt6Dependencies.cmake")
if(CGAL_Qt6_MISSING_DEPS)
set( CGAL_Qt6_FOUND FALSE )
message(STATUS "libCGAL_Qt6 is missing the dependencies: ${CGAL_Qt6_MISSING_DEPS} cannot be configured.")
else()
set( CGAL_Qt5_FOUND TRUE )
set( CGAL_Qt6_FOUND TRUE )
endif()
elseif("${CGAL_LIB}" STREQUAL "CGAL_Core")
include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_CoreDependencies.cmake")
@ -138,10 +138,10 @@ macro(check_cgal_component COMPONENT)
else()
set( CGAL_Core_FOUND TRUE )
endif()
else("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
else("${CGAL_LIB}" STREQUAL "CGAL_Qt6")
# Libraries that have no dependencies
set( ${CGAL_LIB}_FOUND TRUE )
endif("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
endif("${CGAL_LIB}" STREQUAL "CGAL_Qt6")
else(TARGET CGAL::${CGAL_LIB})
set( ${CGAL_LIB}_FOUND FALSE )
set( CHECK_${CGAL_LIB}_ERROR_TAIL " CGAL was configured with WITH_${CGAL_LIB}=ON, but one of the dependencies of ${CGAL_LIB} was not configured properly." )
@ -214,7 +214,7 @@ if (NOT TARGET CGAL::CGAL_Basic_viewer)
add_library(CGAL::CGAL_Basic_viewer INTERFACE IMPORTED GLOBAL)
set_target_properties(CGAL::CGAL_Basic_viewer PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_BASIC_VIEWER;QT_NO_KEYWORDS"
INTERFACE_LINK_LIBRARIES CGAL::CGAL_Qt5)
INTERFACE_LINK_LIBRARIES CGAL::CGAL_Qt6)
endif()
include("${CGAL_MODULES_DIR}/CGAL_enable_end_of_configuration_hook.cmake")

View File

@ -104,15 +104,15 @@ macro(check_cgal_component COMPONENT)
if ( WITH_${CGAL_LIB} )
if(TARGET CGAL::${CGAL_LIB})
if ("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_Qt5Dependencies.cmake")
if ("${CGAL_LIB}" STREQUAL "CGAL_Qt6")
if(CGAL_Qt5_MISSING_DEPS)
set( CGAL_Qt5_FOUND FALSE )
message(STATUS "libCGAL_Qt5 is missing the dependencies: ${CGAL_Qt5_MISSING_DEPS} cannot be configured.")
include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_Qt6Dependencies.cmake")
if(CGAL_Qt6_MISSING_DEPS)
set( CGAL_Qt6_FOUND FALSE )
message(STATUS "libCGAL_Qt6 is missing the dependencies: ${CGAL_Qt6_MISSING_DEPS} cannot be configured.")
else()
set( CGAL_Qt5_FOUND TRUE )
set( CGAL_Qt6_FOUND TRUE )
endif()
elseif("${CGAL_LIB}" STREQUAL "CGAL_Core")
include("${CGAL_MODULES_DIR}/CGAL_SetupCGAL_CoreDependencies.cmake")
@ -122,10 +122,10 @@ macro(check_cgal_component COMPONENT)
else()
set( CGAL_Core_FOUND TRUE )
endif()
else("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
else("${CGAL_LIB}" STREQUAL "CGAL_Qt6")
# Libraries that have no dependencies
set( ${CGAL_LIB}_FOUND TRUE )
endif("${CGAL_LIB}" STREQUAL "CGAL_Qt5")
endif("${CGAL_LIB}" STREQUAL "CGAL_Qt6")
else(TARGET CGAL::${CGAL_LIB})
set( ${CGAL_LIB}_FOUND FALSE )
set( CHECK_${CGAL_LIB}_ERROR_TAIL " CGAL was configured with WITH_${CGAL_LIB}=ON, but one of the dependencies of ${CGAL_LIB} was not configured properly." )
@ -198,7 +198,7 @@ if (NOT TARGET CGAL::CGAL_Basic_viewer)
add_library(CGAL::CGAL_Basic_viewer INTERFACE IMPORTED GLOBAL)
set_target_properties(CGAL::CGAL_Basic_viewer PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_BASIC_VIEWER;QT_NO_KEYWORDS"
INTERFACE_LINK_LIBRARIES CGAL::CGAL_Qt5)
INTERFACE_LINK_LIBRARIES CGAL::CGAL_Qt6)
endif()
include("${CGAL_MODULES_DIR}/CGAL_enable_end_of_configuration_hook.cmake")

View File

@ -229,7 +229,7 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
message (STATUS "Configured ${lib} from UseLIB-file: ${usefile}")
# UseLIB-file has to set ${vlib}_SETUP to TRUE
# TODO EBEB what about Qt5, zlib?
# TODO EBEB what about Qt6, zlib?
else()
@ -288,11 +288,11 @@ if( NOT CGAL_MACROS_FILE_INCLUDED )
add_to_list( CGAL_3RD_PARTY_DEFINITIONS ${CGAL_${component}_3RD_PARTY_DEFINITIONS} )
add_to_list( CGAL_3RD_PARTY_LIBRARIES_DIRS ${CGAL_${component}_3RD_PARTY_LIBRARIES_DIRS} )
# To deal with imported targets of Qt5 and Boost, when CGAL
# To deal with imported targets of Qt6 and Boost, when CGAL
# targets are themselves imported by another project.
if (${component} STREQUAL "Qt5")
find_package(Qt5 COMPONENTS OpenGL Gui Core Script ScriptTools QUIET)
if (${component} STREQUAL "Qt6")
find_package(Qt6 COMPONENTS Widgets OpenGLWidgets Gui Core Script ScriptTools QUIET)
endif()
else(WITH_CGAL_${component})

View File

@ -4,7 +4,7 @@ endif()
set(CGAL_Qt6_moc_and_resource_files_included TRUE)
# qrc files (resources files, that contain icons, at least)
if(EXISTS ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/CGAL.qrc)
qt5_add_resources (_CGAL_Qt6_RESOURCE_FILES_private
qt6_add_resources (_CGAL_Qt6_RESOURCE_FILES_private
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/resources/CGAL.qrc
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/Input.qrc
${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/demo/icons/File.qrc
@ -15,11 +15,11 @@ else()
${CGAL_MODULES_DIR}/demo/resources
${CGAL_MODULES_DIR}/demo/icons
DESTINATION ${CMAKE_BINARY_DIR})
qt5_add_resources (_CGAL_Qt6_RESOURCE_FILES_private
qt6_add_resources (_CGAL_Qt6_RESOURCE_FILES_private
${CMAKE_BINARY_DIR}/resources/CGAL.qrc
${CMAKE_BINARY_DIR}/icons/Input.qrc
${CMAKE_BINARY_DIR}/icons/File.qrc
${CMAKE_BINARY_DIR}/icons/Triangulation_2.qrc)
endif()
qt5_wrap_ui(_CGAL_Qt6_UI_FILES ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/ImageInterface.ui)
qt_wrap_ui(_CGAL_Qt6_UI_FILES ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/ImageInterface.ui)

View File

@ -9,7 +9,7 @@
#
# .. code-block:: cmake
#
# find_package(Qt6 QUIET COMPONENTS OpenGL Svg)
# find_package(Qt6 QUIET COMPONENTS OpenGLWidgets Svg)
#
# and defines the variable :variable:`CGAL_Qt6_FOUND` and the function
# :command:`CGAL_setup_CGAL_Qt6_dependencies`.
@ -24,19 +24,24 @@ set(CGAL_SetupCGAL_Qt6Dependencies_included TRUE)
# Used Modules
# ^^^^^^^^^^^^
# - :module:`Qt6Config`
find_package(Qt6 QUIET COMPONENTS OpenGL Svg)
find_package(Qt6 QUIET COMPONENTS Widgets OpenGLWidgets Svg)
set(CGAL_Qt6_MISSING_DEPS "")
if(NOT Qt6OpenGL_FOUND)
set(CGAL_Qt6_MISSING_DEPS "Qt6OpenGL")
if(NOT Qt6OpenGLWidgets_FOUND)
message( STATUS "NOTICE: NOT Qt6OpenGLWidgets_FOUND")
set(CGAL_Qt6_MISSING_DEPS "Qt6OpenGLWidgets")
endif()
if(NOT Qt6Svg_FOUND)
message(STATUS "NOTICE: NOT Qt6Svg_FOUND")
set(CGAL_Qt6_MISSING_DEPS "${CGAL_Qt6_MISSING_DEPS} Qt6Svg")
endif()
if(NOT Qt6_FOUND)
message(STATUS "NOTICE: NOT Qt6_FOUND")
set(CGAL_Qt6_MISSING_DEPS "${CGAL_Qt6_MISSING_DEPS} Qt6")
endif()
if(NOT EXISTS ${CGAL_GRAPHICSVIEW_PACKAGE_DIR}/include/CGAL/Qt/GraphicsItem.h)
message(STATUS "NOTICE: NOT EXISTS GraphicsItem")
set(CGAL_Qt6_MISSING_DEPS "${CGAL_Qt6_MISSING_DEPS} <CGAL/Qt/*.h> headers")
endif()
@ -75,7 +80,7 @@ if(NOT CGAL_Qt6_MISSING_DEPS)
POSITION_INDEPENDENT_CODE TRUE
EXCLUDE_FROM_ALL TRUE
AUTOMOC TRUE)
target_link_libraries(CGAL_Qt6_moc_and_resources CGAL::CGAL Qt6::Widgets Qt6::OpenGL Qt6::Svg )
target_link_libraries(CGAL_Qt6_moc_and_resources CGAL::CGAL Qt6::Widgets Qt6::OpenGLWidgets Qt6::Svg )
add_library(CGAL::CGAL_Qt6_moc_and_resources ALIAS CGAL_Qt6_moc_and_resources)
add_library(CGAL::Qt6_moc_and_resources ALIAS CGAL_Qt6_moc_and_resources)
@ -112,7 +117,7 @@ function(CGAL_setup_CGAL_Qt6_dependencies target)
endif()
target_link_libraries( ${target} INTERFACE CGAL::CGAL)
target_link_libraries( ${target} INTERFACE CGAL::Qt6_moc_and_resources)
target_link_libraries( ${target} INTERFACE Qt6::OpenGL Qt6::Svg )
target_link_libraries( ${target} INTERFACE Qt6::OpenGLWidgets Qt6::Svg )
# Remove -Wdeprecated-copy, for g++ >= 9.0, because Qt6, as of
# version 5.12, has a lot of [-Wdeprecated-copy] warnings.

View File

@ -117,23 +117,23 @@ function(cgal_add_compilation_test exe_name)
set_property(TEST "check_build_system"
PROPERTY FIXTURES_SETUP "check_build_system_SetupFixture")
endif()
if(TARGET CGAL_Qt5_moc_and_resources) # if CGAL_Qt5 was searched, and is header-only
if(TARGET CGAL_Qt6_moc_and_resources) # if CGAL_Qt6 was searched, and is header-only
get_property(linked_libraries TARGET "${exe_name}" PROPERTY LINK_LIBRARIES)
# message(STATUS "${exe_name} depends on ${linked_libraries}")
string(FIND "${linked_libraries}" "CGAL::CGAL_Qt5" link_with_CGAL_Qt5)
if(link_with_CGAL_Qt5 STRGREATER "-1" AND
NOT TARGET compilation_of__CGAL_Qt5_moc_and_resources)
string(FIND "${linked_libraries}" "CGAL::CGAL_Qt6" link_with_CGAL_Qt6)
if(link_with_CGAL_Qt6 STRGREATER "-1" AND
NOT TARGET compilation_of__CGAL_Qt6_moc_and_resources)
# This custom target is useless. It is used only as a flag to
# detect that the test has already been created.
add_custom_target(compilation_of__CGAL_Qt5_moc_and_resources)
add_dependencies( compilation_of__CGAL_Qt5_moc_and_resources CGAL_Qt5_moc_and_resources )
add_test(NAME "compilation_of__CGAL_Qt5_moc_and_resources"
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "CGAL_Qt5_moc_and_resources" --config "$<CONFIG>")
set_property(TEST "compilation_of__CGAL_Qt5_moc_and_resources"
add_custom_target(compilation_of__CGAL_Qt6_moc_and_resources)
add_dependencies( compilation_of__CGAL_Qt6_moc_and_resources CGAL_Qt6_moc_and_resources )
add_test(NAME "compilation_of__CGAL_Qt6_moc_and_resources"
COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_BINARY_DIR}" --target "CGAL_Qt6_moc_and_resources" --config "$<CONFIG>")
set_property(TEST "compilation_of__CGAL_Qt6_moc_and_resources"
APPEND PROPERTY LABELS "CGAL_build_system")
set_property(TEST "compilation_of__CGAL_Qt5_moc_and_resources"
PROPERTY FIXTURES_SETUP "CGAL_Qt5_moc_and_resources_Fixture")
set_property(TEST "compilation_of__CGAL_Qt5_moc_and_resources"
set_property(TEST "compilation_of__CGAL_Qt6_moc_and_resources"
PROPERTY FIXTURES_SETUP "CGAL_Qt6_moc_and_resources_Fixture")
set_property(TEST "compilation_of__CGAL_Qt6_moc_and_resources"
APPEND PROPERTY DEPENDS "check_build_system")
endif()
endif()
@ -313,7 +313,7 @@ function(cgal_add_test exe_name)
-P "${CGAL_MODULES_DIR}/run_test_with_cin.cmake")
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${cin_file})
# message(STATUS "add test: ${exe_name} < ${cin_file}")
# message(STATUS "add test: ${exe_name} < ${cin_file}")
endif()
else()
if(NOT ARGS AND NOT cgal_add_test_TEST_NAME)
@ -328,12 +328,12 @@ function(cgal_add_test exe_name)
file(STRINGS "${cmd_file}" CMD_LINES)
string(CONFIGURE "${CMD_LINES}" CMD_LINES)
set(ARGS)
# message(STATUS "DEBUG test ${exe_name}")
# message(STATUS "DEBUG test ${exe_name}")
foreach(CMD_LINE ${CMD_LINES})
# message(STATUS " command line: ${CMD_LINE}")
# message(STATUS " command line: ${CMD_LINE}")
string(REGEX REPLACE "\#.*" "" CMD_LINE "${CMD_LINE}")
separate_arguments(CMD_LINE_ARGS UNIX_COMMAND ${CMD_LINE})
# message(STATUS " args: ${CMD_LINE_ARGS}")
# message(STATUS " args: ${CMD_LINE_ARGS}")
list(APPEND ARGS ${CMD_LINE_ARGS})
endforeach()
expand_list_with_globbing(ARGS)
@ -341,7 +341,7 @@ function(cgal_add_test exe_name)
APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${cmd_file})
endif()
endif()
# message(STATUS "add test: ${exe_name} ${ARGS}")
# message(STATUS "add test: ${exe_name} ${ARGS}")
if(ANDROID)
add_test(NAME ${test_name} COMMAND ${TIME_COMMAND} ${adb_executable} shell cd ${CGAL_REMOTE_TEST_DIR_PREFIX}${PROJECT_NAME} && LD_LIBRARY_PATH=${CGAL_REMOTE_TEST_DIR_PREFIX}${PROJECT_NAME} ${CGAL_REMOTE_TEST_DIR_PREFIX}${PROJECT_NAME}/${exe_name} ${ARGS})
elseif(CGAL_RUN_TESTS_THROUGH_SSH)

View File

@ -5,7 +5,7 @@ function(CGAL_setup_target_dependencies target)
CGAL_setup_CGAL_Core_dependencies(${target})
elseif(${target} STREQUAL CGAL_ImageIO)
CGAL_setup_CGAL_ImageIO_dependencies(${target})
elseif(${target} STREQUAL CGAL_Qt5)
CGAL_setup_CGAL_Qt5_dependencies(${target})
elseif(${target} STREQUAL CGAL_Qt6)
CGAL_setup_CGAL_Qt6_dependencies(${target})
endif()
endfunction()

View File

@ -128,7 +128,7 @@ if( CGAL_DEV_MODE OR RUNNING_CGAL_AUTO_TEST OR CGAL_TEST_SUITE )
endif()
foreach(comp ${CGAL_FIND_COMPONENTS})
if(NOT comp MATCHES "Core|ImageIO|Qt5")
if(NOT comp MATCHES "Core|ImageIO|Qt6")
message(FATAL_ERROR "The requested CGAL component ${comp} does not exist!")
endif()
if(comp MATCHES "Core" AND CGAL_DISABLE_GMP)
@ -193,6 +193,5 @@ if (NOT TARGET CGAL::CGAL_Basic_viewer)
add_library(CGAL::CGAL_Basic_viewer INTERFACE IMPORTED GLOBAL)
set_target_properties(CGAL::CGAL_Basic_viewer PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "CGAL_USE_BASIC_VIEWER;QT_NO_KEYWORDS"
INTERFACE_LINK_LIBRARIES CGAL::CGAL_Qt5)
INTERFACE_LINK_LIBRARIES CGAL::CGAL_Qt6)
endif()