Currently, SPIRV-Cross doesn't seem to follow CMake best practices for imported targets:
create one config file for the all library
export a namespace for imported targets
It means that, when consuming SPIRV-Cross, we have to repeatedly call find_package for each component of SPIRV-Cross, as if they were independant projects, instead of just doing something like:
find_package(SPIRV-Cross REQUIRED spirv-cross-cpp spirv-cross-hlsl CONFIG) # only one config file required (for example SPIRV-Cross-Config.cmake)
add_executable(myapp myapp.cpp)
target_link_libraries(myapp PRIVATE SPIRV-Cross::spirv-cross-cpp SPIRV-Cross::spirv-cross-hlsl) # namespaced imported targets
I'm not sure if I want to break existing clients' CMake integration which expect to see CMake targets being exposed in a specific way. As far as I can tell, this is a minor annoyance if anything?
Currently,
SPIRV-Cross
doesn't seem to follow CMake best practices for imported targets:It means that, when consuming
SPIRV-Cross
, we have to repeatedly callfind_package
for each component of SPIRV-Cross, as if they were independant projects, instead of just doing something like: