diff --git a/AABB_tree/demo/AABB_tree/CMakeLists.txt b/AABB_tree/demo/AABB_tree/CMakeLists.txt index b66e3f46877..7411a48f67e 100644 --- a/AABB_tree/demo/AABB_tree/CMakeLists.txt +++ b/AABB_tree/demo/AABB_tree/CMakeLists.txt @@ -13,23 +13,19 @@ set(CMAKE_AUTOMOC ON) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) # Find Qt6 itself -find_package(Qt6 QUIET COMPONENTS Gui) +find_package(Qt6 QUIET COMPONENTS Gui OpenGL) if(CGAL_Qt6_FOUND AND Qt6_FOUND) qt6_wrap_ui(UI_FILES MainWindow.ui) - qt6_generate_moc("MainWindow.h" "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp") - qt6_generate_moc("Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp") - qt6_generate_moc("Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp") - qt6_add_resources(CGAL_Qt6_RESOURCE_FILES AABB_demo.qrc) add_executable( AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt6_RESOURCE_FILES} ) # Link with Qt libraries - target_link_libraries(AABB_demo PRIVATE Qt6::Gui + target_link_libraries(AABB_demo PRIVATE Qt6::Gui Qt6::OpenGL CGAL::CGAL CGAL::CGAL_Qt6) 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 6f08193da63..65b4e7febfe 100644 --- a/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt +++ b/Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt @@ -9,38 +9,27 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Instruct CMake to run moc automatically when needed. set(CMAKE_AUTOMOC ON) -if(NOT POLICY CMP0070 AND POLICY CMP0053) - # Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning. - cmake_policy(SET CMP0053 OLD) -endif() -if(POLICY CMP0071) - cmake_policy(SET CMP0071 NEW) -endif() find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) -find_package(Qt6 QUIET COMPONENTS Widgets OpenGL OpenGLWidgets) +find_package(Qt6 QUIET COMPONENTS Widgets OpenGL) if(CGAL_Qt6_FOUND AND Qt6_FOUND) add_definitions(-DQT_NO_KEYWORDS) - # include(${QT_USE_FILE}) - include_directories(BEFORE ./) - # ui file, created with Qt Designer qt6_wrap_ui(uis MainWindow.ui) # qrc files (resources files, that contain icons, at least) qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Alpha_shape_3.qrc) - add_executable( - Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis} - ${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES}) + add_executable(Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis}) + add_to_cached_list(CGAL_EXECUTABLE_TARGETS Alpha_shape_3) target_link_libraries(Alpha_shape_3 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 - Qt6::Widgets Qt6::OpenGL Qt6::OpenGLWidgets) + Qt6::Widgets Qt6::OpenGL) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) cgal_add_compilation_test(Alpha_shape_3)