[CMake] isystem include of system library header with CUDA

Osuna Escamilla Carlos carlos.osuna at env.ethz.ch
Fri Apr 15 15:11:36 EDT 2016


Hello

sometime ago I sent this email concerning the behaviour of the SYSTEM in the include_directories.
I would appreciate if someone from cmake team could look at it, as we consider this a bug in cmake, and indeed properly passing -isystem to the compiler is essential, specially in CUDA when system library flood the compilation output with warning.

Thanks. Carlos

________________________________
Von: Osuna Escamilla Carlos
Gesendet: Sonntag, 14. Februar 2016 19:33
An: cmake at cmake.org
Betreff: isystem include of system library header with CUDA

Hi everybody

with cmake I have always used the SYSTEM keyword for the include_directories to include system libraries:

include_directories( SYSTEM ${Boost_INCLUDE_DIRS} )

in order to pass system include directories with compiler with -isystem.
The problem I have is that this does not seem to work with CUDA.

In FindCUDA.cmake, it seems that -I is hardcoded

  if(CUDA_NVCC_INCLUDE_DIRECTORIES)
    foreach(dir ${CUDA_NVCC_INCLUDE_DIRECTORIES})
      list(APPEND CUDA_NVCC_INCLUDE_ARGS -I${dir})
    endforeach()
  endif()

So the question is am I right? Or am I assuming something wrong?
If yes, it would be extremely useful if we could use the same mechanism to pass -isystem to nvcc, to avoid all the warnings from system libraries.

Thanks, Carlos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160415/28529972/attachment.html>


More information about the CMake mailing list