Skip to content

Commit

Permalink
Fixes so that compiling with Qt5 still works
Browse files Browse the repository at this point in the history
  • Loading branch information
matterhorn103 committed Nov 16, 2023
1 parent 7af8da9 commit 17ed5e7
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 3 deletions.
7 changes: 6 additions & 1 deletion avogadro/qtopengl/glwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
#include <avogadro/rendering/glrenderer.h>

#include <QPointer>
#include <QtOpenGLWidgets/QOpenGLWidget>

#if QT_VERSION >= 0x060000
#include <QtOpenGLWidgets/QOpenGLWidget>
#else
#include <QOpenGLWidget>
#endif

class QTimer;

Expand Down
12 changes: 12 additions & 0 deletions avogadro/qtplugins/aligntool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
if(QT_VERSION EQUAL 6)
find_package(Qt6 COMPONENTS Gui REQUIRED)
else()
find_package(Qt5 COMPONENTS Widgets REQUIRED)
endif()

set(aligntool_srcs
aligntool.cpp
)
Expand All @@ -21,6 +27,12 @@ avogadro_plugin(AlignTool

target_link_libraries(AlignTool PRIVATE Avogadro::Rendering Avogadro::QtOpenGL)

if(QT_VERSION EQUAL 6)
target_link_libraries(AlignTool PRIVATE Qt6::Gui)
else()
target_link_libraries(AlignTool PRIVATE Qt5::Widgets)
endif()

target_include_directories(AlignTool
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/../../rendering)
Expand Down
2 changes: 1 addition & 1 deletion avogadro/qtplugins/aligntool/aligntool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <QtGui/QKeyEvent>
#include <QtGui/QMouseEvent>
#include <QtGui/QWheelEvent>
#include <QtGui/QAction>
#include <QAction>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QHBoxLayout>
Expand Down
12 changes: 12 additions & 0 deletions avogadro/qtplugins/forcefield/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
if(QT_VERSION EQUAL 6)
find_package(Qt6 COMPONENTS Gui REQUIRED)
else()
find_package(Qt5 COMPONENTS Widgets REQUIRED)
endif()

set(forcefield_srcs
forcefield.cpp
forcefielddialog.cpp
Expand All @@ -16,6 +22,12 @@ avogadro_plugin(Forcefield

target_link_libraries(Forcefield PRIVATE Avogadro::Calc)

if(QT_VERSION EQUAL 6)
target_link_libraries(Forcefield PRIVATE Qt6::Gui)
else()
target_link_libraries(Forcefield PRIVATE Qt5::Widgets)
endif()

# Bundled forcefield scripts
set(forcefields
scripts/ani2x.py
Expand Down
2 changes: 1 addition & 1 deletion avogadro/qtplugins/forcefield/forcefield.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <QtCore/QDebug>
#include <QtCore/QSettings>

#include <QtGui/QAction>
#include <QAction>
#include <QtWidgets/QMessageBox>

#include <QMutex>
Expand Down
4 changes: 4 additions & 0 deletions avogadro/qtplugins/svg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ avogadro_plugin(SVG
)

target_link_libraries(SVG PRIVATE Avogadro::QtOpenGL Qt::Svg)

target_include_directories(SVG
PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/../../rendering)

0 comments on commit 17ed5e7

Please sign in to comment.