google / shaderc

A collection of tools, libraries, and tests for Vulkan shader compilation.
Other
1.84k stars 361 forks source link

Importing ShaderC #324

Open nkyriazis opened 7 years ago

nkyriazis commented 7 years ago

I think including ShaderC in every project that is to be built against it is suboptimal. Since cmake install is an option, one could use this mechanism to enable automatic finding of build and installed shaderc. See "Exporting targets" in https://cmake.org/Wiki/CMake/Tutorials/Exporting_and_Importing_Targets.

dneto0 commented 7 years ago

That wiki seems out of date. When using CMake 3.7, the EXPORT is not allowed on the "install" directive. There is an "export" directive instead. https://cmake.org/cmake/help/v3.7/command/export.html

What's the cost of not having this? What's wrong with just referencing an externally built Shaderc as an IMPORTED dependency?

nkyriazis commented 7 years ago

Nothing wrong with it. This is what I'm referring to. How is one supposed to easily link against a built libshaderc from another cmake project without a target export of some kind? Is there something already in place I'm missing?

Also, installations are usually deploy-friendly, and as such they provide the appropriate place for such automations, compared to local build directories.