From 09c996f8fb74ade00e50ef03fc6ac06e9235c19c Mon Sep 17 00:00:00 2001 From: Stefano Sinigardi Date: Thu, 1 Aug 2019 13:39:45 +0200 Subject: [PATCH] upgrade FindCUDNN module to better deal with dlls and targets --- cmake/Modules/FindCUDNN.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/Modules/FindCUDNN.cmake b/cmake/Modules/FindCUDNN.cmake index 3a6bc0d6..3aa2aa81 100644 --- a/cmake/Modules/FindCUDNN.cmake +++ b/cmake/Modules/FindCUDNN.cmake @@ -70,10 +70,11 @@ mark_as_advanced(CUDNN_LIBRARY CUDNN_INCLUDE_DIR) # Release libraries), we will set appropriate target properties for these. # 2. However, for most systems, we will only register the import location and # include directory. - -# Look for dlls, for Release and Debug libraries. if(WIN32) - string( REPLACE ".lib" ".dll" CUDNN_LIBRARY_DLL "${CUDNN_LIBRARY}" ) + set(CUDNN_DLL_DIR ${CUDNN_INCLUDE_DIR}) + list(TRANSFORM CUDNN_DLL_DIR APPEND "/../bin") + message(STATUS "CUDNN_DLL_DIR: ${CUDNN_DLL_DIR}") + find_file(CUDNN_LIBRARY_DLL NAMES cudnn64_7.dll PATHS ${CUDNN_DLL_DIR}) endif() if( CUDNN_FOUND AND NOT TARGET CuDNN::CuDNN )