Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2011-10-17 15:24:20 +0400
committerThomas Dinges <blender@dingto.org>2011-10-17 15:24:20 +0400
commitc18e9a1bc6c3712da4ecaa4e49ecf8201993a58e (patch)
tree8daa35f453d2f60262715922475a9683a13ce7ce /intern/cycles/cmake
parentd537a1586d7bd4c1eef40a56d4d57be2df7b95ec (diff)
Cycles:
* Auto detection of CUDA toolkit, using FIND_PACKAGE(CUDA). (Requires at least CMAKE 2.8)
Diffstat (limited to 'intern/cycles/cmake')
-rw-r--r--intern/cycles/cmake/external_libs.cmake11
1 files changed, 8 insertions, 3 deletions
diff --git a/intern/cycles/cmake/external_libs.cmake b/intern/cycles/cmake/external_libs.cmake
index 07d45f9dd5d..b6a67a9b86c 100644
--- a/intern/cycles/cmake/external_libs.cmake
+++ b/intern/cycles/cmake/external_libs.cmake
@@ -89,10 +89,15 @@ endif()
# CUDA
if(WITH_CYCLES_CUDA)
- if(WIN32)
- set(CYCLES_CUDA "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v4.0" CACHE PATH "Path to CUDA installation")
+ FIND_PACKAGE(CUDA) # Try to auto locate CUDA toolkit
+ if(CUDA_FOUND)
+ set(CYCLES_CUDA ${CUDA_TOOLKIT_ROOT_DIR} CACHE PATH "Path to CUDA installation")
else()
- set(CYCLES_CUDA "/usr/local/cuda" CACHE PATH "Path to CUDA installation")
+ if(WIN32)
+ set(CYCLES_CUDA "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v4.0" CACHE PATH "Path to CUDA installation")
+ else()
+ set(CYCLES_CUDA "/usr/local/cuda" CACHE PATH "Path to CUDA installation")
+ endif()
endif()
set(CYCLES_CUDA_ARCH sm_10 sm_11 sm_12 sm_13 sm_20 sm_21 CACHE STRING "CUDA architectures to build for")
set(CYCLES_CUDA_MAXREG 24 CACHE STRING "CUDA maximum number of register to use")