Skip to content

Instantly share code, notes, and snippets.

@mitmul
Created May 11, 2013 16:44
Show Gist options
  • Select an option

  • Save mitmul/5560554 to your computer and use it in GitHub Desktop.

Select an option

Save mitmul/5560554 to your computer and use it in GitHub Desktop.
CUDA_SOURCES = $$system(find . -name "*.cu")
SOURCES = $$system(find . -name "*.cpp")
CUDA_DIR = /usr/local/cuda
CUDA_CC = $$CUDA_DIR/bin/nvcc
message("nvcc resides in :" $$CUDA_CC)
INCLUDEPATH += $$CUDA_DIR/include
INCLUDEPATH += /Developer/NVIDIA/CUDA-5.0/include
QMAKE_LIBDIR += $$CUDA_DIR/lib
QMAKE_LIBDIR += /Developer/NVIDIA/CUDA-5.0/lib
LIBS += -rpath /usr/local/cuda/lib -lcudart -lcuda
cuda.input = CUDA_SOURCES
cuda.output = ${QMAKE_FILE_BASE}.o
cuda.commands = $$CUDA_CC -c -m64 $$join(INCLUDEPATH,'" -I "','-I "','"') ${QMAKE_FILE_NAME} -o ${QMAKE_FILE_OUT}
QMAKE_EXTRA_COMPILERS += cuda
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment