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..3d45cfe9a7 100644 --- a/cmake/AvogadroLibsConfig.cmake.in +++ b/cmake/AvogadroLibsConfig.cmake.in @@ -19,6 +19,12 @@ set(AvogadroLibs_CMAKE_DIR "${AvogadroLibs_LIBRARY_DIR}/cmake/avogadrolibs set(AvogadroLibs_PLUGINS "@AvogadroLibs_PLUGINS@") set(AvogadroLibs_STATIC_PLUGINS "@AvogadroLibs_STATIC_PLUGINS@") +include(CMakeFindDependencyMacro) + +if (@QT_VERSION@ EQUAL 6) + find_dependency(Qt6OpenGLWidgets) +endif() + if(NOT TARGET AvogadroCore) include("${AvogadroLibs_CMAKE_DIR}/AvogadroLibsTargets.cmake") endif()