[Cmake-commits] [cmake-commits] bigler committed FindCUDA.cmake 1.14 1.15

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jan 28 13:50:40 EST 2010


Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv3330

Modified Files:
	FindCUDA.cmake 
Log Message:
Add -rpath for cuda libraries on Apple.  They use @rpath in the library link names.


Index: FindCUDA.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindCUDA.cmake,v
retrieving revision 1.14
retrieving revision 1.15
diff -C 2 -d -r1.14 -r1.15
*** FindCUDA.cmake	28 Jan 2010 18:08:56 -0000	1.14
--- FindCUDA.cmake	28 Jan 2010 18:50:38 -0000	1.15
***************
*** 547,550 ****
--- 547,558 ----
  find_library_local_first(CUDA_CUDART_LIBRARY cudart "\"cudart\" library")
  set(CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY})
+ if(APPLE)
+   # We need to add the path to cudart to the linker using rpath, since the
+   # library name for the cuda libraries is prepended with @rpath.
+   get_filename_component(_cuda_path_to_cudart "${CUDA_CUDART_LIBRARY}" PATH)
+   if(_cuda_path_to_cudart)
+     list(APPEND CUDA_LIBRARIES -Wl,-rpath "-Wl,${_cuda_path_to_cudart}")
+   endif()
+ endif()
  
  # 1.1 toolkit on linux doesn't appear to have a separate library on



More information about the Cmake-commits mailing list