Open triuk opened 1 year ago
I definitely hear you; bundling gl3w, glfw, and ImGui as Git submodules is nice for demonstration purposes (e.g., reliably cloning, building, and running this repo), but it is not so great when integrating imgui-vtk into larger CMake projects. However, I think most of that is because of ImGui's design. Since it's a lightweight, cross-platform, cross-toolchain library, it doesn't have any official CMake integration (at least as far as I know). There are a lot of files in this repo, but I think all you really need are VtkViewer.h
and VtkViewer.cpp
if you already have ImGui & VTK.
Personally, I'm not familiar with CPM, but thank you very much for sharing your CMakeLists.txt. I'm glad you're able to make good use of imgui-vtk! :)
Hi, this piece of code is precious. I really love it exists. But the setup is not that simple, because it links to other repositories when downloaded with git and if you already use imgui in the project, it means you'll end up linking all things manually and probably have target conflicts. So to ease this integration, I made a CMakeLists.txt that uses CPM to download and build imgui-vtk. The benefit is obvious - the CPM checks for new version of imgui-vtk every time you configure your project and run cmake on it. That means it is always up to date without effort. When you add other's project to yours, you definitely do not want to do it manually. I'll be happy, if you comment or improve this idea :)
Usage: download just
main.cpp
from theimgui-vtk
project. Add my CMakeFiles.txt code to the same folder (so the working dir has only two files:main.cpp
and thisCMakeFiles.txt
. Configure and build the executable.Successfully tried on Ubuntu 22.04 with VS Code