cleanup Alpha_sphare_3 demo

This commit is contained in:
Laurent Rineau 2023-08-24 18:41:03 +02:00
parent abb9080102
commit 3869a4a6c3
2 changed files with 6 additions and 21 deletions

View File

@ -13,23 +13,19 @@ set(CMAKE_AUTOMOC ON)
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6) find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)
# Find Qt6 itself # Find Qt6 itself
find_package(Qt6 QUIET COMPONENTS Gui) find_package(Qt6 QUIET COMPONENTS Gui OpenGL)
if(CGAL_Qt6_FOUND AND Qt6_FOUND) if(CGAL_Qt6_FOUND AND Qt6_FOUND)
qt6_wrap_ui(UI_FILES MainWindow.ui) 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) qt6_add_resources(CGAL_Qt6_RESOURCE_FILES AABB_demo.qrc)
add_executable( add_executable(
AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt6_RESOURCE_FILES} AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt6_RESOURCE_FILES}
) )
# Link with Qt libraries # 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) CGAL::CGAL CGAL::CGAL_Qt6)
add_to_cached_list(CGAL_EXECUTABLE_TARGETS AABB_demo) add_to_cached_list(CGAL_EXECUTABLE_TARGETS AABB_demo)

View File

@ -9,38 +9,27 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed. # Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON) 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(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) if(CGAL_Qt6_FOUND AND Qt6_FOUND)
add_definitions(-DQT_NO_KEYWORDS) add_definitions(-DQT_NO_KEYWORDS)
# include(${QT_USE_FILE})
include_directories(BEFORE ./)
# ui file, created with Qt Designer # ui file, created with Qt Designer
qt6_wrap_ui(uis MainWindow.ui) qt6_wrap_ui(uis MainWindow.ui)
# qrc files (resources files, that contain icons, at least) # qrc files (resources files, that contain icons, at least)
qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Alpha_shape_3.qrc) qt6_add_resources(CGAL_Qt6_RESOURCE_FILES ./Alpha_shape_3.qrc)
add_executable( add_executable(Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis})
Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp ${uis}
${CGAL_Qt6_RESOURCE_FILES} ${CGAL_Qt6_MOC_FILES})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Alpha_shape_3) add_to_cached_list(CGAL_EXECUTABLE_TARGETS Alpha_shape_3)
target_link_libraries(Alpha_shape_3 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6 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) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Alpha_shape_3) cgal_add_compilation_test(Alpha_shape_3)