You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
set_source_files_properties(${SHADERS} PROPERTIES VS_TOOL_OVERRIDE "None")
set(COMPILED_SHADERS_DIR ${CMAKE_CURRENT_BINARY_DIR}/CompiledShaders)
file(MAKE_DIRECTORY "${COMPILED_SHADERS_DIR}")
foreach(SRC_SHADER ${SHADERS})
get_filename_component(SHADER_NAME ${SRC_SHADER}NAME_WE)
get_filename_component(SHADER_EXT ${SRC_SHADER}EXT)
set(COMPILED_SHADER ${COMPILED_SHADERS_DIR}/${SHADER_NAME}.h)
list(APPEND COMPILED_SHADERS ${COMPILED_SHADER})
set(PROFILE vs_5_0)
if(${SHADER_NAME}STREQUAL"asteroid_ps")
set(PROFILE ps_5_1)
elseif(${SHADER_EXT}STREQUAL".psh")
set(PROFILE ps_5_0)
endif()
add_custom_command(OUTPUT${COMPILED_SHADER}# We must use full path here!COMMAND fxc /T ${PROFILE} /E ${SHADER_NAME} /Vn g_${SHADER_NAME} /Fh "${COMPILED_SHADER}""${SRC_SHADER}"WORKING_DIRECTORY"${CMAKE_CURRENT_SOURCE_DIR}"COMMENT"Compiling ${SRC_SHADER}"VERBATIM
)
endforeach(SRC_SHADER)
# NB: we must use the full path, otherwise the build system will not be able to properly detect# changes and shader compilation custom command will run every timeset_source_files_properties(${COMPILED_SHADERS} PROPERTIES GENERATEDTRUE)
The text was updated successfully, but these errors were encountered:
Taken from https://github.com/DiligentGraphics/DiligentSamples/blob/master/Samples/Asteroids/CMakeLists.txt
The text was updated successfully, but these errors were encountered: