Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add glslangConfig.cmake or glslang-config.cmake file to facilitate cmake package interaction #2570

Closed
axsaucedo opened this issue Mar 14, 2021 · 13 comments

Comments

@axsaucedo
Copy link

axsaucedo commented Mar 14, 2021

Currently when glslang is installed, any import using find_package(glslang REQUIRED) will fail given that there is no glslangConfig.cmake or glslang-config.cmake made available as part of the install.

This can be fixed by adding an extra file under the names above, with contents along the lines of:

# inside file glslangConfig.cmake

include("${CMAKE_CURRENT_LIST_DIR}/OSDependentTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/OGLCompilerTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/glslangTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/SPIRVTargets.cmake")

Edit: The VCPKG project seems to have a glslangConfig.cmake file that could be used as a base

@axsaucedo
Copy link
Author

Thank you @aliPMPAINT but thats still a workaround to a Findglslang.cmake / glslanConfig.cmake file - it would still be ideal to just add the compatibility with find_package as it's a standard workflow for cmake projects

@greg-lunarg
Copy link
Contributor

greg-lunarg commented Mar 15, 2021

I am currently not funded to make this improvement but if someone is knowledgeable and wants to see this happen sooner than later, I will accept a PR. Let me know if you start work and I will assign.

@axsaucedo
Copy link
Author

@greg-lunarg great to hear this is relevant. Not sure what you mean tho, what do you mean by funded? Is there a pay-to-fix structure, or is there a Forum where feature requests are upvoted? Not really familiar with what's the process for KhronosGroup repos for new features like this one, is there a README/Forum where I can find out more about this process?

@greg-lunarg
Copy link
Contributor

This repo is open source controlled by KhronosGroup. All the development is "donated" by individuals or companies interested in seeing this software be useful.

As such, my consulting company is funded by a well-known ISV to maintain this repo. Right now my level of funding is just enough to triage new bugs, fix bugs I can't find anyone else to fix and review and merge bug fixes and new features presented by others.

If you wish to submit a PR, you only need to submit a Contributing License Agreement (CLA).

@axsaucedo
Copy link
Author

Thank you for the detail @greg-lunarg , this is quite informative! Ok great, I didn't know this structure, but makes complete sense, and I can see how fixing bugs is something that would take precedence over adding features.

I also didn't know about the CLA, I would be interested to give this a go and add this contribution - what is the process I would go through in order to set up the CLA?

@greg-lunarg
Copy link
Contributor

I am not sure how to set up the CLA ahead-of-time, but when you attempt to create your first PR you will be guided through the CLA process.

Good luck and thanks in advance for your contributions!

@robertosfield
Copy link

Has the been progress on creation of glslangConfig.cmake? I am currently revisiting how the VulkanSceneGraph project pulls in the optional glslang dependency, the lack of glslangConfig.cmake previously led me to hack a vsg_glslangConfig.cmake in absence of any official support and for backwards compatibility. I'd much rather rely on an official glslangConfig.cmake though.

The vsg_glslangConfig.cmake I created is:

vsg_glslangConfig.cmake

I'm not proposing this particular script for the glsLang project, @axsaucedo suggestion relying upon glslangTargets.cmake etc is better for when these are available.

If there is a PR that adds glslangConfig.cmake I'd be happy to help out with testing.

@hiradyazdan
Copy link

The same issue applies to shaderc, but its vcpkg port doesn't have cmake config to make it available. This issue might be related microsoft/vcpkg#16658

@magicse
Copy link

magicse commented Aug 27, 2022

Mingw64
CodeBlocks
Windows 7
I added "find_package(glslang)" in to my general CMakeLists.txt
But the The same problem.

CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/OSDependentTargets.cmake:2 (message):
  Using `OSDependentTargets.cmake` is deprecated: use `find_package(glslang)`
  to find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:115 (include)


CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/OGLCompilerTargets.cmake:2 (message):
  Using `OGLCompilerTargets.cmake` is deprecated: use `find_package(glslang)`
  to find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:116 (include)


CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/HLSLTargets.cmake:2 (message):
  Using `HLSLTargets.cmake` is deprecated: use `find_package(glslang)` to
  find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:119 (include)


CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/glslangTargets.cmake:2 (message):
  Using `glslangTargets.cmake` is deprecated: use `find_package(glslang)` to
  find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:121 (include)

CMake Warning at Z:/AI_SDK/CPP_GFPGAN/Real-ESRGAN-ncnn-vulkan/vulkan/glslang-master-tot/Build/install/lib/cmake/SPIRVTargets.cmake:2 (message):
  Using `SPIRVTargets.cmake` is deprecated: use `find_package(glslang)` to
  find glslang CMake targets.
Call Stack (most recent call first):
  CMakeLists.txt:122 (include)

@juan-lunarg
Copy link
Contributor

The vulkan validation layers currently uses glslangConfig.cmake right now:

https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/9534456051ec513b731f22f56860368cef445a92/tests/CMakeLists.txt#L222

What support is missing exactly?

@juan-lunarg
Copy link
Contributor

I think this issue can be closed as far as I can see. Although it would be good to add additional testing to ensure it doesn't accidentally break. But that's another PR.

@arcady-lunarg your thoughts?

@arcady-lunarg
Copy link
Contributor

This was fixed by #2989, which should have been linked to this issue but was inadvertently not due to a typo.

@axsaucedo
Copy link
Author

Thabk you for following up

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants