Example of CMake file for CUDA+CPP code

Makefiles are quite straightforward and easy to write (in reasonable situations). But GNU Make is not crossplafrom. CMake is cross-platform, cross-application (it can generate projects for different IDEs and Makefile itself).

It also allows you to split source directory and directory with intermediate files and compiled binary. Now CMake natively supports CUDA.