upgrade FindCUDNN module to better deal with dlls and targets

This commit is contained in:
Stefano Sinigardi 2019-08-01 13:39:45 +02:00
parent 73baf8531e
commit 09c996f8fb
1 changed files with 4 additions and 3 deletions

View File

@ -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 )