glslang
glslang copied to clipboard
Fix support to generate cmake config files
See https://github.com/KhronosGroup/glslang/issues/2751
These commits are used to create and install cmake support files. The extent to which the generated *Config.cmake
files are usable and complete would need to be tested.
This can be done by appropriately modifying the cmake build system of projects that use glslang, or by adding a cmake test to this repo based on ctest --build-and-test
mode.
The new macro add_cmake_support_files
was derived from https://github.com/vsg-dev/VulkanSceneGraph/blob/ad93a77c0e7e3d0ff73552323a1568fecd52239d/cmake/vsgMacros.cmake#L97.
Since this macro is already used in a similar form in more than two repos (glslang, VulkanSceneGraph and sibling repos), after a stabilization period in this repo it might be useful to provide it together with other useful macros in a separate git repo, e.g. vulkan-cmake-macros
to avoid cmake code duplication.
I'm in the process of fixing issues discovered by the CI system - when that's done, the commits will be grouped together in a meaningful way.
The error
CMake Error at C:/projects/glslang/build/tmp/SPIRV-Tools/cmake/SPIRV-ToolsConfig.cmake:3 (get_target_property):
get_target_property() called with non-existent target "SPIRV-Tools".
Call Stack (most recent call first):
is caused by a bug in the generated cmake support file, which is located in the spirv-tools git repo.
This pull request is probably outdated by https://github.com/KhronosGroup/glslang/pull/2989.
Rebased on https://github.com/KhronosGroup/glslang/pull/2989.
Because the SPIRV-Tools-opt development package is now considered a third-party package that must be pre-installed, the client package test fails at msvc.
Closing due to inactivity. Feel free to open a new PR if you want to pick this back up.