Reference: microsoft/vcpkg#38539
I build wxWidgets and/or my application using:
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
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.![]()
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.![]()
@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.![]()
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.![]()
What if you add
find_package(OpenGL)to your CMake file? I think this has been fixed in the wx-master branch
but 3.2 does not have this.
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.![]()