summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDA.cmake
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-12-07 21:45:35 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2011-12-07 21:45:35 (GMT)
commit0ea95b99cebc23d9fbf7d50872176911f5f65f96 (patch)
treeae04d66cc26ba8e25e8116af2ee3118e3d36dbf7 /Modules/FindCUDA.cmake
parentc26e28754c2f61ba704924bd5051e4d12b88fabf (diff)
parentaa36082a2b62e7612838a7e777d2cfe104fa6e52 (diff)
downloadCMake-0ea95b99cebc23d9fbf7d50872176911f5f65f96.zip
CMake-0ea95b99cebc23d9fbf7d50872176911f5f65f96.tar.gz
CMake-0ea95b99cebc23d9fbf7d50872176911f5f65f96.tar.bz2
Merge topic 'topics/FindCUDA/Misc-fixes'
aa36082 Miscellaneous fixes.
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r--Modules/FindCUDA.cmake21
1 files changed, 11 insertions, 10 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 1de9042..18f7442 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -266,17 +266,17 @@ macro(CUDA_FIND_HELPER_FILE _name _extension)
# 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.
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)
- if(NOT CUDA_${_name})
- set(error_message "${_full_name} not found in CMAKE_MODULE_PATH")
+ set(CUDA_${_name} "${CMAKE_CURRENT_LIST_DIR}/FindCUDA/${_full_name}")
+ if(NOT EXISTS "${CUDA_${_name}}")
+ set(error_message "${_full_name} not found in ${CMAKE_CURRENT_LIST_DIR}/FindCUDA")
if(CUDA_FIND_REQUIRED)
message(FATAL_ERROR "${error_message}")
- else(CUDA_FIND_REQUIRED)
+ else()
if(NOT CUDA_FIND_QUIETLY)
message(STATUS "${error_message}")
- endif(NOT CUDA_FIND_QUIETLY)
- endif(CUDA_FIND_REQUIRED)
- endif(NOT CUDA_${_name})
+ endif()
+ endif()
+ endif()
# 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)
endmacro(CUDA_FIND_HELPER_FILE)
@@ -320,9 +320,9 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
# message("CUDA_NVCC_DEPEND NOT set")
# endif()
if(CUDA_NVCC_DEPEND)
- #message("CUDA_NVCC_DEPEND true")
+ #message("CUDA_NVCC_DEPEND found")
foreach(f ${CUDA_NVCC_DEPEND})
- #message("searching for ${f}")
+ # message("searching for ${f}")
if(NOT EXISTS ${f})
#message("file ${f} not found")
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(NOT "${CUDA_TOOLKIT_ROOT_DIR}" STREQUAL "${CUDA_TOOLKIT_ROOT_DIR_INTERNAL}")
unset(CUDA_NVCC_EXECUTABLE CACHE)
- unset(CUDA_VERSION CACHE)
unset(CUDA_TOOLKIT_INCLUDE CACHE)
unset(CUDA_CUDART_LIBRARY CACHE)
+ # Make sure you run this before you unset CUDA_VERSION.
if(CUDA_VERSION VERSION_EQUAL "3.0")
# This only existed in the 3.0 version of the CUDA toolkit
unset(CUDA_CUDARTEMU_LIBRARY CACHE)
endif()
+ unset(CUDA_VERSION CACHE)
unset(CUDA_CUDA_LIBRARY CACHE)
unset(CUDA_cublas_LIBRARY CACHE)
unset(CUDA_cublasemu_LIBRARY CACHE)