-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to build ImGui example using Vcpkg out of the box #100
Comments
|
@pezcode Thank you so much, I'm so stupid. Also if you wouldn't mind helping again, sorry. I keep getting loads of problems with how libSDL2d is linked.
Have you ever seen this before or know if I'm once again doing something even more stupid. Thanks |
Those I have no idea about, sorry. It seems to not be linking the required macOS SDK libraries, but beyond that I'd be wildly guessing. |
I've found the issue, it's not finding the SDL2 package. After using I'll try see if I can update the FindSDL2.cmake file as this seems to be where the problem lies. |
Hi! I'm just checking
It'd help me to know what does it say there. Thanks! |
It seems the following could be enough for Magnum's diff --git a/modules/FindSDL2.cmake b/modules/FindSDL2.cmake
index 54844d696..47a70a8f8 100644
--- a/modules/FindSDL2.cmake
+++ b/modules/FindSDL2.cmake
@@ -42,10 +42,21 @@
# DEALINGS IN THE SOFTWARE.
#
-# If we have a CMake subproject, use the targets directly. I'd prefer the
-# static variant, however SDL2 defines its own SDL2::SDL2 alias for only the
-# dynamic variant since https://github.com/libsdl-org/SDL/pull/4074 and so I'm
-# forced to use that, if available.
+# SDL installs cmake package config files that handle platform-specific
+# dependencies, especially in case it's built statically. Try to find it first,
+# quietly, so it doesn't print loud messages if the config file is not found,
+# since that's okay (an installed package might not have the CMake files at
+# all, for example). If some SDL target already exists, it means we're using it
+# through a CMake subproject -- don't attempt to find the package in that case.
+if(NOT TARGET SDL2 AND NOT TARGET SDL2-static)
+ find_package(SDL2 CONFIG QUIET)
+endif()
+
+# If either a SDL target was found or we have a CMake subproject, use the
+# targets directly. I'd prefer the static variant, however SDL2 defines its own
+# SDL2::SDL2 alias for only the dynamic variant since
+# https://github.com/libsdl-org/SDL/pull/4074 and so I'm forced to use that, if
+# available.
if(TARGET SDL2)
# In case we don't have https://github.com/libsdl-org/SDL/pull/4074 yet,
# do the alias ourselves. Just to clear things up -- it shouldn't be needed to update anything in the ImGui integration itself, it's independent on SDL. On the other hand I'm a bit suspicious that vcpkg injects its own FindSDL2 variant, because Magnum's variant does have handling for macOS dependencies (although it could be broken for this particular use case, of course): https://github.com/mosra/magnum/blob/d96957b5a4198f288d306775e06c80e69928012b/modules/FindSDL2.cmake#L177-L211 |
Hi,
I don't know if I've done something wrong, most likely have, but I'm trying to build this repo after using VCPKG.
I used VCPKG to install the magnum packages and used this command and installed the following libraries and cloned this repo:
./vcpkg install --head corrade magnum magnum-integration imgui
I set CMAKE_TOOLCHAIN_FILE to my VCPKG cmake file in build systems (vcpkg/scripts/buildsystems/vcpkg.cmake) and built the project with only the
WITH_IMGUI_EXAMPLE
set to ON.However, after attempting a build, my CMake returns this:
Could someone help me understand what I've done wrong. As you can tell I'm using Clang as my compiler and I'm currently running macOS.
Thanks,
George
The text was updated successfully, but these errors were encountered: