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()