From 302ad5f7cd220913d219135f1a9abd62e0872a45 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 28 Jan 2024 14:06:11 +0100 Subject: [PATCH] CMake: Check for OpenGL in imported target The gl target uses OpenGL libraries, so these must be defined. Previously, the user has to do this before importing the wxWidget target. --- build/cmake/wxWidgetsConfig.cmake.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/cmake/wxWidgetsConfig.cmake.in b/build/cmake/wxWidgetsConfig.cmake.in index a6c64a9d1e..a67ad494bc 100644 --- a/build/cmake/wxWidgetsConfig.cmake.in +++ b/build/cmake/wxWidgetsConfig.cmake.in @@ -127,6 +127,12 @@ foreach(libname @wxLIB_TARGETS@) endif() endforeach() +if(TARGET wx::wxgl) + # make sure OpenGL targets are available: + # The link interface of target "wx::wxgl" contains: OpenGL::GLU + find_package(OpenGL QUIET) +endif() + # if no components are specified in find_package, check all of them if(NOT @PROJECT_NAME@_FIND_COMPONENTS) set(@PROJECT_NAME@_FIND_COMPONENTS ${@PROJECT_NAME@_COMPONENTS})