Entry level IMGUI & CMAKE example in Ubuntu #5970
Replies: 3 comments 2 replies
-
The biggest hurdle in all the C++ ecosystem is compiling and linking with third-party libraries. In particular, it's a difficult problem in Windows, less so in Unix-style systems like Linux and OSX. While Dear ImGui core files can easily compile pretty much anywhere, and are platform agnostic, the backends/ files are all associated to specific third-party libraries. It is specifically the compiling and linking of backends that can be tricky if you are not already using them. My very personal stance is that providing cmakefile to build the examples applications (which showcase using ALL backends) is too difficult to do in a cross platform manner or would lead to problematic restrictions for some users. This is why I choose to not provide them. Many people disagree with this assumption, and in particular some have been maintaining good set of cmakefiles: #1713 To fully answer your question (and I assume other people after me will) we need to know which backend you intend to use (e.g. GLFW + OpenGL, SDL + Vulkan..). If you already have an windowed app with 3d rendering running you would naturally pick backends matching the libraries your app is running, and it is generally in this situation that compiling examples is NOT a problem. If you don't have an app running already, I'd suggest using SDL+OpenGL or GLFW+OpenGL. |
Beta Was this translation helpful? Give feedback.
-
@jochoalions |
Beta Was this translation helpful? Give feedback.
-
Here's some simple cmake:
All you need to do is swap out the backend file, or use a different version tag. |
Beta Was this translation helpful? Give feedback.
-
I am looking for an example of how to setup CMAKE to build the simple imgui-demo program. I have found a number of very good and easy-to-follow tutorials on Cmake and Imgui, but I cannot even get to the point of being able to compile and run the imgui-demo program as a standalone. I fear that I am over-complicating the issue, given the extraordinary amount of excellent documentation throughout the Imgui source code. But that is where I am at and would appreciate some pointers or some help.
Does anybody know of a repository I can look into, or can provide some pointers on how to setup the CMakeLists.txt files? (Or any other configuration process for that matter, since I am new to CMake and Ubuntu, I can learn any other tool.)
Thank you kindly!!
PS: Or if someone is willing to coach me one-on-one, I would certainly pay for your assistance.
Beta Was this translation helpful? Give feedback.
All reactions