<div dir="ltr">I used the following code in 2.8.4, but in 2.8.9 and 2.8.10 it doesn't add the CUDA_CUDART_LIBRARY library to the eventual link line. I see my target linking against the parallelprim library but not the cudart library. Did something change in the interface between 2.8.4 and now?<div>
<br></div><div style>I'll continue to try and narrow down the version of CMake where this stopped working.</div><div style><br></div><div style><div><font face="courier new, monospace"> # Create an imported static target</font></div>
<div><font face="courier new, monospace"> add_library(parallelprim STATIC IMPORTED)</font></div><div><font face="courier new, monospace"> # This library pertains to all configurations</font></div><div><font face="courier new, monospace"> set_property(TARGET parallelprim APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)</font></div>
<div><font face="courier new, monospace"> # Set the location</font></div><div><font face="courier new, monospace"> set_target_properties(parallelprim PROPERTIES</font></div><div><font face="courier new, monospace"> IMPORTED_LOCATION_NOCONFIG "${PARALLELPRIM_LIBRARY}")</font></div>
<div><font face="courier new, monospace"> # Set list of dependent libraries (parallelprim needs cudart)</font></div><div><span style="font-family:'courier new',monospace"> set_target_properties(parallelprim PROPERTIES</span><br>
</div><div><font face="courier new, monospace"> IMPORTED_LINK_DEPENDENT_LIBRARIES ${CUDA_CUDART_LIBRARY})</font></div><div><br></div><div style>I also tried this and it didn't work:</div><div style><br></div><div style>
<div><font face="courier new, monospace"> # Create an imported static target</font></div><div><font face="courier new, monospace"> add_library(parallelprim STATIC IMPORTED)</font></div><div><font face="courier new, monospace"> # Set the location<br>
</font></div><div><font face="courier new, monospace"> set_target_properties(parallelprim PROPERTIES</font></div><div><font face="courier new, monospace"> IMPORTED_LOCATION "${PARALLELPRIM_LIBRARY}")</font></div>
<div><font face="courier new, monospace"> # Set list of dependent libraries (parallelprim needs cudart)</font></div><div><font face="courier new, monospace"> set_target_properties(parallelprim PROPERTIES<br></font></div>
<div><font face="courier new, monospace"> IMPORTED_LINK_DEPENDENT_LIBRARIES ${CUDA_CUDART_LIBRARY})</font></div><div><br></div><div style>Thanks,</div><div style>James</div></div></div></div>