Skip to content
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

cmake build static/shared with two demo opengl3+{sdl3,glfw} #7650

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

charlie-wong
Copy link

  • mkdir build && cd build && cmake .. && make, Release, Shared, No IMPLs
  • cmake -DIMGUI_BUILD_EXAMPLES=ON .. && make, Release, Shared, IMPLs depends your host
  • build examples: OpenGL3 + GLFW, OpenGL3 + SDL3

NOTE, I JUST test it in Ubuntu-24.04, and the IMPLs & demo also needs to add more!

@charlie-wong
Copy link
Author

is there anything wrong or what else?

@ocornut
Copy link
Owner

ocornut commented Jun 11, 2024

Maybe good to read the room
https://github.com/ocornut/imgui/pulls?q=is%3Apr+label%3Abuilding+cmake

TL;DR; this is immensely more complex that most people understand, I personally think there's no easy solution and that the healthiest solution is to NOT provide a cmakefile. But I'm keeping the hope that some of the better contributions may be useful sometimes.
If you wrote "I JUST test it in Ubuntu-24.04" I am sorry to say that you don't understand the problem. There is no standard way to obtain packages in C++. Assuming one is problematic for many reasons.

@charlie-wong
Copy link
Author

Firstly, sorry the very late reply!

I know there is no standard way to get pre-build binary package. But the cmakefiles is just a widely used build system, it is not for release the pre-build binary library package for someone to obtain. If someone use cmake, and when he get the code of imgui, it will be handy if there has the cmakefile to build the project, thus he do not need to start from scratch!

What I want to say more is, I think it is rare for one to test the related code for all OS, more often is one used one OS, and do the coding then do some testing.

And I think cmakefiles is not that complex, do not need to support all version, just pick a recently version is ok, like cmake-v3.15, which is release at 2020, or cmake-v3.0 at 2016.

I think the important is to pick one, make it work at least for on plantform, not matter the solution is pretty or not, if someone use it and found bug, then fix it. Make it work first, then make it work better, and works for all!

@ocornut
Copy link
Owner

ocornut commented Jun 30, 2024

Pretty much all the feedback I got from open-source maintainers who added a cmake file was that they regretted it because it became endless queries and maintenance.

I think you don’t realize the complexity of making example compile with variety of backends. I will only consider it when I have a chance to investigate it myself, and those references will be useful.

@charlie-wong
Copy link
Author

Yes, to support all the backends is realy complexity, but i think you do not need to make it work at once, I think it maybe better, if you add cmakefiles support to the core part of project, thus, if someone use a backends which no cmakefile, thus here is a good start-point for him to start with, and do not need to do it from scratch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants