diff --git a/avogadro/qtplugins/playertool/CMakeLists.txt b/avogadro/qtplugins/playertool/CMakeLists.txt index 96c1f54736..166100c2cb 100644 --- a/avogadro/qtplugins/playertool/CMakeLists.txt +++ b/avogadro/qtplugins/playertool/CMakeLists.txt @@ -1,4 +1,9 @@ -find_package(Qt6 REQUIRED COMPONENTS OpenGL OpenGLWidgets) +if(QT_VERSION EQUAL 6) + find_package(Qt6 + REQUIRED COMPONENTS + OpenGL + OpenGLWidgets) +endif() avogadro_plugin(PlayerTool "Player tool" @@ -14,11 +19,16 @@ target_link_libraries(PlayerTool PRIVATE gwavi gif-h - Qt6::OpenGL - Qt6::OpenGLWidgets Avogadro::Rendering Avogadro::QtOpenGL) +if(QT_VERSION EQUAL 6) + target_link_libraries(PlayerTool + PRIVATE + Qt6::OpenGL + Qt6::OpenGLWidgets) +endif() + target_include_directories(PlayerTool PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../../rendering diff --git a/avogadro/qtplugins/resetview/CMakeLists.txt b/avogadro/qtplugins/resetview/CMakeLists.txt index 4e99b05336..e5d8587b3b 100644 --- a/avogadro/qtplugins/resetview/CMakeLists.txt +++ b/avogadro/qtplugins/resetview/CMakeLists.txt @@ -1,4 +1,6 @@ -find_package(Qt6 REQUIRED COMPONENTS OpenGLWidgets) +if(QT_VERSION EQUAL 6) + find_package(Qt6 REQUIRED COMPONENTS OpenGLWidgets) +endif() avogadro_plugin(ResetView "Manipulate the view camera." @@ -9,7 +11,13 @@ avogadro_plugin(ResetView "" ) -target_link_libraries(ResetView PRIVATE Qt6::OpenGLWidgets Avogadro::Rendering Avogadro::QtOpenGL) +target_link_libraries(ResetView PRIVATE Avogadro::Rendering Avogadro::QtOpenGL) + +if(QT_VERSION EQUAL 6) + target_link_libraries(ResetView + PRIVATE + Qt6::OpenGLWidgets) +endif() target_include_directories(ResetView PRIVATE diff --git a/avogadro/qtplugins/surfaces/CMakeLists.txt b/avogadro/qtplugins/surfaces/CMakeLists.txt index 56f960ebb0..300604d140 100644 --- a/avogadro/qtplugins/surfaces/CMakeLists.txt +++ b/avogadro/qtplugins/surfaces/CMakeLists.txt @@ -1,4 +1,6 @@ -find_package(Qt6 REQUIRED COMPONENTS OpenGL) +if(QT_VERSION EQUAL 6) + find_package(Qt6 REQUIRED COMPONENTS OpenGL) +endif() set(surfaces_srcs gaussiansetconcurrent.cpp @@ -18,7 +20,6 @@ avogadro_plugin(Surfaces target_link_libraries(Surfaces PRIVATE - Qt6::OpenGL Avogadro::Calc Avogadro::QuantumIO Avogadro::QtOpenGL @@ -28,6 +29,12 @@ target_link_libraries(Surfaces gwavi tinycolormap) +if(QT_VERSION EQUAL 6) + target_link_libraries(Surfaces + PRIVATE + Qt6::OpenGL) +endif() + target_include_directories(Surfaces PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/../../rendering