ConfettiFX / The-Forge

The Forge Cross-Platform Rendering Framework PC Windows, Steamdeck (native), Ray Tracing, macOS / iOS, Android, XBOX, PS4, PS5, Switch, Quest 2
Apache License 2.0
4.75k stars 497 forks source link

CMake support? #194

Open kangsheng89 opened 3 years ago

kangsheng89 commented 3 years ago

is there any plan for offcial cmake support for the-forge?

https://github.com/DeanoC/The-Forge/blob/master/CMakeLists.txt

cboiangiu commented 3 years ago

I am currently trying to put together support for cmake with https://github.com/cboiangiu/The-Forge.cmake. I am using https://github.com/widberg/bgfx.cmake as a guide. Ideally I wish to build The-Forge as a package and then include the lib as a framework. Also working on https://github.com/cboiangiu/the-forge-starter to implement the lib with cmake support and draw a simple cube, while keeping the useful interfaces such as IApp (like they are used in the Unit Tests). The starter is based on https://github.com/pr0g/sdl-bgfx-imgui-starter.

kangsheng89 commented 3 years ago

Yes i totally agree with package it as lib. with cmake move, we also can consider using conan/vcpkg. By doing so, it will make the opensource community to adopt this framework

mgood7123 commented 3 years ago

I am currently trying to put together support for cmake with https://github.com/cboiangiu/The-Forge.cmake. I am using https://github.com/widberg/bgfx.cmake as a guide. Ideally I wish to build The-Forge as a package and then include the lib as a framework. Also working on https://github.com/cboiangiu/the-forge-starter to implement the lib with cmake support and draw a simple cube, while keeping the useful interfaces such as IApp (like they are used in the Unit Tests). The starter is based on https://github.com/pr0g/sdl-bgfx-imgui-starter.

this would also allow it to "just be used" with other IDE's that have support for cmake (or even simply via cmake itself like make project (fictional makefile target) which would call cmake)

THISISAGOODNAME commented 2 years ago

https://github.com/CU-Production/The-Forge-CMake You can build The-Forge first, and then use it as a library.

Geenz commented 2 years ago

https://github.com/Geenz/TheForgeTheCmake This is my attempt at it. It's fairly incomplete - but stuff like dynamic linking is there. I'm working on adding unit tests and the like.

JonahGoldsmith commented 1 year ago

I have a working version for the newest update of The-Forge! https://github.com/JonahGoldsmith/The-Forge-CMake This Works on Windows Only but will work on MACOS and IOS in the next few days! The Test Project Shows how to copy DLL's and Run the Shader Compiler just like the VS Projects Do!

jochumdev commented 1 year ago

I've made:

TheForgeCMake reflect's the UbuntuCodeLite/*.project files.

Caellian commented 4 months ago

I agree, but this has been previously discussed in #158 and the issue is that CMake supports too much so the tests wouldn't cover all the supported targets.

Not sure why simply checking MSVC_VERSION isn't an option as CMake could be made to throw errors if unsupported target is used. It's up to maintainers though and it seems they prefer using .sln files instead.

On a practical side of things, switching is almost certainly a cost that wouldn't be directly beneficial to them and if they're not familiar with CMake it just adds additional complexity to maintaining their .sln, so I don't believe they'd be willing to incur the cost of switching and maintaining even if someone provided a complete solution.

cboiangiu commented 3 months ago

I agree, but this has been previously discussed in #158 and the issue is that CMake supports too much so the tests wouldn't cover all the supported targets.

Not sure why simply checking MSVC_VERSION isn't an option as CMake could be made to throw errors if unsupported target is used. It's up to maintainers though and it seems they prefer using .sln files instead.

On a practical side of things, switching is almost certainly a cost that wouldn't be directly beneficial to them and if they're not familiar with CMake it just adds additional complexity to maintaining their .sln, so I don't believe they'd be willing to incur the cost of switching and maintaining even if someone provided a complete solution.

Wouldn't adding proper CMake support allow for easy generation of the current .slns though? It's just that you focus on maintaining the CMake, instead, for better or for worse.

cboiangiu commented 3 months ago

I do however support the idea of having a cross-platform template project similar to this with separate CMake support as a starting point. This would be best maintained separately from the current unit tests as to not disrupt the current pipelines and processes. Ideally this could be later merged here maybe, as it would be easier to maintain breaking changes or additions to the CMake project. The template project using the CMake project across different platforms could also be seen as just another unit test.

Caellian commented 3 months ago

Wouldn't adding proper CMake support allow for easy generation of the current .slns though? It's just that you focus on maintaining the CMake, instead, for better or for worse.

Yes and no. Differences start to show with complex configurations (e.g. game engines). A generator will never satisfy all requirements in all environments, which is why they don't want to use it.

For the same reason, you might be better off setting up your own configuration with specialized dependencies, which I'm guessing they're doing for their clients.