Merge topic 'topics/FindCUDA/Misc-fixes'

aa36082 Miscellaneous fixes.
This commit is contained in:
David Cole 2011-12-07 16:45:35 -05:00 committed by CMake Topic Stage
commit 0ea95b99ce
1 changed files with 11 additions and 10 deletions

View File

@ -266,17 +266,17 @@ macro(CUDA_FIND_HELPER_FILE _name _extension)
# processed. Using this variable, we can pull out the current path, and # processed. Using this variable, we can pull out the current path, and
# provide a way to get access to the other files we need local to here. # provide a way to get access to the other files we need local to here.
get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(CMAKE_CURRENT_LIST_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
find_file(CUDA_${_name} ${_full_name} PATHS ${CMAKE_CURRENT_LIST_DIR}/FindCUDA NO_DEFAULT_PATH) set(CUDA_${_name} "${CMAKE_CURRENT_LIST_DIR}/FindCUDA/${_full_name}")
if(NOT CUDA_${_name}) if(NOT EXISTS "${CUDA_${_name}}")
set(error_message "${_full_name} not found in CMAKE_MODULE_PATH") set(error_message "${_full_name} not found in ${CMAKE_CURRENT_LIST_DIR}/FindCUDA")
if(CUDA_FIND_REQUIRED) if(CUDA_FIND_REQUIRED)
message(FATAL_ERROR "${error_message}") message(FATAL_ERROR "${error_message}")
else(CUDA_FIND_REQUIRED) else()
if(NOT CUDA_FIND_QUIETLY) if(NOT CUDA_FIND_QUIETLY)
message(STATUS "${error_message}") message(STATUS "${error_message}")
endif(NOT CUDA_FIND_QUIETLY) endif()
endif(CUDA_FIND_REQUIRED) endif()
endif(NOT CUDA_${_name}) endif()
# Set this variable as internal, so the user isn't bugged with it. # Set this variable as internal, so the user isn't bugged with it.
set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE) set(CUDA_${_name} ${CUDA_${_name}} CACHE INTERNAL "Location of ${_full_name}" FORCE)
endmacro(CUDA_FIND_HELPER_FILE) endmacro(CUDA_FIND_HELPER_FILE)
@ -320,9 +320,9 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
# message("CUDA_NVCC_DEPEND NOT set") # message("CUDA_NVCC_DEPEND NOT set")
# endif() # endif()
if(CUDA_NVCC_DEPEND) if(CUDA_NVCC_DEPEND)
#message("CUDA_NVCC_DEPEND true") #message("CUDA_NVCC_DEPEND found")
foreach(f ${CUDA_NVCC_DEPEND}) foreach(f ${CUDA_NVCC_DEPEND})
#message("searching for ${f}") # message("searching for ${f}")
if(NOT EXISTS ${f}) if(NOT EXISTS ${f})
#message("file ${f} not found") #message("file ${f} not found")
set(CUDA_NVCC_DEPEND_REGENERATE TRUE) set(CUDA_NVCC_DEPEND_REGENERATE TRUE)
@ -417,13 +417,14 @@ endforeach()
# if they have then clear the cache variables, so that will be detected again. # if they have then clear the cache variables, so that will be detected again.
if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}") if(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}")
unset(CUDA_NVCC_EXECUTABLE CACHE) unset(CUDA_NVCC_EXECUTABLE CACHE)
unset(CUDA_VERSION CACHE)
unset(CUDA_TOOLKIT_INCLUDE CACHE) unset(CUDA_TOOLKIT_INCLUDE CACHE)
unset(CUDA_CUDART_LIBRARY CACHE) unset(CUDA_CUDART_LIBRARY CACHE)
# Make sure you run this before you unset CUDA_VERSION.
if(CUDA_VERSION VERSION_EQUAL "3.0") if(CUDA_VERSION VERSION_EQUAL "3.0")
# This only existed in the 3.0 version of the CUDA toolkit # This only existed in the 3.0 version of the CUDA toolkit
unset(CUDA_CUDARTEMU_LIBRARY CACHE) unset(CUDA_CUDARTEMU_LIBRARY CACHE)
endif() endif()
unset(CUDA_VERSION CACHE)
unset(CUDA_CUDA_LIBRARY CACHE) unset(CUDA_CUDA_LIBRARY CACHE)
unset(CUDA_cublas_LIBRARY CACHE) unset(CUDA_cublas_LIBRARY CACHE)
unset(CUDA_cublasemu_LIBRARY CACHE) unset(CUDA_cublasemu_LIBRARY CACHE)