Add option to install libcudart
authorRoland Schulz <roland@utk.edu>
Sat, 3 Nov 2012 01:50:08 +0000 (21:50 -0400)
committerRoland Schulz <roland@utk.edu>
Mon, 5 Nov 2012 21:03:23 +0000 (16:03 -0500)
New option INSTALL_CUDART_LIB installs libcudart and adds it to cpack archive.
Would be good to enable option by default for cpack but I can't find a
way to do so.

Change-Id: I1ce7fe84a9c2c2d9ef0ee0962b871db9fa065607

src/kernel/CMakeLists.txt

index ea62fe9ea7b64afc115d4e8a9030500896302a7f..383416d0f9d21d9a349229f04821bc364053aeb9 100644 (file)
@@ -134,6 +134,21 @@ endforeach()
 
 install(TARGETS gmxpreprocess DESTINATION ${LIB_INSTALL_DIR} COMPONENT libraries-gmxpreprocess)
 
+if (INSTALL_CUDART_LIB) #can be set manual by user
+    if (GMX_OPENMM OR GMX_GPU)
+        foreach(CUDA_LIB ${CUDA_LIBRARIES})
+            string(REGEX MATCH "cudart" IS_CUDART ${CUDA_LIB})
+            if(IS_CUDART) #libcuda should not be installed
+                #install also name-links (linker uses those)
+                file(GLOB CUDA_LIBS ${CUDA_LIB}*)
+                install(FILES ${CUDA_LIBS} DESTINATION
+                    ${LIB_INSTALL_DIR} COMPONENT mdrun)
+            endif()
+        endforeach()
+    else()
+        message(WARNING "INSTALL_CUDART_LIB only makes sense with GMX_OPENMM or GMX_GPU")
+    endif()
+endif ()
 endif(GMX_FAHCORE)
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libgmxpreprocess.pc.cmakein ${CMAKE_CURRENT_BINARY_DIR}/libgmxpreprocess.pc @ONLY)