Nadrin / Quartz

Vulkan RTX path tracer with a declarative ES7-like scene description language.
GNU Lesser General Public License v3.0
435 stars 23 forks source link

Windows build error #3

Closed happydpc closed 5 years ago

happydpc commented 5 years ago

Use the cmake tool with MSVC 2017 configure, reports this error. Maybe some file is missing.

CMake Error at src/raytrace/CMakeLists.txt:109 (add_library): Cannot find source file:

renderers/vulkan/shaders/vulkan_shaders.qrc
sl1pkn07 commented 5 years ago

see the readme:

Steps to build Compile GLSL shaders to SPIR-V by running: src\raytrace\renderers\vulkan\shaders\compile.py. Configure & build the project using the top level CMakeLists.txt file.

Nadrin commented 5 years ago

As @sl1pkn07 pointed out - you need to compile GLSL shaders before building with CMake. compile.py generates Qt resource file needed by CMake configuration step - it'll fail if it's not present.

happydpc commented 5 years ago

Thank you for your suggestion.

sl1pkn07 commented 5 years ago

mmm @Nadrin what happen if launch the GLSL shaders build script when run the cmake command?

sl1pkn07 commented 5 years ago

like:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 016e4c7..d9338ef 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,10 @@
 cmake_minimum_required(VERSION 3.8)
 project(Quartz)

+find_package(PythonInterp 3)
+message(STATUS "Building GLSL Shaders:")
+execute_process(COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/raytrace/renderers/vulkan/shaders/compile.py)
+
 option(BUILD_SHARED_LIBS "Build shared libraries" ON)
 option(BUILD_APPS "Build the standalone renderer & supplemental tools" ON)
 option(BUILD_EXAMPLES "Build example programs" ON)
Nadrin commented 5 years ago

With the above setup cmake will only recompile shaders on configure and not on rebuilds. I tried many variants of including shader compile step within cmake scripts and came to the conclusion that having a separate python script is the most convenient solution (even though you need to remember to run it after changing GLSL files).