I added the following in my CMakeLists.txt…
set(PATH_PER_VERTEXSHADER ${VERTEXSHADERS})
set(PATH_PER_PIXELSHADER ${PIXELSHADERS})
list(TRANSFORM PATH_PER_PIXELSHADER PREPEND Source/)
list(TRANSFORM PATH_PER_VERTEXSHADER PREPEND Source/)
set(PATH_PER_SHADER ${PATH_PER_VERTEXSHADER} ${PATH_PER_PIXELSHADER})
set_property(SOURCE ${PATH_PER_VERTEXSHADER} PROPERTY VS_SHADER_TYPE vertex)
set_property(SOURCE ${PATH_PER_VERTEXSHADER} PROPERTY VS_SHADER_MODEL 5.0)
set_property(SOURCE ${PATH_PER_PIXELSHADER} PROPERTY VS_SHADER_TYPE pixel)
set_property(SOURCE ${PATH_PER_PIXELSHADER} PROPERTY VS_SHADER_MODEL 5.0)
add_library(TestShaders INTERFACE ${PATH_PER_SHADER})
Running cmake --build .cmake --config Debug
the following error happens…
FXC : error X3506: unrecognized compiler target ‘vs’
There seems to be no documentation about what to specify for VS_SHADER_TYPE and VS_SHADER_MODEL, I experimented until something caused the output to change, and ended up with these parameters… vertex
and shader
for VS_SHADER_MODEL, and for VS_SHADER_TYPE a dot (e.g. 5.0
instead of 5_0
)
CMake version is 3.30.5