From 3e01a387bad0b9fe7f639eacd724403dec7971b2 Mon Sep 17 00:00:00 2001 From: Alexander Alekhin Date: Tue, 21 Dec 2021 15:44:59 +0000 Subject: [PATCH] highgui: fix Win32 with OPENGL=ON --- modules/highgui/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/highgui/CMakeLists.txt b/modules/highgui/CMakeLists.txt index 8339a1d7d2..416fb5a315 100644 --- a/modules/highgui/CMakeLists.txt +++ b/modules/highgui/CMakeLists.txt @@ -163,6 +163,10 @@ if(APPLE) add_apple_compiler_options(${the_module}) endif() +if(HAVE_WIN32UI AND HAVE_OPENGL AND OPENGL_LIBRARIES) + ocv_target_link_libraries(${the_module} PRIVATE "${OPENGL_LIBRARIES}") +endif() + if(MSVC AND NOT BUILD_SHARED_LIBS AND BUILD_WITH_STATIC_CRT) set_target_properties(${the_module} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:atlthunk.lib /NODEFAULTLIB:atlsd.lib /NODEFAULTLIB:libcmt.lib /DEBUG") endif()