MantisBT - CMake
View Issue Details
0014415CMakeModulespublic2013-09-16 08:402015-04-14 08:24
Axel Huebl 
James Bigler 
normalfeaturealways
closednot fixable 
LinuxDebian/UbuntuWheezy
CMake 2.8.11 
 
0014415: FindCUDA.cmake INCLUDE_DIRECTORIES add/honor optional SYSTEM flag
Like GCC, nvcc knows and honors the "-isystem " include flag instead of "-I ".

It would be nice, if the CUDA_NVCC_INCLUDE_ARGS would not "copy all includes to -I" but use the appropriate isystem flag instead if it was set before:

  http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/FindCUDA.cmake;h=0390ae4ad78447c0ce1cb32a899e9d0f1218d952;hb=HEAD#l1040 [^]
Write an example CUDA program using, e.g. boost program options.
...
FIND_PACKAGE(Boost REQUIRED COMPONENTS program_options)
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
...

make VERBOSE=1

FindCUDA will add all SYSTEM libraries with -I instead of -isystem when calling nvcc.
Thats the line when it happens:
  http://cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/FindCUDA.cmake;h=0390ae4ad78447c0ce1cb32a899e9d0f1218d952;hb=HEAD#l1040 [^]
No tags attached.
related to 0015458closed Kitware Robot Expose SYSTEM INCLUDE_DIRECTORIES to CMake code 
Issue History
2013-09-16 08:40Axel HueblNew Issue
2013-09-16 08:56Brad KingAssigned To => James Bigler
2013-09-16 08:56Brad KingStatusnew => assigned
2015-03-18 17:46Axel HueblNote Added: 0038249
2015-03-18 18:09James BiglerNote Added: 0038250
2015-03-18 18:15Axel HueblNote Added: 0038251
2015-03-18 18:19James BiglerNote Added: 0038252
2015-03-18 18:25Axel HueblNote Added: 0038253
2015-03-18 18:26James BiglerNote Added: 0038254
2015-03-18 18:28James BiglerNote Added: 0038255
2015-03-18 18:28James BiglerStatusassigned => closed
2015-03-18 18:28James BiglerResolutionopen => not fixable
2015-04-14 08:24Brad KingRelationship addedrelated to 0015458

Notes
(0038249)
Axel Huebl   
2015-03-18 17:46   
hi, any are there planned updates on that issue? :)
(0038250)
James Bigler   
2015-03-18 18:09   
Since FindCUDA uses the get_directory_property(INCLUDE_DIRECTORIES) command, I'm not sure how to tell the difference between includes that are system paths and ones that are not. So far as I can tell the results from this command are only paths (no additional meta-data is associated with them). All calls to include_directories() are equal.
(0038251)
Axel Huebl   
2015-03-18 18:15   
Agreed, that is the problem that I found in the code linked above, too.
Is it possible that we need a (new) method in cmake itself that allows us to read/restore such meta-attributes for the individual directories?
(0038252)
James Bigler   
2015-03-18 18:19   
That might be possible, but adding additional information about the type of path would have to be brought up with the full CMake team and is beyond the scope of this bug. If such a feature was implemented, then FindCUDA could probably make use of it.
(0038253)
Axel Huebl   
2015-03-18 18:25   
that sounds like a plan, shall we open a corresponding new issue for that?
(0038254)
James Bigler   
2015-03-18 18:26   
Yeah, you should open a new bug for that. I'm going to close this bug as "not a bug" for now.
(0038255)
James Bigler   
2015-03-18 18:28   
Can't implement this feature until there is a way to tell the difference between system paths and not.