# set compute capability from environment variable (directly useable as nvcc flag)
if("$ENV{COMPUTE_CAPABILITY}" MATCHES "1.1")
  message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "1.2")
  message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "1.3")
  message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "2.0")
  message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "2.1")
  message("A minimum of compute capability 3.0 and CUDA 5.0 is needed!")
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "3.0")
  set(CUDA_NVCC_FLAGS -arch=sm_30)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "3.2")
  set(CUDA_NVCC_FLAGS -arch=sm_32)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "3.5")
  set(CUDA_NVCC_FLAGS -arch=sm_35)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "3.7")
  set(CUDA_NVCC_FLAGS -arch=sm_37)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "5.0")
  set(CUDA_NVCC_FLAGS -arch=sm_50)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "5.2")
  set(CUDA_NVCC_FLAGS -arch=sm_52)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "5.3")
  set(CUDA_NVCC_FLAGS -arch=sm_53)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "6.0")
  set(CUDA_NVCC_FLAGS -arch=sm_60)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "6.1")
  set(CUDA_NVCC_FLAGS -arch=sm_61)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "6.2")
  set(CUDA_NVCC_FLAGS -arch=sm_62)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "7.0")
  set(CUDA_NVCC_FLAGS -arch=sm_70)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "7.2")
  set(CUDA_NVCC_FLAGS -arch=sm_72)
elseif("$ENV{COMPUTE_CAPABILITY}" MATCHES "7.5")
  set(CUDA_NVCC_FLAGS -arch=sm_75)
else()
  set(CUDA_NVCC_FLAGS -arch=sm_30)
endif()

#------------- for further compiler flags see compiler_settings.cmake.txt -----------------
if(NOT CMAKE_BUILD_TYPE)
	set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/compiler_settings.cmake)
#----------------------------------------------------------------------------------------
