VkFFT icon indicating copy to clipboard operation
VkFFT copied to clipboard

glslang is included in CMake even if targets already exist

Open wrosecrans opened this issue 4 years ago • 1 comments

A vulkan application using vkfft may already be using glslang, or depend on some other library that also uses glslang. If multiple places try to add_subdirectory() glslang, then it tries to set up multiple targets with the same name in Cmake's global namespace. So when you add_subdirectory(vkfft), you get errors.

If you wrap the inclusion with something like

if (NOT TARGET OSDependent) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/glslang-master) endif()

it will be a bit easier to use in some applications.

wrosecrans avatar Jul 16 '21 18:07 wrosecrans

Hello,

You don't want to use provided CMakeLists in your app - it has a lot of unnecessary targets like benchmarks and precision verification scripts. A single header nature of VkFFT allows to simply copy it in the application include path and it is good to go (just specify the backend used).

Best regards, Dmitrii Tolmachev

DTolm avatar Jul 16 '21 19:07 DTolm