VulkanSceneGraph: Unable to use CMake FetchContent

Describe the bug Unable to use the FetchContent module to include VSG into a local project. There is also some clashing in the namespace such as “clobber”.

To Reproduce This commit contains an example of how to enable an option that should include VSG as a proper target.

Expected behavior During configuration VSG should build and then be available as a target in CMake.

Additional context I haven’t had a chance to dig into this yet.

The following REQUIRED packages have been found:

 * Vulkan (required version >= 1.2.162.0)
 * Threads

-- The following OPTIONAL packages have not been found:

 * vsg_glslang

CMake Error at CMakeLists.txt:40 (find_package):
  By not providing "Findvsg.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "vsg", but
  CMake did not find one.

  Could not find a package configuration file provided by "vsg" with any of
  the following names:

    vsgConfig.cmake
    vsg-config.cmake

  Add the installation prefix of "vsg" to CMAKE_PREFIX_PATH or set "vsg_DIR"
  to a directory containing one of the above files.  If "vsg" provides a
  separate development package or SDK, be sure it has been installed.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 57 (19 by maintainers)

Most upvoted comments

I have now got vsgImGui and vsgExamples working with vsgFramework’s FetchContent branch.

https://github.com/vsg-dev/vsgFramework/tree/BuildFlexibility

This checks out the respective BuildFlexibility branches.

Left to complete is vsgQt. I’m not yet happy about the mods to the respective component libraries so I’ll need to review this as well. The sticking point is how to more elegantly tell the build a find_package call isn’t required. Currently I’ve had to add the following type of workarounds to component libraries:

# add definitions to enable building vsgImGui as part of submodule
add_library(vsgImGui::vsgImGui ALIAS vsgImGui)
set(vsgImGui_FOUND TRUE CACHE INTERNAL "vsgImGui found.")
set(CMAKE_DISABLE_FIND_PACKAGE_vsgImGui TRUE CACHE INTERNAL "Disable find_package(vsgImGui) as it's not necessary.")