MantisBT - CMake
View Issue Details
0003462CMakeCMakepublic2006-06-30 06:392006-10-05 09:33
Jan Woetzel 
Brad King 
lowfeaturealways
closedfixed 
 
 
0003462: add SYSTEM option to INCLUDE_DIRECTORIES
Include directories can be specified with the standard
-I <dir>
or with
-isystem <dir>
to gcc.

Directories added with -isystem
are handled as "system directories" for
which the gcc compiler ignores warnings.

Adding this functionality as an OPTION,
e.g.
INCLUDE_DIRECTORIES( [AFTER|BEFORE] [SYSTEM] dir1 dir2 ..)
would be great in particular for cleaner "-pedantic" compilation of own code.
No tags attached.
Issue History

Notes
(0004398)
Jan Woetzel   
2006-07-04 10:20   
FYI:
This bug is related to 0003453.

I will add an option as aworkarounf to eitehr use -isystem or leave the _I as they are.

Jan.
(0005213)
Brad King   
2006-10-04 19:24   
Bug 0003453 can be fixed when this feature is implemented.
(0005214)
Brad King   
2006-10-04 19:33   
From the documentation of gcc's -I option:

If a standard system include directory, or a directory specified with
-isystem, is also specified with -I, the -I option will be ignored.
The directory will still be searched but as a system directory at its
normal position in the system include chain. This is to ensure that
GCC's procedure to fix buggy system headers and the ordering for the
include_next directive are not inadvertently changed. If you really
need to change the search order for system directories, use the
-nostdinc and/or -isystem options.


This means that we can leave the include directory stuff as-is and then add the compile flag -isystem for directories marked with this option.
(0005231)
Brad King   
2006-10-05 08:57   
The following changes implement this feature and test it.

/cvsroot/CMake/CMake/Modules/Platform/gcc.cmake,v <-- gcc.cmake
new revision: 1.13; previous revision: 1.12
/cvsroot/CMake/CMake/Source/cmIncludeDirectoryCommand.cxx,v <-- cmIncludeDirectoryCommand.cxx
new revision: 1.23; previous revision: 1.22
/cvsroot/CMake/CMake/Source/cmIncludeDirectoryCommand.h,v <-- cmIncludeDirectoryCommand.h
new revision: 1.13; previous revision: 1.12
/cvsroot/CMake/CMake/Source/cmLocalGenerator.cxx,v <-- cmLocalGenerator.cxx
new revision: 1.157; previous revision: 1.156
/cvsroot/CMake/CMake/Source/cmMakefile.cxx,v <-- cmMakefile.cxx
new revision: 1.360; previous revision: 1.359
/cvsroot/CMake/CMake/Source/cmMakefile.h,v <-- cmMakefile.h
new revision: 1.196; previous revision: 1.195
/cvsroot/CMake/CMake/Tests/Complex/CMakeLists.txt,v <-- CMakeLists.txt
new revision: 1.63; previous revision: 1.62
/cvsroot/CMake/CMake/Tests/Complex/Executable/CMakeLists.txt,v <-- CMakeLists.txt
new revision: 1.56; previous revision: 1.55
/cvsroot/CMake/CMake/Tests/Complex/Executable/testSystemDir.cxx,v <-- testSystemDir.cxx
initial revision: 1.1
/cvsroot/CMake/CMake/Tests/Complex/Library/testSystemDir.h,v <-- testSystemDir.h
initial revision: 1.1
(0005232)
Brad King   
2006-10-05 09:33   
The QNX gcc does not seem to have -isystem

/cvsroot/CMake/CMake/Modules/Platform/QNX.cmake,v <-- QNX.cmake
new revision: 1.4; previous revision: 1.3