[CMake] Moving large MSVS projects to CUDA

Eric Noulard eric.noulard at gmail.com
Fri May 4 16:23:16 EDT 2012


2012/5/4 Ming <ymyang at wisc.edu>:
> Hello CMake community,
>
> I have experience using CMake to generate sime cuda-enabled executables
> (where the cpp’s reside in one folder, etc.).
> I am attempting to move a large project that utilizes CMake, from just c++
> to CUDA enabled c++.
>
> It is a project that generates a large set of libraries (comprising a
> toolkit), using various cmake scripts.  I have modified the “add_libraries”
> call to be “cuda_add_libraries”, and changed all of the .cc files to .cu
> (but with no additional CUDA code).  An approach I thought would be similar
> to changing a simple program from add_executable to “cuda_add_executable”
> and renaming the extension to “.cu”
> My goal was first to have it compile properly in its original form post
> migration, but am met with some very strange errors in visual studio.
>
> I am wondering if anyone else has undertaken such a migration before
> (libraries or binaries), and if so, what types of general steps need to be
> taken other than just telling CMake we’re adding “.cu” files?

I don't know for the migration but did you have a look at the FindCUDA module
shipped with CMake.
I'm no CUDA user but the module has a lot of features that may interest you.
like CUDA_ADD_LIBRARY or CUDA_ADD_EXECUTABLE macros.

see: cmake --help-module FindCUDA

-- 
Erk
Le gouvernement représentatif n'est pas la démocratie --
http://www.le-message.org


More information about the CMake mailing list