From 2ed63e587eefb246dba9e69aa01fdb2abb2def13 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Fri, 26 Jun 2020 19:01:31 +0200 Subject: [PATCH] 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 Reviewed-by: Qt CI Bot --- cmake/FindWrapOpenGL.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/FindWrapOpenGL.cmake b/cmake/FindWrapOpenGL.cmake index fc6ddf7046..fa2acc746b 100644 --- a/cmake/FindWrapOpenGL.cmake +++ b/cmake/FindWrapOpenGL.cmake @@ -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()