summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDA.cmake
diff options
context:
space:
mode:
authorKitware Robot <kwrobot@kitware.com>2012-08-13 17:50:14 (GMT)
committerBrad King <brad.king@kitware.com>2012-08-13 18:19:16 (GMT)
commit9db3116226cb99fcf54e936c833953abcde9b729 (patch)
treebd755ed9e616bbf1482a894bc7946980d81b7703 /Modules/FindCUDA.cmake
parent77543bde41b0e52c3959016698b529835945d62d (diff)
downloadCMake-9db3116226cb99fcf54e936c833953abcde9b729.zip
CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.gz
CMake-9db3116226cb99fcf54e936c833953abcde9b729.tar.bz2
Remove CMake-language block-end command arguments
Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style. Run the following shell code: for c in else endif endforeach endfunction endmacro endwhile; do echo 's/\b'"$c"'\(\s*\)(.\+)/'"$c"'\1()/' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | egrep -z -v 'Tests/CMakeTests/While-Endwhile-' | xargs -0 sed -i -f convert.sed && rm convert.sed
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r--Modules/FindCUDA.cmake66
1 files changed, 33 insertions, 33 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 94e4500..f152437 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -291,7 +291,7 @@ macro(CUDA_FIND_HELPER_FILE _name _extension)
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)
+endmacro()
#####################################################################
## CUDA_INCLUDE_NVCC_DEPENDENCIES
@@ -339,12 +339,12 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
#message("file ${f} not found")
set(CUDA_NVCC_DEPEND_REGENERATE TRUE)
endif()
- endforeach(f)
- else(CUDA_NVCC_DEPEND)
+ endforeach()
+ else()
#message("CUDA_NVCC_DEPEND false")
# No dependencies, so regenerate the file.
set(CUDA_NVCC_DEPEND_REGENERATE TRUE)
- endif(CUDA_NVCC_DEPEND)
+ endif()
#message("CUDA_NVCC_DEPEND_REGENERATE = ${CUDA_NVCC_DEPEND_REGENERATE}")
# No incoming dependencies, so we need to generate them. Make the
@@ -354,9 +354,9 @@ macro(CUDA_INCLUDE_NVCC_DEPENDENCIES dependency_file)
set(CUDA_NVCC_DEPEND ${dependency_file})
#message("Generating an empty dependency_file: ${dependency_file}")
file(WRITE ${dependency_file} "#FindCUDA.cmake generated file. Do not edit.\n")
- endif(CUDA_NVCC_DEPEND_REGENERATE)
+ endif()
-endmacro(CUDA_INCLUDE_NVCC_DEPENDENCIES)
+endmacro()
###############################################################################
###############################################################################
@@ -482,15 +482,15 @@ if(NOT CUDA_TOOLKIT_ROOT_DIR)
string(REGEX REPLACE "[/\\\\]?bin[64]*[/\\\\]?$" "" CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR})
# We need to force this back into the cache.
set(CUDA_TOOLKIT_ROOT_DIR ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Toolkit location." FORCE)
- endif(CUDA_TOOLKIT_ROOT_DIR)
+ endif()
if (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
if(CUDA_FIND_REQUIRED)
message(FATAL_ERROR "Specify CUDA_TOOLKIT_ROOT_DIR")
elseif(NOT CUDA_FIND_QUIETLY)
message("CUDA_TOOLKIT_ROOT_DIR not found or specified")
endif()
- endif (NOT EXISTS ${CUDA_TOOLKIT_ROOT_DIR})
-endif (NOT CUDA_TOOLKIT_ROOT_DIR)
+ endif ()
+endif ()
# CUDA_NVCC_EXECUTABLE
find_program(CUDA_NVCC_EXECUTABLE
@@ -595,7 +595,7 @@ find_library_local_first(CUDA_CUDA_LIBRARY cuda "\"cuda\" library (older version
# Add cuda library to the link line only if it is found.
if (CUDA_CUDA_LIBRARY)
set(CUDA_LIBRARIES ${CUDA_LIBRARIES} ${CUDA_CUDA_LIBRARY})
-endif(CUDA_CUDA_LIBRARY)
+endif()
mark_as_advanced(
CUDA_CUDA_LIBRARY
@@ -607,7 +607,7 @@ mark_as_advanced(
macro(FIND_CUDA_HELPER_LIBS _name)
find_library_local_first(CUDA_${_name}_LIBRARY ${_name} "\"${_name}\" library")
mark_as_advanced(CUDA_${_name}_LIBRARY)
-endmacro(FIND_CUDA_HELPER_LIBS)
+endmacro()
#######################
# Disable emulation for v3.1 onward
@@ -691,9 +691,9 @@ set(CUDA_SDK_SEARCH_PATH
# if(CMAKE_SIZEOF_VOID_P EQUAL 8)
# set(cuda_cutil_name cutil64)
-# else(CMAKE_SIZEOF_VOID_P EQUAL 8)
+# else()
# set(cuda_cutil_name cutil32)
-# endif(CMAKE_SIZEOF_VOID_P EQUAL 8)
+# endif()
# find_library(CUDA_CUT_LIBRARY
# NAMES cutil ${cuda_cutil_name}
@@ -743,8 +743,8 @@ find_package_handle_standard_args(CUDA
macro(CUDA_INCLUDE_DIRECTORIES)
foreach(dir ${ARGN})
list(APPEND CUDA_NVCC_INCLUDE_ARGS_USER -I${dir})
- endforeach(dir ${ARGN})
-endmacro(CUDA_INCLUDE_DIRECTORIES)
+ endforeach()
+endmacro()
##############################################################################
@@ -914,20 +914,20 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
if (CUDA_BUILD_EMULATION)
# Emulation.
set(nvcc_flags ${nvcc_flags} --device-emulation -D_DEVICEEMU -g)
- else(CUDA_BUILD_EMULATION)
+ else()
# Device mode. No flags necessary.
- endif(CUDA_BUILD_EMULATION)
+ endif()
if(CUDA_HOST_COMPILATION_CPP)
set(CUDA_C_OR_CXX CXX)
- else(CUDA_HOST_COMPILATION_CPP)
+ else()
if(CUDA_VERSION VERSION_LESS "3.0")
set(nvcc_flags ${nvcc_flags} --host-compilation C)
else()
message(WARNING "--host-compilation flag is deprecated in CUDA version >= 3.0. Removing --host-compilation C flag" )
endif()
set(CUDA_C_OR_CXX C)
- endif(CUDA_HOST_COMPILATION_CPP)
+ endif()
set(generated_extension ${CMAKE_${CUDA_C_OR_CXX}_OUTPUT_EXTENSION})
@@ -1080,11 +1080,11 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
set(generated_file_basename "${cuda_target}_generated_${basename}.ptx")
set(format_flag "-ptx")
file(MAKE_DIRECTORY "${cuda_compile_output_dir}")
- else( compile_to_ptx )
+ else()
set(generated_file_path "${cuda_compile_output_dir}/${CMAKE_CFG_INTDIR}")
set(generated_file_basename "${cuda_target}_generated_${basename}${generated_extension}")
set(format_flag "-c")
- endif( compile_to_ptx )
+ endif()
# Set all of our file names. Make sure that whatever filenames that have
# generated_file_path in them get passed in through as a command line
@@ -1118,17 +1118,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Convience string for output ###########################################
if(CUDA_BUILD_EMULATION)
set(cuda_build_type "Emulation")
- else(CUDA_BUILD_EMULATION)
+ else()
set(cuda_build_type "Device")
- endif(CUDA_BUILD_EMULATION)
+ endif()
# Build the NVCC made dependency file ###################################
set(build_cubin OFF)
if ( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
if ( NOT compile_to_ptx )
set ( build_cubin ON )
- endif( NOT compile_to_ptx )
- endif( NOT CUDA_BUILD_EMULATION AND CUDA_BUILD_CUBIN )
+ endif()
+ endif()
# Configure the build script
configure_file("${CUDA_run_nvcc}" "${custom_target_script}" @ONLY)
@@ -1203,12 +1203,12 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
list(REMOVE_DUPLICATES CUDA_ADDITIONAL_CLEAN_FILES)
set(CUDA_ADDITIONAL_CLEAN_FILES ${CUDA_ADDITIONAL_CLEAN_FILES} CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.")
- endif(${file} MATCHES ".*\\.cu$" AND NOT _is_header)
- endforeach(file)
+ endif()
+ endforeach()
# Set the return parameter
set(${generated_files} ${_cuda_wrap_generated_files})
-endmacro(CUDA_WRAP_SRCS)
+endmacro()
###############################################################################
@@ -1245,7 +1245,7 @@ macro(CUDA_ADD_LIBRARY cuda_target)
LINKER_LANGUAGE ${CUDA_C_OR_CXX}
)
-endmacro(CUDA_ADD_LIBRARY cuda_target)
+endmacro()
###############################################################################
@@ -1279,7 +1279,7 @@ macro(CUDA_ADD_EXECUTABLE cuda_target)
LINKER_LANGUAGE ${CUDA_C_OR_CXX}
)
-endmacro(CUDA_ADD_EXECUTABLE cuda_target)
+endmacro()
###############################################################################
@@ -1297,7 +1297,7 @@ macro(CUDA_COMPILE generated_files)
set( ${generated_files} ${_generated_files})
-endmacro(CUDA_COMPILE)
+endmacro()
###############################################################################
@@ -1315,7 +1315,7 @@ macro(CUDA_COMPILE_PTX generated_files)
set( ${generated_files} ${_generated_files})
-endmacro(CUDA_COMPILE_PTX)
+endmacro()
###############################################################################
###############################################################################
@@ -1364,4 +1364,4 @@ macro(CUDA_BUILD_CLEAN_TARGET)
# This is useful so that the files won't persist in the list after targets
# have been removed.
set(CUDA_ADDITIONAL_CLEAN_FILES "" CACHE INTERNAL "List of intermediate files that are part of the cuda dependency scanning.")
-endmacro(CUDA_BUILD_CLEAN_TARGET)
+endmacro()