[Cmake-commits] [cmake-commits] bigler committed FindCUDA.cmake 1.4 1.5
cmake-commits at cmake.org
cmake-commits at cmake.org
Mon Sep 28 23:17:15 EDT 2009
Update of /cvsroot/CMake/CMake/Modules
In directory public:/mounts/ram/cvs-serv15474
Modified Files:
FindCUDA.cmake
Log Message:
Fixed CUDA_PROPAGATE_HOST_FLAGS, added path for Mac SDK.
The CUDA_PROPAGATE_HOST_FLAGS was incorrect in that it prevented the CUDA_NVCC_FLAGS_CONFIG variable from getting filled.
Also, added a search path for the CUDA SDK install on Macs.
Index: FindCUDA.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Modules/FindCUDA.cmake,v
retrieving revision 1.4
retrieving revision 1.5
diff -C 2 -d -r1.4 -r1.5
*** FindCUDA.cmake 25 Sep 2009 19:42:53 -0000 1.4
--- FindCUDA.cmake 29 Sep 2009 03:17:13 -0000 1.5
***************
*** 199,202 ****
--- 199,203 ----
# CUDA_VERSION_STRING -- CUDA_VERSION_MAJOR.CUDA_VERSION_MINOR
#
+ # CUDA_TOOLKIT_ROOT_DIR -- Path to the CUDA Toolkit (defined if not set).
# CUDA_INCLUDE_DIRS -- Include directory for cuda headers. Added automatically
# for CUDA_ADD_EXECUTABLE and CUDA_ADD_LIBRARY.
***************
*** 579,582 ****
--- 580,584 ----
"$ENV{NVSDKCUDA_ROOT}"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]"
+ "/Developer/GPU\ Computing/C"
)
***************
*** 856,870 ****
# Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We
# always need to set the SHARED_FLAGS, though.
! if(NOT CUDA_PROPAGATE_HOST_FLAGS)
! set(CUDA_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})")
! else()
set(CUDA_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})")
! set(CUDA_NVCC_FLAGS_CONFIG "# Build specific configuration flags")
! # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake
! foreach(config ${CUDA_configuration_types})
! string(TOUPPER ${config} config_upper)
! # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS
! # we convert the strings to lists (like we want).
# nvcc chokes on -g3, so replace it with -g
if(CMAKE_COMPILER_IS_GNUCC)
--- 858,875 ----
# Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We
# always need to set the SHARED_FLAGS, though.
! if(CUDA_PROPAGATE_HOST_FLAGS)
set(CUDA_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})")
! else()
! set(CUDA_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})")
! endif()
+ set(CUDA_NVCC_FLAGS_CONFIG "# Build specific configuration flags")
+ # Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake
+ foreach(config ${CUDA_configuration_types})
+ string(TOUPPER ${config} config_upper)
+ # CMAKE_FLAGS are strings and not lists. By not putting quotes around CMAKE_FLAGS
+ # we convert the strings to lists (like we want).
+
+ if(CUDA_PROPAGATE_HOST_FLAGS)
# nvcc chokes on -g3, so replace it with -g
if(CMAKE_COMPILER_IS_GNUCC)
***************
*** 873,883 ****
set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
endif()
set(CUDA_HOST_FLAGS "${CUDA_HOST_FLAGS}\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})")
! # Note that if we ever want CUDA_NVCC_FLAGS_<CONFIG> to be string (instead of a list
! # like it is currently), we can remove the quotes around the
! # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_<CONFIG> variable.
! set(CUDA_NVCC_FLAGS_CONFIG "${CUDA_NVCC_FLAGS_CONFIG}\nset(CUDA_NVCC_FLAGS_${config_upper} \"${CUDA_NVCC_FLAGS_${config_upper}};${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}}\")")
! endforeach()
! endif()
if(compile_to_ptx)
--- 878,890 ----
set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
endif()
+
set(CUDA_HOST_FLAGS "${CUDA_HOST_FLAGS}\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})")
! endif()
!
! # Note that if we ever want CUDA_NVCC_FLAGS_<CONFIG> to be string (instead of a list
! # like it is currently), we can remove the quotes around the
! # ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_<CONFIG> variable.
! set(CUDA_NVCC_FLAGS_CONFIG "${CUDA_NVCC_FLAGS_CONFIG}\nset(CUDA_NVCC_FLAGS_${config_upper} \"${CUDA_NVCC_FLAGS_${config_upper}};;${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}}\")")
! endforeach()
if(compile_to_ptx)
More information about the Cmake-commits
mailing list