[vcpkg] Cannot use wxGLCanvas in CMake project on Windows (Issue #24519)

36 views
Skip to first unread message

sidy3d

unread,
May 4, 2024, 1:46:03 PM5/4/24
to wx-...@googlegroups.com, Subscribed

Reference: microsoft/vcpkg#38539

Build System Used

I build wxWidgets and/or my application using:

  • CMake
  • configure
  • mingw32-make with makefile.gcc
  • MSBuild (Microsoft Visual Studio solution file)
  • nmake with makefile.vc
  • Xcode

Description

Cannot use wxGLCanvas in a CMake project using vcpkg on Windows. The same project works fine when using Visual Studio and vcpkg.

CMakeLists.txt

cmake_minimum_required (VERSION 3.28)

set(CMAKE_CXX_STANDARD 20)
project (openGLIntergration CXX)

find_package(gl3w CONFIG REQUIRED)
find_package(wxwidgets CONFIG REQUIRED)

# Add source to this project's executable.
add_executable (openGLIntergration WIN32 "main.cpp")

target_link_libraries(openGLIntergration PRIVATE unofficial::gl3w::gl3w)
target_link_libraries(openGLIntergration PRIVATE wx::core wx::base wx::wxgl)

Failure Log:

Severity	Code	Description	Project	File	Line	Suppression State	Details
Error		CMake Error at out/build/x64-Debug-MSVC/vcpkg_installed/x64-windows/share/wxwidgets/wxWidgetsTargets.cmake:159 (set_target_properties):
  The link interface of target "wx::wxgl" contains:

    OpenGL::GLU

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.		C:\dev\source\wxWidgetsTutorials\openGLIntergration\out/build/x64-Debug-MSVC/vcpkg_installed/x64-windows/share/wxwidgets/wxWidgetsTargets.cmake	159		

Platform and version information

  • wxWidgets version you are building: 3.2.4
  • wxWidgets port you are building: wxMSW
  • OS and its version: Windows 11
  • Compiler being used: MSVC 2022
  • Non-default compiler options, if any: None


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24519@github.com>

Maarten

unread,
May 13, 2024, 5:04:18 PM5/13/24
to wx-...@googlegroups.com, Subscribed

What if you add find_package(OpenGL) to your package?
I think this has been fixed in the wx-master branch
(https://github.com/wxWidgets/wxWidgets/blob/f53e852ec273277c570c629447c9091a0c756abb/build/cmake/wxWidgetsConfig.cmake.in#L145
but 3.2 does not have this.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24519/2108796729@github.com>

VZ

unread,
May 13, 2024, 5:34:48 PM5/13/24
to wx-...@googlegroups.com, Subscribed

@MaartenBent If you think it's worth doing this, I could still backport 302ad5f to 3.2 and rebuild the 3.2.5 source archives once again (this wouldn't affect the MSW binaries). Should I do this?


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24519/2108839623@github.com>

Maarten

unread,
May 13, 2024, 5:42:42 PM5/13/24
to wx-...@googlegroups.com, Subscribed

I don't think it is necessary to add this to 3.2.5 and recreate the release files. The workaround is easy enough.

I can create a PR with the backport, and maybe include some other stuff from #24263 as well.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24519/2108850567@github.com>

sidy3d

unread,
May 14, 2024, 11:24:40 PM5/14/24
to wx-...@googlegroups.com, Subscribed

What if you add find_package(OpenGL) to your CMake file? I think this has been fixed in the wx-master branch

Yes, this seems to have fixed the issue.


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are subscribed to this thread.Message ID: <wxWidgets/wxWidgets/issues/24519/2111509388@github.com>

Reply all
Reply to author
Forward
0 new messages