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

imgui_stdlib is not being detected #36

Closed
paladium opened this Issue Jan 30, 2019 · 3 comments

Comments

Projects
2 participants
@paladium
Copy link

paladium commented Jan 30, 2019

I found myself using imgui_stdlib.h file which contains some overrides for using std libraries with ImGUI. However Magnum does not include those when finding components. A quick fix that worked for me was:

File FindImGui.cmake
Line 101: foreach(_file imgui imgui_widgets imgui_draw imgui_demo **imgui_stdlib**)

Next a new entry will appear in cmake to point to that file. Hope that helps someone.

@mosra mosra added this to the 2019.01 milestone Jan 30, 2019

@mosra mosra added this to TODO in GUI via automation Jan 30, 2019

@mosra

This comment has been minimized.

Copy link
Owner

mosra commented Jan 30, 2019

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 :)

@mosra mosra moved this from TODO to In Progress in GUI Jan 31, 2019

@paladium

This comment has been minimized.

Copy link
Author

paladium commented Feb 1, 2019

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.

@mosra

This comment has been minimized.

Copy link
Owner

mosra commented Feb 1, 2019

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 :)

@mosra mosra closed this Feb 1, 2019

GUI automation moved this from In Progress to Done Feb 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment