From f21dc91645c7851b9fd3ab11173a7f14a564a815 Mon Sep 17 00:00:00 2001 From: Nicolas Fella Date: Mon, 30 Dec 2024 01:18:04 +0100 Subject: [PATCH] Link publicly against Qt6::OpenGLWidgets The public glwidget.h header uses it, so the link must be public Signed-off-by: Nicolas Fella --- avogadro/qtopengl/CMakeLists.txt | 2 +- cmake/AvogadroLibsConfig.cmake.in | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/avogadro/qtopengl/CMakeLists.txt b/avogadro/qtopengl/CMakeLists.txt index dc74ef102a..ce846ef308 100644 --- a/avogadro/qtopengl/CMakeLists.txt +++ b/avogadro/qtopengl/CMakeLists.txt @@ -21,5 +21,5 @@ target_sources(QtOpenGL PRIVATE avogadro_add_library(QtOpenGL) target_link_libraries(QtOpenGL PUBLIC Avogadro::Rendering Avogadro::QtGui Qt::Widgets) if(QT_VERSION EQUAL 6) - target_link_libraries(QtOpenGL PRIVATE Qt6::OpenGLWidgets) + target_link_libraries(QtOpenGL PUBLIC Qt6::OpenGLWidgets) endif() diff --git a/cmake/AvogadroLibsConfig.cmake.in b/cmake/AvogadroLibsConfig.cmake.in index 5bf4d5d408..09cba06532 100644 --- a/cmake/AvogadroLibsConfig.cmake.in +++ b/cmake/AvogadroLibsConfig.cmake.in @@ -19,6 +19,10 @@ set(AvogadroLibs_CMAKE_DIR "${AvogadroLibs_LIBRARY_DIR}/cmake/avogadrolibs set(AvogadroLibs_PLUGINS "@AvogadroLibs_PLUGINS@") set(AvogadroLibs_STATIC_PLUGINS "@AvogadroLibs_STATIC_PLUGINS@") +if (@QT_VERSION@ EQUAL 6) + find_dependency(Qt6OpenGLWidgets) +endif() + if(NOT TARGET AvogadroCore) include("${AvogadroLibs_CMAKE_DIR}/AvogadroLibsTargets.cmake") endif()