Added support for CUDA_PATH which is present in the CUDA toolkit 3.2 onward.
This required changing how the paths were used. I now use the PATH_SUFFIXES parameter instead of putting the whole path in the command.
This commit is contained in:
parent
e0bc42aa4f
commit
8930938351
|
@ -443,7 +443,10 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR)
|
|||
# Search in the CUDA_BIN_PATH first.
|
||||
find_path(CUDA_TOOLKIT_ROOT_DIR
|
||||
NAMES nvcc nvcc.exe
|
||||
PATHS ENV CUDA_BIN_PATH
|
||||
PATHS
|
||||
ENV CUDA_PATH
|
||||
ENV CUDA_BIN_PATH
|
||||
PATH_SUFFIXES bin bin64
|
||||
DOC "Toolkit location."
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
@ -472,9 +475,10 @@ endif (NOT CUDA_TOOLKIT_ROOT_DIR)
|
|||
# CUDA_NVCC_EXECUTABLE
|
||||
find_program(CUDA_NVCC_EXECUTABLE
|
||||
NAMES nvcc
|
||||
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/bin"
|
||||
"${CUDA_TOOLKIT_ROOT_DIR}/bin64"
|
||||
PATHS "${CUDA_TOOLKIT_ROOT_DIR}"
|
||||
ENV CUDA_PATH
|
||||
ENV CUDA_BIN_PATH
|
||||
PATH_SUFFIXES bin bin64
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
# Search default search paths, after we search our own set of paths.
|
||||
|
@ -500,8 +504,10 @@ set(CUDA_VERSION_STRING "${CUDA_VERSION}")
|
|||
# CUDA_TOOLKIT_INCLUDE
|
||||
find_path(CUDA_TOOLKIT_INCLUDE
|
||||
device_functions.h # Header included in toolkit
|
||||
PATHS "${CUDA_TOOLKIT_ROOT_DIR}/include"
|
||||
PATHS "${CUDA_TOOLKIT_ROOT_DIR}"
|
||||
ENV CUDA_PATH
|
||||
ENV CUDA_INC_PATH
|
||||
PATH_SUFFIXES include
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
# Search default search paths, after we search our own set of paths.
|
||||
|
@ -516,19 +522,16 @@ macro(FIND_LIBRARY_LOCAL_FIRST _var _names _doc)
|
|||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# CUDA 3.2+ on Windows moved the library directoryies, so we need the new
|
||||
# and old paths.
|
||||
set(_cuda_64bit_lib_dir
|
||||
"${CUDA_TOOLKIT_ROOT_DIR}/lib/x64"
|
||||
"${CUDA_TOOLKIT_ROOT_DIR}/lib64"
|
||||
)
|
||||
set(_cuda_64bit_lib_dir "lib/x64" "lib64" )
|
||||
endif()
|
||||
# CUDA 3.2+ on Windows moved the library directories, so we need to new
|
||||
# (lib/Win32) and the old path (lib).
|
||||
find_library(${_var}
|
||||
NAMES ${_names}
|
||||
PATHS ${_cuda_64bit_lib_dir}
|
||||
"${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32"
|
||||
"${CUDA_TOOLKIT_ROOT_DIR}/lib"
|
||||
PATHS "${CUDA_TOOLKIT_ROOT_DIR}"
|
||||
ENV CUDA_PATH
|
||||
ENV CUDA_LIB_PATH
|
||||
PATH_SUFFIXES ${_cuda_64bit_lib_dir} "lib/Win32" "lib"
|
||||
DOC ${_doc}
|
||||
NO_DEFAULT_PATH
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue