Error finding GLSLang library using CMake

I recently downloaded and built the GLSLang libary for use in my project, but when I try to find it using find_package(glslang REQUIRED), I get an error about missing target SPIRV-Tools-opt. I looked into the glslang-targets.cmake and found out, that some targets have their INTERFACE_INCLUDE_DIRECTORIES set to install/include/External, which is non existent path, but I don’t think it has something to do with missing target SPIRV-Tools-opt. I also tried to use find_package(SPIRV-Tools-opt REQUIRED), but also without success. How can I properly find and include GLSLang library using CMake? Is there something I’m missing or doing wrong?

The GLSLang error:

[cmake] CMake Error at MyProject/CMakeLists.txt:183 (find_package):
[cmake]   Found package configuration file:
[cmake] 
[cmake]     Path to glslang-config.cmake
[cmake] 
[cmake]   but it set glslang_FOUND to FALSE so package "glslang" is considered to be
[cmake]   NOT FOUND.  Reason given by package:
[cmake] 
[cmake]   The following imported targets are referenced, but are missing:
[cmake]   SPIRV-Tools-opt

The SPIRV-Tools-opt error:

[cmake]   By not providing "FindSPIRV-Tools.cmake" in CMAKE_MODULE_PATH this project
[cmake]   has asked CMake to find a package configuration file provided by
[cmake]   "SPIRV-Tools", but CMake did not find one. //For some reason it says SPIRV-Tools and not SPIRV-Tools-opt.

Leave a Comment