<div dir="ltr"><span style="color:rgb(33,33,33);font-size:13px">Hi,</span><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">I'm having an issue with CUDA (sadly the old-style FindCUDA, not the new native support of CUDA).</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">The following CMake file reproduces the issue easily on Windows with any Visual Studio Generator (14 2015 Win64 being the one I use).</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">Adding the file generated by cuda_compile_ptx to any target (even a custom one) causes CMake to be re-run at compile time.</div><div style="color:rgb(33,33,33);font-size:13px">Which is very annoying, but causes build errors on multi-threaded builds (permission denied on the vcxproj generated by this CMakeLists.). Of course, such issues cannot be reproduced with this simple CMakeLists file.</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">Am I misusing the cuda_compile_ptx method ?</div><div style="color:rgb(33,33,33);font-size:13px">Is there a way to prevent such CMake runs during compile time to occur ?</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px">Thanks.</div><div style="color:rgb(33,33,33);font-size:13px"><br></div><div style="color:rgb(33,33,33);font-size:13px"><div>project(testCuda)</div><div>cmake_minimum_required(VERSION 3.10.2)</div><div>find_package(CUDA 9.2 REQUIRED)<br></div><div><br></div><div>CUDA_COMPILE_PTX(OBJECT_FILES Arithmetic.cu)</div><div><br></div><div>add_library(stuff SHARED SoArithmetic.cxx ${OBJECT_FILES})</div></div></div>