Comments (8)
Hi, thanks for the report!
I tried to do this in a way that doesn't make the whole ImGuiIntegration
library depend on the imgui_stdlib.cpp
file, since this particular STL compatibility is not used there. I came up with the following, currently only in the next
branch -- first take the updated FindImGui.cmake
from here, then in your CMakeLists add this:
find_package(ImGui REQUIRED SourcesMiscCpp)
...
target_link_libraries(your-app PRIVATE ImGui::SourcesMiscCpp)
After that, you should be able to
#include <misc/cpp/imgui_stdlib.h>
and everything should work as expected. Though I'm not sure if the misc/cpp
prefix makes sense, maybe I'll make it so only #include <imgui_stdlib.h>
is needed. What do you say? Can you test on your side and confirm it works? Also, suggestions welcome :)
from magnum-integration.
Oh ok, that worked. Thanks!
from magnum-integration.
Yes that works, thanks for the fix. The stdlib for imgui is still in development and has little useful functions at this point, however if it becomes larger, it will make sense to make ImGUIIntegration dependent on that file. At this point, this would work.
from magnum-integration.
Thanks for the confirmation! 👍 3a2cb98 is now in master.
I'm not sure if @ocornut
wants to depend on STL too much, so I assume it will stay like this for quite a while. But who knows. If it will later make sense to have it directly, then I can make that change, of course :)
from magnum-integration.
Unfortunately I'm having problems even using the find_package(ImGui REQUIRED SourcesMiscCpp)
inside my CMakeLists: CMake says that it could not find the component SourcesMiscCpp.
I'm using the latest ImGui release, and the path of the misc folder is the same as the one specified in the FindImGui.cmake
so... idk what's going on.
I also want to specify that I have magnum-integration as my CMake's subdirectory, and that if I add the SourcesMiscCpp to the find_package inside the CMakeLists of the library, the find_package inside my CMakeLists can find the component for some reason (but it's not the best solution obv).
Any suggestions?
from magnum-integration.
That's weird ... I just tried to reproduce here (adding the find_package()
to the imgui example), but everything works as expected.
- Are you sure your copy of
FindImGui.cmake
is the same as the one in the integration repo? - If you look into
CMakeCache.txt
, which of theImGui_*
variables are set to-NOTFOUND
?
from magnum-integration.
Are you sure your copy of FindImGui.cmake is the same as the one in the integration repo?
Yep, I literally copied the modules directory from magnum-integration inside mine.
I just tried to reproduce here (adding the find_package() to the imgui example), but everything works as expected.
I just tried that too and it worked for me either, so I analyzed the differences between the example and my project and found that in my project I have the magnum-integration and imgui subprojects inside a ThirdParty directory with a CMakeLists, but, in the imgui example, I putted magnum-integration and imgui directly in a subdirectory inside the main CMakeLists. In fact I did the same thing in my project and it worked fine. To clarify:
My project:
Main CMakeLists -> ThirdParty subdir -> magnum-integration subdir (with imgui)
Imgui example:
Main CMakeLists -> magnum-integration subdir (with imgui)
This is the CMakeLists inside the ThirdParty dir:
set(WITH_IMGUI ON CACHE BOOL "" FORCE)
set(IMGUI_DIR "${CMAKE_CURRENT_SOURCE_DIR}/imgui/")
add_subdirectory(magnum-integration)
Maybe I did something wrong here?
from magnum-integration.
I see the problem now -- find_package(ImGui REQUIRED SourcesMiscCpp)
needs the IMGUI_DIR
. Because you're setting it in a subdirectory, the parent won't see it, and then FindImGui.cmake
will fail to find the sources because it doesn't know where to look. One way to fix this would be to put it into the cache, so parent dir can pick it up from there:
set(IMGUI_DIR "${CMAKE_CURRENT_SOURCE_DIR}/imgui" CACHE STRING "" FORCE)
from magnum-integration.
Related Issues (20)
- Add Support for Dear ImGui extensions HOT 1
- i get an error when i am trying running a robotic simulation with robot_dart and magnum HOT 1
- Crash in magnum-imgui Example Program HOT 1
- Consider switching from the legacy Find*.cmake modules to install(TARGETS ... EXPORT ...) HOT 10
- Could NOT find MagnumIntegration (missing: Dart) HOT 1
- [arch] build fails - lwop_ivec3 not defined HOT 2
- Magnum::ImGuiIntegration missing from debian package HOT 5
- How to use ImGui integration as subdirectory HOT 6
- Custom flags for Dear ImGui integration HOT 4
- Fail to build target iOS HOT 5
- ArchLinux PKGBUILD needs fixes HOT 1
- Linking failure with ImGui HEAD HOT 2
- ImGui integration does not support drawing lots of elements (ImGuiBackendFlags_RendererHasVtxOffset) HOT 7
- ImGui integration does not support adding UserCallback to DrawList HOT 1
- ImGui IdxOffset not honored correctly during frame drawing HOT 4
- Key Events have changed in ImGui HOT 10
- ImGUI IO assertion failure HOT 3
- Imgui_internal.h IMGUI_API inclusion HOT 16
- MSYS .gitattributes typo: Wrong line ending normalization under Windows HOT 2
- ImGuiIO modifier key states incorrect under Linux/X11 (glfw) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from magnum-integration.