MantisBT - CMake
View Issue Details
0013665CMakeCMakepublic2012-11-08 17:012014-02-10 10:44
mwoehlke 
Stephen Kelly 
normalminorhave not tried
closedno change required 
x86_64Fedora17
CMake 2.8.10 
 
0013665: include_directories(SYSTEM) should promote
In some instances (possibly related to CMake version), include_directories(SYSTEM ${foo}) has no effect.
include_directories(${foo})
include_directories(SYSTEM ${foo})
It appears that CMake ignores an include_directories(SYSTEM) for include directories that already exist. This is more likely in large projects where e.g. a top-level CMake file (or even a UseFoo.cmake) includes directories without SYSTEM, and a leaf CMakeLists.txt does an include_directories(SYSTEM) of the same directories.

I think it would be better following the expected behavior of include_directories if, rather than ignore the directive if the directory is already in include_directories, to 'promote' it to SYSTEM (probably without changing the order).
No tags attached.
Issue History
2012-11-08 17:01mwoehlkeNew Issue
2012-11-08 17:23mwoehlkeNote Added: 0031506
2013-08-25 15:59Stephen KellyStatusnew => resolved
2013-08-25 15:59Stephen KellyResolutionopen => no change required
2013-08-25 15:59Stephen KellyAssigned To => Stephen Kelly
2014-02-10 10:44Robert MaynardNote Added: 0035077
2014-02-10 10:44Robert MaynardStatusresolved => closed

Notes
(0031506)
mwoehlke   
2012-11-08 17:23   
Never mind, problem seems to have been caused by misspelled INCLUDE_DIR variable in second include_directories. (Apparently I can't even close my own bugs?)
(0035077)
Robert Maynard   
2014-02-10 10:44   
Closing resolved issues that have not been updated in more than 4 months.