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

Added cmake tooling #57

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

Added cmake tooling #57

wants to merge 1 commit into from

Conversation

pthom
Copy link

@pthom pthom commented Apr 18, 2024

If you are interested, this is a CMake file that I added. This CMake file was tested under linux, macOS and windows.
I also added a backend "glfw_gl3" for samples.

Feel free to close this PR if you prefer to continue with sharpmake only.

Note: this PR will not compile unless the simple fixes PR was applied before (in order to fix some compilation issues on diverse platforms)

@pthom pthom force-pushed the cmake_tooling branch 2 times, most recently from b7d9144 to 4807a24 Compare April 19, 2024 07:46
Code/ServerApp/Source/NetImguiServer_App.h Outdated Show resolved Hide resolved
CMakeLists.txt Show resolved Hide resolved
Code/Sample/Common/main_glfw_gl3.cpp Show resolved Hide resolved
@pthom
Copy link
Author

pthom commented Apr 21, 2024

@sammyfreg wrote:

I'm thinking about wanting this CMake file included or not. On one hand, it's good work and definitely nice to have, but on the other hand it might soon get out of date without me dedicating extra time to maintain it too. It is not too complex (the Sharpmake version is a bit more complicated, but could also be used to output a makefile I believe).

My advice is that you should not merge this PR, and leave it opened so that people who are looking for it might find it and know that they need to adapt it because it might be outdated.

@pthom
Copy link
Author

pthom commented Apr 21, 2024

@sammyfreg wrote:

The other thing is that we really only need the NetImguiServer application to have multi-platform compiling support. The samples are just a simple demonstration that can easily be compiled without a build system configured, and the NetImgui client code is usually included in an existing project, and is the one that was meant to be truly multi-platform.

By default, here are the options in the cmake file:

option(NETIMGUI_BUILD_CLIENT "Build client" ON)
option(NETIMGUI_BUILD_IMGUI "Build imgui from sources in netImgui" ${PROJECT_IS_TOP_LEVEL})
option(NETIMGUI_BUILD_SAMPLES "Build samples" ${PROJECT_IS_TOP_LEVEL})
option(NETIMGUI_BUILD_SERVER_LIB "Build server lib" ${PROJECT_IS_TOP_LEVEL})
option(NETIMGUI_BUILD_SERVER_APP_SOKOL "Build server app" ${PROJECT_IS_TOP_LEVEL})

i.e.

  • the client lib is built by default
  • ImGui is built only if compiling netImgui as the main project
  • Sample are built only if compiling netImgui as the main project
  • The server is built only if compiling netImgui as the main project. In the current state, the server can only be built with Sokol, but users may adapt it quite easily: I left hints in the cmake file for that.

@pthom pthom force-pushed the cmake_tooling branch 3 times, most recently from e7718cf to 0d0cae9 Compare April 21, 2024 06:59
This CMake file was tested under linux, macOS and windows.
Also added backend glfw_gl3 for samples.
@pthom
Copy link
Author

pthom commented Apr 21, 2024

I think I had been too fast in the last push, I added an ifdef inside Code/Sample/Common/main.cpp which probably led the CI to fail. I removed it and I hope that the CI will pass.

Anyhow, it is not very important that it passes since this PR is meant to remain opened and not merged.

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

Successfully merging this pull request may close these issues.

None yet

2 participants