<div dir="ltr">Hi,<div><br></div><div>I have been using the CMake find_package()-function to set the RTK_LIBRARIES variable in order to link my application with RTK, rtkcuda etc.</div><div><br></div><div>I noticed that RTK_LIBRARIES also contains the paths to the CUDA libaries: cuda, cudart, cufft, cublas.</div><div><br></div><div>I have had some problems with this, since my application (forced by a bug in FindCUDA for my CMake-version) needs to link with the static CUDA libraries, while RTK links with the dynamic (or static, I am not sure). Regardless, I end up with duplicate symbols for some cuda runtime API functions when linking with ${RTK_LIBRARIES} and ${CUDA_LIBRARIES} for my application.<br></div><div><br></div><div><div>So, the general question is: Should third-party libraries be included in the variable XXX_LIBRARIES after running find_package?</div><div><br></div><div>I am not sure, but I believe not. The patch below in RTK fixed the problems for me. Then, of course, I need to always link with CUDA from my independent project (an application in my case) when linking with RTK. But I guess that's the way it is typically done.</div></div><div><br></div><div><div>---</div><div> code/CMakeLists.txt | 2 +-</div><div> 1 file changed, 1 insertion(+), 1 deletion(-)</div><div><br></div><div>diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt</div><div>index 437274ec..a1cdcec3 100644</div><div>--- a/code/CMakeLists.txt</div><div>+++ b/code/CMakeLists.txt</div><div>@@ -62,7 +62,7 @@ target_link_libraries(RTK lpsolve55)</div><div> #=========================================================</div><div> # Cuda library stuff</div><div> if (RTK_USE_CUDA)</div><div>-  set (RTK_LIBRARIES ${RTK_LIBRARIES} rtkcuda ITKCudaCommon ${CUDA_CUDA_LIBRARY} ${CUDA_CUDART_LIBRARY} ${CUDA_CUFFT_LIBRARIES} ${CUDA_CUBLAS_LIBRARIES})</div><div>+  set (RTK_LIBRARIES ${RTK_LIBRARIES} rtkcuda ITKCudaCommon)</div><div>   set (rtkcuda_CUDA_FILES</div><div>        rtkCudaCropImageFilter.cu</div><div>        rtkCudaUtilities.cu</div><div>-- </div></div><div><br></div><div>Best wishes,</div><div>Fredrik</div></div>