CMake: WrapOpenGL target should also link AGL on macOS

This is consistent with the qmake mkspec in common/mac.conf

Task-number: QTBUG-85240
Task-number: QTBUG-84781
Change-Id: I99df365a3be541356482d29eda806020f4e298d9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Alexandru Croitor 2020-06-26 19:01:31 +02:00
parent 7fcc9cf055
commit 2ed63e587e

View File

@ -30,7 +30,16 @@ if (OpenGL_FOUND)
set(__opengl_fw_path "-framework" "OpenGL")
endif()
find_library(WrapOpenGL_AGL NAMES AGL)
if(WrapOpenGL_AGL)
set(__opengl_agl_fw_path "${WrapOpenGL_AGL}")
endif()
if(NOT __opengl_agl_fw_path)
set(__opengl_agl_fw_path "-framework" "AGL")
endif()
target_link_libraries(WrapOpenGL::WrapOpenGL INTERFACE ${__opengl_fw_path})
target_link_libraries(WrapOpenGL::WrapOpenGL INTERFACE ${__opengl_agl_fw_path})
else()
target_link_libraries(WrapOpenGL::WrapOpenGL INTERFACE OpenGL::GL)
endif()