<div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">--snip--<div class="im"><br>Ah you&#39;re on windows, make sure that you deselect the option to<br>

associate the build rule with cu files as this does the wrong thing<br>
when you&#39;re compiling the same file multiple times with different<br>
defines.<br></div>--end snip--<br><br>Can you give me more info on this?  I have looked in CMake variables using search in CMake GUI, and googled on the web snippets of your text, but I did not find anything.  I&#39;ll keep looking.<font color="#888888"></font><br>

</blockquote></div><br>Ok so I got back to having to resolve this issue and I found the reference you made to &quot;associating the build rules&quot; in the CMake Manual Cuda section <a href="http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:FindCUDA">http://www.cmake.org/cmake/help/cmake-2-8-docs.html#module:FindCUDA</a>.  The flag in question is CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE which is documented as follows<br>
<br>--snip--<br>  CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE (Default ON)<br>  -- Set to ON if you want the custom build rule to be attached to the source<br>     file in Visual Studio.  Turn OFF if you add the same cuda file to multiple<br>
     targets.<br><br><br>     This allows the user to build the target from the CUDA file; however, bad<br>     things can happen if the CUDA source file is added to multiple targets.<br>     When performing parallel builds it is possible for the custom build<br>
     command to be run more than once and in parallel causing cryptic build<br>     errors.  VS runs the rules for every source file in the target, and a<br>     source can have only one rule no matter how many projects it is added to.<br>
     When the rule is run from multiple targets race conditions can occur on<br>     the generated file.  Eventually everything will get built, but if the user<br>     is unaware of this behavior, there may be confusion.  It would be nice if<br>
     this script could detect the reuse of source files across multiple targets<br>     and turn the option off for the user, but no good solution could be found.<br>--end snip--<br><br>The bits about parallel builds, cryptic build errors, and bad things happening make me uneasy. <br>
<br>This does have an effect on my build, but not the one desired.   What I end up with is now both GPU_RECON and CPU_RECON defined for each project not simply the first, GPU_RECON, as before.<br><br>--snip--<br>C:/CUDA/bin64/nvcc.exe C:/Users/bdavis5/Documents/QS/QS-NIH/source/branches/trunk/source/Matlab/lib/3rdParty/Siemens/gpu/PMatrixRecon/gpuPMatrixRecon.cu -arch sm_13 --ptxas-options=-v -maxrregcount=32 -Xcompiler /EHsc,/W3,/nologo,/Od,/Zi,/MTd -m64 -DgpuReconPlugin_EXPORTS=yes -DGPU_RECON=yes -DCUDADeviceProperties_DLLExport=yes -DGPU_RECON=yes -DCUDADeviceProperties_DLLExport=yes -DCPU_RECON=yes -DcpuPMatrixRecon_EXPORTS -ccbin &quot;c:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin&quot; -DNVCC -M -o C:/Users/bdavis5/Documents/QS/QS-NIH/source/branches/trunk/build/dvip4-Win64/source/Matlab/lib/3rdParty/Siemens/gpu/PMatrixRecon/CMakeFiles/cpuPMatrixRecon_generated_gpuPMatrixRecon.cu.obj.NVCC-depend -IC:/CUDA/include -IC:/Users/bdavis5/Documents/QS/QS-NIH/source/branches/trunk/source/cpp/lib/3rdParty/Win/boost-cmake-1_41_0 &quot;-IC:/ProgramData/NVIDIA Corporation/NVIDIA GPU Computing SDK/C/common/inc&quot; -IC:/Users/bdavis5/Documents/QS/QS-NIH/source/branches/trunk/build/Windows-6.0/install/include/vtk-5.6 -IC:/Users/bdavis5/Documents/QS/QS-NIH/source/branches/trunk/build/Windows-6.0/install/include/VTKEdge &quot;-IC:/Program Files/MATLAB/R2010a/extern/include&quot; -IC:/Users/bdavis5/Documents/QS/QS-NIH/source/branches/trunk/source/Matlab/lib/3rdParty/Siemens/gpu/PMatrixRecon/. -IC:/CUDA/include<br>
--end snip--<br><br>Note the <br>--snip--<br> -DgpuReconPlugin_EXPORTS=yes -DGPU_RECON=yes 
-DCUDADeviceProperties_DLLExport=yes -DGPU_RECON=yes 
-DCUDADeviceProperties_DLLExport=yes -DCPU_RECON=yes -DcpuPMatrixRecon<br>--end snip<br><br>It appears as though CMake keeps tacking on the the compile flags for CU and other targets of which there are three targets in this directory.  Maybe I need multiple directories for each target ugh!  or a new build tool.<br>
<br>Though this is a step I am not sure it is in the right direction. <br><br>Thanks for the lead though it was worth a try.<br><br><br><br><br>