CMake: Fix compilation error when toolkit gives empty result
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 9 May 2016 14:05:02 +0000 (16:05 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 9 May 2016 14:05:02 +0000 (16:05 +0200)
Should we also check whether toolkit exist perhaps?

intern/cycles/kernel/CMakeLists.txt

index 9f3fb66c85ad9595a815c13924693c96f460f6db..7080e83f715010347d9ad54dceef280320961326 100644 (file)
@@ -195,8 +195,8 @@ if(WITH_CYCLES_CUDA_BINARIES)
 
        # CUDA version
        execute_process(COMMAND ${CUDA_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT)
-       string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR ${NVCC_OUT})
-       string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR ${NVCC_OUT})
+       string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\1" CUDA_VERSION_MAJOR "${NVCC_OUT}")
+       string(REGEX REPLACE ".*release ([0-9]+)\\.([0-9]+).*" "\\2" CUDA_VERSION_MINOR "${NVCC_OUT}")
        set(CUDA_VERSION "${CUDA_VERSION_MAJOR}${CUDA_VERSION_MINOR}")
 
        # warn for other versions