target_include_directories is an useful CMake directive to specify the include directories for building a particular target, as described here. The FindCUDA module for CMake which handles CUDA compilation seems to completely ignore this directive. The include directories specified for the target are not passed to CUDA compilation by nvcc.
This will most commonly result in errors of the form:
someheader.h: No such file or directory.
This is a well known limitation of the CUDA module of CMake, as documented here. There seems to be no plan currently to support
target_include_directories for CUDA compilation.
The only solution is to switch to
include_directories to add these directories for all the targets in the
Tried with: CMake 22.214.171.124, CUDA 6.5 and Ubuntu 14.04