Cross compile cuda application

Hi,

i have struggles to cross compile a simple cuda application on my host (ubuntu 18.04) for a jetson tx2.
Does there exists some good tutorial how to do it?

My current cmake file looks like (to be honest its a result of copying something from the internet and testing):

cmake_minimum_required(VERSION 3.22)
set(CMAKE_CUDA_COMPILER /usr/local/cuda-10.2/bin/nvcc)
project(cudatest LANGUAGES CUDA C)

enable_language(CUDA)
find_package(CUDA REQUIRED)
set(CMAKE_CUDA_ARCHITECTURES 62)
set(CUDA_NVCC_FLAGS “${CUDA_NVCC_FLAGS}” “-m64 -gencode arch=compute_62,code=compute_62”)
set(CMAKE_C_COMPILER /home/toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc)
set(CMAKE_CUDA_FLAGS “-ccbin ${CMAKE_C_COMPILER} -Xcompiler -fPIC” CACHE STRING “” FORCE)
set(CMAKE_CUDA_HOST_COMPILER “/home/toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc”)
set(CMAKE_C_COMPILER_ID NVIDIA)

include_directories("${CUDA_INCLUDE_DIRS}")

set(sources_cudaprint
./simplePrintf.cu)

set(include_cudaprint ${CMAKE_CURRENT_SOURCE_DIR})

add_executable(cudaprint ${sources_cudaprint})

target_link_libraries(cudaprint PRIVATE ${CUDA_LIBRARIES})

and here the build output. Building the object file seems ok for me. But linking fails and i don’t know why /usr/bin/g++ is used.

[ 50%] Building CUDA object CMakeFiles/cudaprint.dir/simplePrintf.cu.o
/usr/local/cuda-10.2/bin/nvcc -forward-unknown-to-host-compiler -I/usr/local/cuda/include -ccbin /home/toolchain/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc -Xcompiler -fPIC --generate-code=arch=compute_62,code=[compute_62,sm_62] -MD -MT CMakeFiles/cudaprint.dir/simplePrintf.cu.o -MF CMakeFiles/cudaprint.dir/simplePrintf.cu.o.d -x cu -c /home/cudacmake/simplePrintf.cu -o CMakeFiles/cudaprint.dir/simplePrintf.cu.o
[100%] Linking CUDA executable cudaprint
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cudaprint.dir/link.txt --verbose=1
/usr/bin/g++ CMakeFiles/cudaprint.dir/simplePrintf.cu.o -o cudaprint /usr/local/cuda/lib64/libcudart_static.a -ldl /usr/lib/x86_64-linux-gnu/librt.so -lpthread -lcudadevrt -lcudart_static -lrt -lpthread -ldl -L"/usr/local/cuda-10.2/targets/x86_64-linux/lib/stubs" -L"/usr/local/cuda-10.2/targets/x86_64-linux/lib"
/usr/bin/ld: CMakeFiles/cudaprint.dir/simplePrintf.cu.o: Relocations in generic ELF (EM: 183)

Any help is much appreciated.