yuphin / Lumen

A Vulkan Raytracing framework for various bidirectional path tracing techniques
MIT License
449 stars 29 forks source link

Add CMakeLists.txt #7

Closed ghost closed 1 year ago

ghost commented 1 year ago

Most modern C/C++ projects switched to cmake based build system.

yuphin commented 1 year ago

I'll add a CMakeLists.txt when I test it with Linux.

Lachei commented 1 year ago

Hi all, I just wanted to give a quick heads up that i have nearly finished a cmake port of the project: https://github.com/Lachei/Lumen . If everything goes according to plan I will be able to verify until tomorrow if the project builds fine on Ubunut as well as Windows. The current version compiles and runs fine on Linux Manjaro/Arch. However i think the standard visual studio sln setup will be broken. Concerning this, @yuphin do you think this is a problem or is a full switch to cmake preferred. After all Visual Studio has full build support with cmake.

Cheers, Josef

yuphin commented 1 year ago

Hello Josef, thanks for going out of your way to port the project, I really appreciate it :) . Regarding the VS solution structure, AFAIK the source_group(...) command translates to VS Filters, but the absence of it is not an issue as I can also add them back at a later time.

When you think it's ready, I'd be happy to accept your changes in a PR.

Lachei commented 1 year ago

Ok, i finally finished the port to windows, getting SPIRV-Cross to work took a bit of an effort xD. I will double check tomorrow if the program still runs on my linux machine and will create the PR afterwards.

The CMake port itself only relies on Vulkan and the Threads library to be found by CMake, all other repositories are downloaded as submodules and compiled with the project. This is necessary as unfortunately the windows and linux Vulkan SDK do not provide the same extensions. While on Linux glslang comes preinstalled with most distros, on Windows there is no glslang but instead shaderc and SPIRV-Cross. One idea for the future to strip off a lot of boilerplate libraries is to write everything only using glslang and making it the only submodule required. This however needs some code refactoring which i did not want to tackle right now.

I further added an example_config folder which describes a OS independent (at least for windows and linux) config for VSCode. This is especially useful to quickliy get the project not just compiling, but also up for debugging (Especially getting the relative paths to the assets right can get tricky for beginners). VSCode was chosen as i personally find it the best OS indepent developing environment right now.

Cheers, Josef

yuphin commented 1 year ago

We now have a proper CMake support thanks to @Lachei. Closing this issue now.