target_include_directories ignores CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES for CUDA code
Hi!
I have a CUDA project made of C++ and CUDA files. I have added the following:
target_include_directories(my_lib SYSTEM PUBLIC ${CMAKE_CUDA_TOOLKIT_INCLUDE_DIRECTORIES})
This translates into g++ -isystem /usr/local/cuda...
as expected. However this is not applied to nvcc
, i.e. the -isystem
include is not there, it's ignored. This can be verified also in the CUDA_INCLUDES
vs CXX_INCLUDES
in the flags.cmake
file.
It's true that compiling with nvcc we already get those includes by default. However my use case is to have those includes as system libraries, because I'm getting a bunch of warnings from e.g. thrust
that I would like to ignore. This exact issue was already mentioned here but not much has happened since then:
https://gitlab.kitware.com/cmake/cmake/issues/16464
Would it be possible to either a) solve the previous issue or b) not ignore that include directory when compiling with nvcc?
Thanks!