Skip to content

Our exported CMake targets depend on CUDAToolkit targets that may be missing later on #717

@eyalroz

Description

@eyalroz

CMake's CUDAToolkit package doesn't introduce all necessary targets for various CUDA libraries - for which reason we do that half-on-our own:

if(CUDAToolkit_VERSION VERSION_GREATER_EQUAL 12.4)
    foreach(tgt nvfatbin nvfatbin_static)
        if (NOT TARGET ${tgt})
            _CUDAToolkit_find_and_add_import_lib(${tgt})
        endif()
    endforeach()
endif()
if (NOT TARGET CUDA::cufilt)
    _CUDAToolkit_find_and_add_import_lib(cufilt)
endif()

... but this only happens in our main CMakeLists.txt file - not in the config file we install; which means, that whoever uses our library will not see these generated targets; and if we depend on them - the CMake configuration with our library will fail.

So, it seems like we need to add this code to config file, cmake/cuda-api-wrappers-config.cmake.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions