OpenACC + CUDA + CMake

New users can not upload attachements, so I linked them here:

We would like to use C with OpenACC pragmas and CUDA kernels in some hotspots.
With make everything is fine. However we would like to build with CMake.
We started with this repo:
We needed to remove <LINK_LIBRARIES> from CMAKE_CUDA_LINK_EXECUTABLE because it tries to link cuda libraries in the nvc++ link step, causing errors at runtime. This way however we can not link external libraries, which we want to do.

The CMake line with added LINK_LIBRARIES:


It would be preferable to have an elegant solution work, without the cmake list mangling for example. Is it possible?

Cc: @robert.maynard