Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CGAL: Qt5 -> Qt6 #7397

Merged
merged 96 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
ef46506
Add cmake/modules files
afabri Apr 18, 2023
c6ce5fb
Switch to QT6 for the GraphicsView demos
afabri Apr 19, 2023
47683f2
The Truiangulation_2/examples which use draw() compile and visualize …
afabri Apr 19, 2023
b1040de
Surface_mesh example works as well
afabri Apr 19, 2023
42a9757
Fix to have a weak order
afabri Apr 19, 2023
370e81e
AABB Tree demo works
afabri Apr 19, 2023
5601e03
Change all CMakeLists.txt
afabri Apr 19, 2023
5030d67
Target Polyhedron_3 builds and executes, but with all scripting and R…
afabri Apr 19, 2023
b80fbc8
Fixes for target Mesh_3
afabri Apr 20, 2023
bd78a33
PMP compiles [skip ci]
afabri Apr 20, 2023
ab1d799
various fixes [skip ci]
afabri Apr 20, 2023
c77f144
various fixes [skip ci]
afabri Apr 20, 2023
b15e0a1
Fix 'Save As' [skip ci]
afabri Apr 20, 2023
0574c6b
Change the remaining CMakeLists.txt [skip ci]
afabri Apr 20, 2023
7e160aa
Hello QJSEngine [skip ci]
afabri Apr 21, 2023
b4a259c
Hello QJSEngine [skip ci]
afabri Apr 21, 2023
67441a3
Convert all CMakeLists.txt to Qt6
lrineau Apr 25, 2023
134b464
Allocate the QJSEngine on the heap
afabri Apr 26, 2023
f645170
fix memory leak
lrineau Apr 27, 2023
0576e88
Merge branch 'CGAL-fix-Qt5-CMake-GF' into CGAL-Qt6-GF
lrineau Apr 28, 2023
a10460d
Remove trailing whitespaces
lrineau Apr 28, 2023
db652ac
add Qt6 to the CI tests
lrineau Apr 28, 2023
b2a330b
WIP re-adding scripting
afabri Apr 30, 2023
573de7f
Merge branch 'master'
sloriot Jun 22, 2023
aa0d50b
Fix Arrangement_on_surface_2 examples
afabri Jun 26, 2023
1066af1
Add #include
afabri Jun 26, 2023
a015b1d
Fix Straight_skeleton_extrusion test
afabri Jun 26, 2023
63bf2a8
Fix for deprecated warning
afabri Jun 29, 2023
41e8a11
Fix warnings in Arrangement_on_surface
afabri Jun 29, 2023
a633029
Fix for deprecated warning
afabri Jun 30, 2023
125542e
Merge remote-tracking branch 'cgal/master'
sloriot Jul 11, 2023
98fa0c0
Fix for crash on Quit
afabri Jul 18, 2023
c6fd1d0
Merge branch 'master' into CGAL-Qt6-GF
MaelRL Jul 18, 2023
c3b7214
Fix the fix. The floats were already in the range [0,256]
afabri Jul 26, 2023
a025556
Update changes.md
afabri Aug 21, 2023
48bd7cc
fix deprecation warnings from Qt6
lrineau Aug 24, 2023
68bc244
Merge remote-tracking branch 'cgal/master' into HEAD
sloriot Aug 24, 2023
740b570
Merge remote-tracking branch 'refs/remotes/afabri/CGAL-Qt6-GF' into C…
lrineau Aug 24, 2023
79a563b
fix more deprecation warnings
lrineau Aug 24, 2023
da0b65d
fix QSJ/C++ exceptions handling
lrineau Aug 24, 2023
a12a0fa
TBB is a SYSTEM library
lrineau Aug 24, 2023
9f68b1a
TBB is a SYSTEM library, and CGAL::CGAL is not
lrineau Aug 24, 2023
d8583c9
replace deprecated QMatrix4x4*QVector3D by map
lrineau Aug 24, 2023
dc7f6af
check that we have an exact match (whole string)
lrineau Aug 24, 2023
f9c2137
last deprecation warning in a full build of demo/Polyhedron
lrineau Aug 24, 2023
abb9080
cleanup demo/AABB_tree
lrineau Aug 24, 2023
3869a4a
cleanup Alpha_sphare_3 demo
lrineau Aug 24, 2023
df06d29
fix/cleanup AABB_tree and Alpha_shape_3 demos
lrineau Aug 25, 2023
4fbcb93
a few cleanups
lrineau Aug 28, 2023
3a52549
more cleanup of CMake scripts for Qt6
lrineau Aug 29, 2023
7af862e
fix trailing space
lrineau Aug 29, 2023
1f13a62
restore the OpenGL format in DemosMainWindow
lrineau Aug 30, 2023
4740f81
add a target to compile all CGALlab
lrineau Aug 31, 2023
0303b8d
Update CMakeLists for QT6
SaillantNicolas Sep 5, 2023
b286df4
fix warnings (and ASAN errors)
lrineau Sep 8, 2023
a413670
More CMakeLists Updates for QT6
SaillantNicolas Sep 11, 2023
fed2af5
Merge remote-tracking branch 'SaillantNicolas/pr/afabri/7397' into CG…
lrineau Sep 11, 2023
0d7280e
CMakeLists updates for Qt6
SaillantNicolas Sep 11, 2023
1997bd0
Merge remote-tracking branch 'refs/remotes/afabri/CGAL-Qt6-GF' into p…
SaillantNicolas Sep 11, 2023
303282a
fix "Save as..." in CGAL Lab
lrineau Sep 11, 2023
c276b54
Remove one occurence of "qt5"
lrineau Sep 11, 2023
873c3b2
remove a few occurrences of "qt5"
lrineau Sep 11, 2023
cf1b5fd
Update CMakeLists for QT6
SaillantNicolas Sep 13, 2023
4b3279e
Remove the "Use OpenGL" option from 2D demos
lrineau Sep 13, 2023
0d9037b
add the ui file
lrineau Sep 13, 2023
67baec2
Fix Optimal_transportation_reconstruction_2_Demo
lrineau Sep 13, 2023
b01da56
remove occurrences of OpenGLWidgets in demos' CMake scripts
lrineau Sep 13, 2023
03e89cc
fix periodic_3_triangulation_3_demo
lrineau Sep 13, 2023
09a4ac1
cosmetic changes
lrineau Sep 14, 2023
e93a099
finish review of polyhedron demo
lrineau Sep 14, 2023
2f6d51b
Remove a few occurrences of CGAL_Qt5
lrineau Sep 14, 2023
48f37a1
remove occurrences of Qt5
lrineau Sep 14, 2023
68f7646
remove stray CMake debug messages
lrineau Sep 14, 2023
9bba3bd
fix the list of used Qt6 components
lrineau Sep 14, 2023
b05e1e9
Remove UseCGAL.cmake
lrineau Sep 14, 2023
28632f2
Merge branch 'master' into CGAL-Qt6-GF
lrineau Sep 14, 2023
40a7f32
fix a compilation error
lrineau Sep 15, 2023
fe68498
CGALConfig.cmake remove the early return()
lrineau Sep 19, 2023
0ffb256
fix the workflow demo.yml
lrineau Sep 19, 2023
029d7a8
fix test/Installation tests on Windows
lrineau Sep 20, 2023
a72ccf2
Fix CMake error on Windows
lrineau Sep 28, 2023
dda4bf8
fix regression about MOC compilations
lrineau Nov 1, 2023
51627e3
Merge remote-tracking branch 'cgal/master' into CGAL-Qt6-GF
lrineau Nov 1, 2023
980b04e
fix the Arrangement demo
lrineau Nov 1, 2023
dea756e
fix test/Installation on Windows
lrineau Nov 1, 2023
dc0cd7f
make ~Show_point_dialog() virtual
afabri Nov 15, 2023
652f7b2
Replace Q_FOREACH
afabri Nov 15, 2023
3c07d9a
Add virtual
afabri Nov 15, 2023
9ead7b5
Address unused variable warnings
afabri Nov 16, 2023
1dee4f8
Fix conversion warning in T3 demo
afabri Nov 16, 2023
2a223e6
Fix ipelet demo CMakeLists.txt
afabri Nov 16, 2023
bb6222d
Fix ipelet demo CMakeLists.txt
afabri Nov 16, 2023
cfac63f
Merge remote-tracking branch 'cgal/master' into HEAD
sloriot Nov 16, 2023
1f8d66b
add macro in new resource dir
sloriot Nov 16, 2023
15af760
Q_DECL_OVERRIDE -> override
sloriot Nov 22, 2023
f0f1d6a
fix warning
sloriot Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 2 additions & 1 deletion .github/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
sudo apt-get update
sudo apt-get install -y libmpfr-dev \
libeigen3-dev qtbase5-dev libqt5sql5-sqlite libqt5opengl5-dev qtscript5-dev \
libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit4-dev zsh
libqt5svg5-dev qttools5-dev qttools5-dev-tools libboost-dev libinsighttoolkit4-dev zsh \
qt6-base-dev qt6-declarative-dev
#update cmake to 3.18.4
sudo apt purge --auto-remove cmake
cd /tmp
Expand Down
5 changes: 2 additions & 3 deletions .github/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
FACTOR=$1
set -ex
cd Polyhedron/demo
LIST_OF_PLUGINS=$(/usr/local/bin/cmake --build . -t help | egrep 'plugin$' |& cut -d\ -f2)
/usr/local/bin/cmake -S Polyhedron -B build -DCGAL_DIR=$2
LIST_OF_PLUGINS=$(/usr/local/bin/cmake --build build -t help | egrep 'plugin$' |& cut -d\ -f2)
PLUGINS_ARRAY=(${LIST_OF_PLUGINS});
NB_OF_PLUGINS=${#PLUGINS_ARRAY[@]}
DEL=$(($NB_OF_PLUGINS / 4))
mkdir build
cd build
/usr/local/bin/cmake -DCGAL_DIR=$2 ../Polyhedron
make -j2 ${PLUGINS_ARRAY[@]:$(($FACTOR * $DEL)):$((($FACTOR + 1) * $DEL))}
2 changes: 1 addition & 1 deletion .github/workflows/cmake-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
mkdir build && cd build && CXX=clang++ cmake -DWITH_examples=ON -DWITH_tests=ON -DWITH_demos=ON -DBUILD_TESTING=ON ..
ctest -L Installation -j $(getconf _NPROCESSORS_ONLN)

cmake-testsuite-with-qt5:
cmake-testsuite-with-qt:

runs-on: ubuntu-latest

Expand Down
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,6 @@ GraphicsView/demo/Triangulation_2/Makefile
GraphicsView/demo/Triangulation_2/Regular_triangulation_2
GraphicsView/demo/Triangulation_2/qrc_*.cxx
GraphicsView/demo/Triangulation_2/ui_*.h
GraphicsView/src/CGAL_Qt5/*.dll
GraphicsView/src/CGAL_Qt5/*.lib
GraphicsView/src/CGAL_Qt5/*.so
GraphicsView/src/CGAL_Qt5/Makefile
GraphicsView/src/CGAL_Qt5/moc_*.cxx
GraphicsView/src/CGAL_Qt5/qrc_*.cxx
HalfedgeDS/test/HalfedgeDS/cgal_test_with_cmake
HalfedgeDS/test/HalfedgeDS/test_hds
HalfedgeDS/test/HalfedgeDS/test_hds_decorator
Expand Down Expand Up @@ -879,7 +873,6 @@ Surface_mesher/demo/Surface_mesher/.*.deps
Surface_mesher/demo/Surface_mesher/.qglviewer.xml
Surface_mesher/demo/Surface_mesher/Makefile
Surface_mesher/demo/Surface_mesher/Surface_mesher
Surface_mesher/demo/Surface_mesher/Surface_mesher_Qt5_Demo
Surface_mesher/demo/Surface_mesher/VTK/Makefile
Surface_mesher/demo/Surface_mesher/VTK/mesh_a_3D_image
Surface_mesher/demo/Surface_mesher/VTK/mesh_a_VTK_3D_image
Expand All @@ -894,7 +887,6 @@ Surface_mesher/demo/Surface_mesher/out*.off
Surface_mesher/demo/Surface_mesher/polyhedron_remesher
Surface_mesher/demo/Surface_mesher/polyhedron_remesher_with_edges
Surface_mesher/demo/Surface_mesher/qrc_*.c*
Surface_mesher/demo/Surface_mesher/qt5-demo
Surface_mesher/demo/Surface_mesher/ui_*.h
Surface_mesher/doxygen
Surface_mesher/examples/Surface_mesher/.*.deps
Expand Down
11 changes: 1 addition & 10 deletions AABB_tree/demo/AABB_tree/AABB_demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main(int argc, char **argv)
app.setOrganizationName("INRIA");
app.setApplicationName("AABB tree demo");

// Import resources from libCGALQt (Qt5).
// Import resources from libCGALQt (Qt6).
CGAL_QT_INIT_RESOURCES;

MainWindow mainWindow;
Expand All @@ -49,12 +49,3 @@ int main(int argc, char **argv)

return app.exec();
}

# include "Scene.cpp"
# include "Scene_moc.cpp"
# include "benchmarks.cpp"
# include "Viewer.cpp"
# include "Viewer_moc.cpp"
# include "MainWindow.cpp"
# include "MainWindow_moc.cpp"

69 changes: 21 additions & 48 deletions AABB_tree/demo/AABB_tree/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,73 +6,46 @@ project(AABB_tree_Demo)
# Find includes in corresponding build directories
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()
# Find CGAL and CGAL Qt6
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt6)

if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
# Find Qt6 itself
find_package(Qt6 QUIET COMPONENTS Gui OpenGL)

# Include this package's headers first
include_directories(BEFORE ./ ./include)
if(CGAL_Qt6_FOUND AND Qt6_FOUND)

# Find CGAL and CGAL Qt5
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
add_definitions(-DQT_NO_KEYWORDS)

# Find Qt5 itself
find_package(Qt5 QUIET COMPONENTS Widgets OpenGL)
# Instruct CMake to run moc/ui/rcc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

if(CGAL_Qt5_FOUND AND Qt5_FOUND)

qt5_wrap_ui(UI_FILES MainWindow.ui)

include(AddFileDependencies)

qt5_generate_moc("MainWindow.h" "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp")
add_file_dependencies(MainWindow_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/MainWindow.h")

qt5_generate_moc("Viewer.h" "${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp")
add_file_dependencies(Viewer_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Viewer.h")

qt5_generate_moc("Scene.h" "${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp")
add_file_dependencies(Scene_moc.cpp "${CMAKE_CURRENT_SOURCE_DIR}/Scene.h")

qt5_add_resources(CGAL_Qt5_RESOURCE_FILES AABB_demo.qrc)

add_file_dependencies(
AABB_demo.cpp "${CMAKE_CURRENT_BINARY_DIR}/MainWindow_moc.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/Viewer_moc.cpp"
"${CMAKE_CURRENT_BINARY_DIR}/Scene_moc.cpp")

add_executable(
AABB_demo AABB_demo.cpp ${UI_FILES} ${CGAL_Qt5_RESOURCE_FILES}
#${CGAL_Qt5_MOC_FILES}
qt_add_executable(
AABB_demo AABB_demo.cpp Scene.cpp benchmarks.cpp Viewer.cpp MainWindow.cpp
MainWindow.ui AABB_demo.qrc
)
# Link with Qt libraries
target_link_libraries(AABB_demo PRIVATE Qt5::Widgets Qt5::OpenGL
CGAL::CGAL CGAL::CGAL_Qt5)
target_link_libraries(AABB_demo PRIVATE Qt6::Gui Qt6::OpenGL
CGAL::CGAL CGAL::CGAL_Qt6)

add_to_cached_list(CGAL_EXECUTABLE_TARGETS AABB_demo)

include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(AABB_demo)

else(CGAL_Qt5_FOUND AND Qt5_FOUND)
else(CGAL_Qt6_FOUND AND Qt6_FOUND)

set(AABB_MISSING_DEPS "")

if(NOT CGAL_Qt5_FOUND)
set(AABB_MISSING_DEPS "CGAL_Qt5, ${AABB_MISSING_DEPS}")
if(NOT CGAL_Qt6_FOUND)
set(AABB_MISSING_DEPS "CGAL_Qt6, ${AABB_MISSING_DEPS}")
endif()

if(NOT Qt5_FOUND)
set(AABB_MISSING_DEPS "Qt5, ${AABB_MISSING_DEPS}")
if(NOT Qt6_FOUND)
set(AABB_MISSING_DEPS "Qt6, ${AABB_MISSING_DEPS}")
endif()

message("NOTICE: This demo requires ${AABB_MISSING_DEPS}, and will not be compiled.")

endif(CGAL_Qt5_FOUND AND Qt5_FOUND)
endif(CGAL_Qt6_FOUND AND Qt6_FOUND)
10 changes: 5 additions & 5 deletions AABB_tree/demo/AABB_tree/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@
#include <QSettings>
#include <QHeaderView>
#include <QClipboard>
#include <QInputDialog>

#include "ui_MainWindow.h"

MainWindow::MainWindow(QWidget* parent)
: CGAL::Qt::DemosMainWindow(parent)
: CGAL::Qt::DemosMainWindow(parent)
{
ui = new Ui::MainWindow;
ui->setupUi(this);

this->addAboutDemo(":/cgal/AABB_demo/about.html");
this->addAboutCGAL();

// saves some pointers from ui, for latter use.
m_pViewer = ui->viewer;

Expand Down Expand Up @@ -418,7 +422,3 @@ void MainWindow::on_actionCopy_snapshot_triggered()
qb->setImage(snapshot);
QApplication::restoreOverrideCursor();
}




6 changes: 2 additions & 4 deletions AABB_tree/demo/AABB_tree/MainWindow.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QtOpenGL/qgl.h>
#include <CGAL/Qt/DemosMainWindow.h>

class QDragEnterEvent;
Expand All @@ -12,7 +11,6 @@ namespace Ui {
class MainWindow;
}


class MainWindow :
public CGAL::Qt::DemosMainWindow
{
Expand All @@ -21,12 +19,12 @@ class MainWindow :
MainWindow(QWidget* parent = nullptr);
~MainWindow();

public slots:
public Q_SLOTS:
void updateViewerBBox();
void open(QString filename);
void setAddKeyFrameKeyboardModifiers(Qt::KeyboardModifiers);

protected slots:
protected Q_SLOTS:

// settings
void quit();
Expand Down
6 changes: 3 additions & 3 deletions AABB_tree/demo/AABB_tree/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ void Scene::draw(CGAL::QGLViewer* viewer)
vao[0].bind();
attrib_buffers(viewer);
rendering_program.bind();
color.setRgbF(0.7,0.0,0.0);
color.setRgbF(0.7f,0.0f,0.0f);
rendering_program.setUniformValue(colorLocation, color);
rendering_program.setUniformValue(fLocation, fMatrix);
gl->glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(pos_points.size()/3));
Expand All @@ -631,7 +631,7 @@ void Scene::draw(CGAL::QGLViewer* viewer)
vao[1].bind();
attrib_buffers(viewer);
rendering_program.bind();
color.setRgbF(0.0,0.7,0.0);
color.setRgbF(0.0f,0.7f,0.0f);
rendering_program.setUniformValue(colorLocation, color);
rendering_program.setUniformValue(fLocation, fMatrix);
gl->glDrawArrays(GL_LINES, 0, static_cast<GLsizei>(pos_lines.size()/3));
Expand Down Expand Up @@ -669,7 +669,7 @@ void Scene::draw(CGAL::QGLViewer* viewer)
vao[3].bind();
attrib_buffers(viewer);
rendering_program.bind();
color.setRgbF(1.0,0.0,0.0);
color.setRgbF(1.0f,0.0f,0.0f);
rendering_program.setUniformValue(colorLocation, color);
rendering_program.setUniformValue(fLocation, fMatrix);
gl->glDrawArrays(GL_LINES, 0, static_cast<GLsizei>(pos_cut_segments.size()/3));
Expand Down
6 changes: 2 additions & 4 deletions AABB_tree/demo/AABB_tree/Scene.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef SCENE_H
#define SCENE_H

#include <QtOpenGL/qgl.h>
#include <iostream>
#include <cmath>

Expand Down Expand Up @@ -77,7 +76,6 @@ class Scene : public QObject
};

public:
QGLContext* context;
void draw(CGAL::QGLViewer*);
void update_bbox();
Bbox bbox() { return m_bbox; }
Expand Down Expand Up @@ -173,7 +171,7 @@ class Scene : public QObject
void attrib_buffers(CGAL::QGLViewer*);
void compile_shaders();
void compute_texture(int, int, Color_ramp, Color_ramp);
private slots:
private Q_SLOTS:
void updateCutPlane();

public:
Expand Down Expand Up @@ -255,7 +253,7 @@ private slots:



public slots:
public Q_SLOTS:
// cutting plane
void cutting_plane(bool override = false);
void changed();
Expand Down
3 changes: 0 additions & 3 deletions AABB_tree/demo/AABB_tree/Viewer.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#include "Viewer.h"
#include "Scene.h"
#include <QMouseEvent>
#include <QGLFunctions>
#include <CGAL/Qt/CreateOpenGLContext.h>

Viewer::Viewer(QWidget* parent)
: CGAL::QGLViewer(parent),
m_pScene(nullptr),
Expand Down
1 change: 1 addition & 0 deletions AABB_tree/demo/AABB_tree/benchmarks.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "Scene.h"
#include "Refiner.h"
#include <QInputDialog>
#include <CGAL/Memory_sizer.h>

Expand Down
4 changes: 2 additions & 2 deletions Alpha_shapes_3/demo/Alpha_shapes_3/Alpha_shape_3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ int main(int argc, char** argv)
application.setOrganizationName("GeometryFactory");
application.setApplicationName("Alpha Shape Reconstruction");

// Import resources from libCGALQt (Qt5).
// See https://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE
// Import resources from libCGAL_Qt6
// See https://doc.qt.io/qt-6/qtresource-proxy.html#Q_INIT_RESOURCE

CGAL_QT_INIT_RESOURCES;
Q_INIT_RESOURCE(Alpha_shape_3);
Expand Down
38 changes: 12 additions & 26 deletions Alpha_shapes_3/demo/Alpha_shapes_3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,32 @@ project(Alpha_shapes_3_Demo)
# Find includes in corresponding build directories
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(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
find_package(Qt6 QUIET COMPONENTS Widgets OpenGL)

find_package(Qt5 QUIET COMPONENTS Widgets OpenGL)

if(CGAL_Qt5_FOUND AND Qt5_FOUND)
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
qt5_wrap_ui(uis MainWindow.ui)
# Instruct CMake to run moc/ui/rcc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

# qrc files (resources files, that contain icons, at least)
qt5_add_resources(CGAL_Qt5_RESOURCE_FILES ./Alpha_shape_3.qrc)
qt_add_executable(Alpha_shape_3 Alpha_shape_3.cpp MainWindow.cpp Viewer.cpp
MainWindow.ui 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})
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Alpha_shape_3)

target_link_libraries(Alpha_shape_3 PRIVATE CGAL::CGAL CGAL::CGAL_Qt5
Qt5::Widgets Qt5::OpenGL)
target_link_libraries(Alpha_shape_3 PRIVATE CGAL::CGAL CGAL::CGAL_Qt6
Qt6::Widgets Qt6::OpenGL)

include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)
cgal_add_compilation_test(Alpha_shape_3)

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()
Loading