string(TOLOWER "${CMAKE_BUILD_TYPE}" PYUTILS_BUILD_TYPE)

if(GT_ENABLE_BACKEND_CUDA)
    if (GT_CUDA_COMPILATION_TYPE MATCHES "NVCC-CUDA")
        set(PYUTILS_COMPILER "${CMAKE_CUDA_COMPILER} ${CMAKE_CUDA_COMPILER_VERSION} (${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_VERSION})")
    else()
        set(PYUTILS_COMPILER "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_VERSION} (${CMAKE_CUDA_COMPILER} ${CMAKE_CUDA_COMPILER_VERSION})")
    endif()
else()
    set(PYUTILS_COMPILER "${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_VERSION}")
endif()

if(GT_SINGLE_PRECISION)
    set(PYUTILS_PRECISION "float")
else()
    set(PYUTILS_PRECISION "double")
endif()

if(GT_TESTS_ICOSAHEDRAL_GRID)
    set(PYUTILS_GRID "icosahedral")
else()
    set(PYUTILS_GRID "structured")
endif()

if(GT_ENABLE_BACKEND_X86)
    list(APPEND PYUTILS_BACKEND "x86")
endif()

if(GT_ENABLE_BACKEND_NAIVE)
    list(APPEND PYUTILS_BACKEND "naive")
endif()

if(GT_ENABLE_BACKEND_CUDA)
    list(APPEND PYUTILS_BACKEND "cuda")
endif()

if(GT_ENABLE_BACKEND_MC)
    list(APPEND PYUTILS_BACKEND "mc")
endif()

file(COPY . DESTINATION . FILES_MATCHING PATTERN *.py)
configure_file(pyutils/buildinfo.py.in pyutils/buildinfo.py)
