[CMake] Problems building a MODULE library (OpenFX plugin) with correct cuda object linking

Robert Maynard robert.maynard at kitware.com
Thu Jan 12 17:15:43 EST 2017


Hi,

Here is a example that uses CUDA_WRAP_SRCS and separable compilation.
I quickly ported the code from a project, so it most likely has some
minor issues.

https://git.io/vMga3

On Thu, Jan 12, 2017 at 5:04 PM, Ingmar Rieger <dev at irieger.net> wrote:
> Hey,
>
> thank you for your answer. I already tried with CUDA_WRAP_SRCS but didn't
> really get how to use it and the
> https://cmake.org/cmake/help/v3.7/module/FindCUDA.html lacks of any samples
> really showing what is going on. How can I use CUDA_WRAP_SRCS to create the
> OBJECT and then add it to a library? add_library also only supports source
> files (Cannot find source file error when trying to add an object).
>
> Is there an example anywhere that demonstrates how to manually add a CUDA
> object there?
>
>
> On 2017-01-11 21:42, Robert Maynard wrote:
>>
>> I believe you will want to use the low level command CUDA_WRAP_SRCS
>> with the MODULE option. Since CUDA_WRAP_SRCS is a low level command,
>> If you need separable compilation you will need to manually invoke
>> those steps too ( read CUDA_SEPARABLE_COMPILATION documentation on
>> what methods you will need to use ).
>
>
>
> --
> Regards,
> Ingmar


More information about the CMake mailing list