First off, you can&#39;t set nvcc flags via the SET_PROPERTIES function, nor should you set host compiled code properties here either, because these properties will only work for the CXX code added to the project and not the host compiled code nvcc generates.<br>

<br>If you want to do what you want you need to set the CUDA_NVCC_FLAGS_DEBUG or use the OPTION DEBUG flag to the CUDA_ADD_EXECUTABLE.<br><br>cuda_add_executable( nbody<br>  <a href="http://mycode.cu">mycode.cu</a><br>  OPTIONS -arch sm_10 -maxregcount=32<br>

  DEBUG -Xcompiler /EHsc,/W3,/nologo,/Od,/Zi<br>  )<br><br>Second, try to keep straight what flags are for nvcc and what are for the host code.  Host code flags should use -Xcompiler flag,flag,flag,flag.<br><br>Third, NVCC flags are lists not strings like the other CXX flags (this was a conscious choice, because the CXX flags are difficult to deal with as strings).  &quot;-arch sm_10&quot; will be one flag instead of two.  If you need to use quotes, use &#39;;&#39; to separate arguments. &quot;-arch;sm_10&quot;.<br>

<br>You should also set the definition before calling cuda_add_executable (add_definitions(-D_HOWZ_ABOUT_THIS_DEF)) or add -D_HOWZ_ABOUT_THIS_DEF to the OPTIONS or CUDA_NVCC_FLAGS.<br><br>The -m64 flag is added when CUDA_64_BIT_DEVICE_CODE is true.  This get&#39;s its default from CMAKE_SIZEOF_VOIDP which defines the bitness of the regular host code compiled from cxx files, but can be overridden in the CMake GUI or via something like this:<br>

<br>set(CUDA_64_BIT_DEVICE_CODE OFF)<br>cuda_add_executable(...)<br><br>You typically want the bitness to match that of the host code unless you are compiling to PTX.<br><br>James<br>